Fetch live and upcoming dota games with stream links
npm install --save dota-watch
The examples
directory contains an example file on how to interact with the module.
all api calls except the constructor are promises.
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")
used to initialized the dotaWatch client, all function and divided into two parts as Initialized and Non-Initialized functions
dotaWatch.initialize().then((res) => {
...
})
these function can be used without initilization of the dotaWatch client
get a list of all the pro players
dotaWatch.getProPlayers().then((res) => {
...
})
gets a list of all the dota2 heros
dotaWatch.getHeros().then((res) => {
...
})
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) => {
...
})
gets a list of all the Pro Leagues in dota2
dotaWatch.getLeagues().then((res) => {
...
})
these function can be only used after initilization of the dotaWatch client has returned successfully
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) => {
...
})
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) => {
...
})
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) => {
...
})
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) => {
...
})
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!
c00kie17