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

  • 2.2.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
289
increased by87.66%
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 => {
    ...
})

See schema


getMatches

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

OptionTypeDefault ValueDescription
----
HLTV.getMatches().then((res) => {
  ...
})

See schema for Live Matches

See schema for Upcoming Matches


getMatchesStats

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

OptionTypeDefault ValueDescription
startDatestring?--
endDatestring?--
matchTypeMatchType?--
mapsMap[]?--
HLTV.getMatchesStats({startDate: '2017-07-10', endDate: '2017-07-18'}).then((res) => {
  ...
})

See schema


getMatchMapStats

Parses info from the single map stats page (hltv.org/stats/matches/mapstatsid/*/*)

OptionTypeDefault ValueDescription
idnumber--
HLTV.getMatchMapStats({id: 49968}).then((res) => {
  ...
})

See schema


getResults

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

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

See schema


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) => {
  ...
})

See schema


getRecentThreads

Parses the latest threads on the front page of HLTV

OptionTypeDefault ValueDescription
----
HLTV.getRecentThreads().then((res) => {
  ...
})

See schema

getTeamRanking

Parses the info from the hltv.org/ranking/teams/ page

OptionTypeDefault ValueDescription
yearstring--
monthstring-Must be lowercase and in MMMM format
daystring--
// If you don't provide a filter the latest ranking will be parsed
HLTV.getTeamRanking({year: '2017', month: 'may', day: '29'}).then((res) => {
  ...
})

See schema


getTeam

Parses the info from the hltv.org/team/ page

OptionTypeDefault valueDescription
idint-The team id
HLTV.getTeam({id: 6137}).then(res => {
    ...
})

See schema


getTeamStats

Parses the info from the hltv.org/stats/teams/ page

OptionTypeDefault valueDescription
idint-The team id
HLTV.getTeamStats({id: 6137}).then(res => {
    ...
})

See schema


connectToScorebot

Presents an interface to receive data when the HLTV scorebot updates

OptionTypeDefault ValueDescription
idint-The match ID
onScoreboardUpdatefunction?-Callback that is called when there is new scoreboard data
onLogUpdatefunction?-Callback that is called when there is new game log data
onConnectfunction?-Callback that is called when a connection with the scorebot is established
onDisconnectfunction?-Callback that is called when the scorebot disconnects
HLTV.connectToScorebot({id: 2311609, onScoreboardUpdate: (data) => {
    ...
}, onLogUpdate: (data) => {
    ...
}})

The onLogUpdate callback is passed an LogUpdate object

The onScoreboardUpdate callback is passed an ScoreboardUpdate object

Keywords

FAQs

Package last updated on 23 Aug 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