Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hltv

Package Overview
Dependencies
Maintainers
1
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hltv

The unofficial HLTV Node.js API

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
121
decreased by-29.65%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status Dependency Status devDependencies Status

pyarray logo
The unofficial HLTV Node.js API

#Table of contents

Installation

NPM

Usage

import HLTV from 'hltv'
// Or if you're stuck with CommonJS
const HLTV = require('hltv')

//create an object before using the API
const hltv = new HLTV()

API

getMatch

Parses most information from a match page

OptionTypeDefault valueDescription
idstring-The match id
hltv.getMatch({id: '2306295-sk-natus-vincere-eleague-season-2'}).then(res => {
    ...
})

Results in an object with the following schema:

PropertyTypeNote
team1string
team1Idint
team2string
team2Idint
datestringe.g. "12th of November 2016 22:30"
formatstring
additionalInfostringe.g. "* Grand final"
eventobjectObject schema: {name: string, link: string}
maps[objects]Object schema: {name: string, result: string}
demos[objects]Object schema: {name: string, link: string}
highlightsarray
playersarray

getMatches

Parses all matches from the hltv.org/matches/ page

OptionTypeDefault ValueDescription
  • | - | - | - |
hltv.getMatches().then((res) => {
  ...
})

Results in an array of objects with the following schema:

PropertyTypeNote
timestringWill be undefined if the match is live or finished
team1string
team1Idint
team2string
team2Idint
mapstringOnly exists if the match is BO1
formatstring
labelstringMainly used when the teams are still unknown (e.g. "iBP Masters Grand Final")
idstring
liveboolean
finishedboolean

getLatestResults

Parses all matches from the hltv.org/results/ page

OptionTypeDefault ValueDescription
pagesint1Number of pages with results to be parsed
hltv.getLatestResults({pages: 2}).then((res) => {
  ...
})

Results in an array of objects with the following schema:

PropertyTypeNote
resultstringe.g. "2 - 0" or "16 - 9"
team1string
team1Idint
team2string
team2Idint
mapstringOnly exists if the match is BO1
formatstring
idstring

getStreams

Parses all streams present on the front page of HLTV

OptionTypeDefault ValueDescription
loadLinksbooleanfalseEnables parsing of the stream links. Its an option since it can slow down the response (every stream is a separate request).
hltv.getStreams().then((res) => {
  ...
})

Results in an array of objects with the following schema:

PropertyTypeNote
namestring
categorystringe.g. "Caster" or "Female player"
countrystringAn ISO 3166 code
hltvLinkstring
realLinkstringOnly if the loadLinks flag is enabled
viewersint

Keywords

FAQs

Package last updated on 13 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc