Git Product home page Git Product logo

hltv's Introduction

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

Option Type Default value Description
id int - The match id
hltv.getMatch({id: 2306295}).then(res => {
    ...
})

Results in an object with the following schema:

Property Type Note
team1 string
team1Id int
team2 string
team2Id int
date string e.g. "12th of November 2016 22:30"
format string
additionalInfo string e.g. "* Grand final"
event object Object schema: {name: string, link: string}
maps [objects] Object schema: {map: string, result: string}
streams [objects] Object schema: {name: string, link: string}
highlights array
players array
title string Mainly used when the teams are still unknown (e.g. "iBP Masters Grand Final")

getMatches

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

Option Type Default Value Description
- - - -
hltv.getMatches().then((res) => {
  ...
})

Results in 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 int
team2 string
team2Id int
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 int
eventId int
live boolean
finished boolean

getLatestResults

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

Option Type Default Value Description
pages int 1 Number of pages with results to be parsed
hltv.getLatestResults({pages: 2}).then((res) => {
  ...
})

Results in an array of objects with the following schema:

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

getStreams

Parses all streams present on the front page of HLTV

Option Type Default Value Description
loadLinks boolean false Enables 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:

Property Type Note
name string
category string e.g. "Caster" or "Female player"
country string An ISO 3166 code
hltvLink string
realLink string Only if the loadLinks flag is enabled
viewers int

getActiveThreads

Parses the latest threads on the front page of HLTV

Option Type Default Value Description
- - - -
hltv.getActiveThreads().then((res) => {
  ...
})

Results in an array of objects with the following schema:

Property Type Note
title string
link string
replies int

hltv's People

Contributors

gigobyte avatar redzumi avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.