dota-watch

fetch live and upcoming dota games with stream links

Usage no npm install needed!

<script type="module">
  import dotaWatch from 'https://cdn.skypack.dev/dota-watch';
</script>

README

dota-watch

npm license github-issues Circle CI build status stars

nodei.co

Fetch live and upcoming dota games with stream links

Install

npm install --save dota-watch

Examples

The examples directory contains an example file on how to interact with the module.

API

all api calls except the constructor are promises.

new dotaWatch(steamKey,twitchKey)

The dotaWatch client object is created

Param Type Description
steamKey string Your steam api key ,you can find more info about it here
twitchKey string Your twitch api key ,you can find more info about it here
var dotaWatch = new dotawatch("steamkey","twitchkey")

.initialize()

used to initialized the dotaWatch client, all function and divided into two parts as Initialized and Non-Initialized functions

dotaWatch.initialize().then((res) => {
  ...
})

Non-Initialized functions

these function can be used without initilization of the dotaWatch client

.getProPlayers()

get a list of all the pro players

dotaWatch.getProPlayers().then((res) => {
  ...
})

.getHeros()

gets a list of all the dota2 heros

dotaWatch.getHeros().then((res) => {
  ...
})

.getEconItem()

gets the econ item file containing all items available in the dota2 client. This API calls takes some time to complete as the data is huge. consider saving the data locally instead of calling this again.

dotaWatch.getEconItem().then((res) => {
  ...
})

.getLeagues()

gets a list of all the Pro Leagues in dota2

dotaWatch.getLeagues().then((res) => {
  ...
})

Initialized functions

these function can be only used after initilization of the dotaWatch client has returned successfully

.getUpcomingGames(maxDate)

gets upcoming Pro Dota2 games

Param Type Description
maxDate int epoch timestamp in seconds, the max date till you want upcoming games
dotaWatch.getUpcomingGames(1563353353).then((res) => {
  ...
})

.getLivePubGames(minSpectators)

get live Pub games

Param Type Description
minSpectators int minimum number of spectators a game should have to make it in the list
dotaWatch.getLivePubGames(0).then((res) => {
  ...
})

.getLiveLeagueGames(minSpectators)

get live League games

Param Type Description
minSpectators int minimum number of spectators a game should have to make it in the list
dotaWatch.getLiveLeagueGames(0).then((res) => {
  ...
})

.getScoreboard(serverSteamId)

gets the scoreboard of a specified game

Param Type Description
serverSteamId string the server steam id of the game you want the scoreboard
dotaWatch.getScoreboard("serverSteamId value").then((res) => {
  ...
})

Contributing

Contributions welcome; Please submit all pull requests the against master branch. If your pull request contains JavaScript patches or features, you should include relevant unit tests. Please check the Contributing Guidelines for more details. Thanks!

Author

c00kie17

License