JSPM

  • Created
  • Published
  • Downloads 625
  • Score
    100M100P100Q126127F
  • License ISC

The unofficial HLTV Node.js API

Package Exports

  • hltv

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hltv) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

pyarray logo
The unofficial HLTV Node.js API

Installation

npm install hltv --save

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

getMatches

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

Parameters Type Default Value
None - -
hltv.getMatches().then((res) => {
  ...
})

The callback receives an array of objects with the following schema:

Property Type Note
time string Will be undefined if the match is live or finished
team1 string
team1Id string
team2 string
team2Id string
map string Only exists if the match is BO1
format string
label string Mainly used when the teams are still unknown (e.g. "iBP Masters Grand Final")
id string
live boolean
finished boolean

getLatestResults

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

Parameters Type Default Value
pages int 1
hltv.getLatestResults(2).then((res) => {
  ...
})

The callback receives an array of objects with the following schema:

Property Type Note
result string e.g. '2 - 0' or '16 - 9'
team1 string
team1Id string
team2 string
team2Id string
map string Only exists if the match is BO1
format string
id string