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

  • 1.0.0
  • Source
  • npm
  • Socket score

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

Dependency Status devDependencies Status

pyarray logo
The unofficial HLTV Node.js API

:star: This package supports the new HLTV that was deployed on May 22nd.

Table of contents

Installation

NPM

Usage

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

API

getMatch

Parses most information from a match page

OptionTypeDefault valueDescription
idint-The match id
HLTV.getMatch({id: 2306295}).then(res => {
    ...
})

Results in an object with the following schema:

PropertyTypeNote
team1string?
team1Idint?
team2string?
team2Idint?
dateintUnix timestamp
formatstring
additionalInfostring?e.g. "* Grand final"
eventobjectObject schema: {name: string, link: string}
maps[objects]Object schema: {map: string, result: string}
streams[objects]Object schema: {name: string, link: string}
playersobjectObject schema: {$team1$: [string], $team2$: [string]}
titlestring?Exists when the teams are still unknown (e.g. "iBP Masters Grand Final")

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
dateintUnix timestamp, will be undefined if the match is live
team1string?
team1Idint?
team2string?
team2Idint?
maps[string]?Only exists if the match is BO1 or if the match is live
formatstring?
labelstring?Exists when the teams are still unknown (e.g. "iBP Masters Grand Final")
idint
eventobjectObject schema: {name: string, id: int}
liveboolean

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
maps[string]?Only exists if the match is BO1
formatstring
idstring
eventobjectObject schema: {name: string, id: int}

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"
countryobjectObject schema: {name: string, code: string}
hltvLinkstring
realLinkstringOnly if the loadLinks flag is enabled
viewersint

getActiveThreads

Parses the latest threads on the front page of HLTV

OptionTypeDefault ValueDescription
----
hltv.getActiveThreads().then((res) => {
  ...
})

Results in an array of objects with the following schema:

PropertyTypeNote
titlestring
linkstring
repliesint

Keywords

FAQs

Package last updated on 03 Jun 2017

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