Dota2 web api node.js version.See detail here
npm install dota2-api
Example:
var Dota2Api = require('dota2-api');
var da = Dota2Api.create('a key');
da.getMatchHistory(function(err, result){
if(!err)
console.log(result);
})
Methods relating to Dota 2 matches.
Create Dota2Api instance,require a key.(if no, see here)
List of IDs:
- 570 Dota 2 (default)
- 816 Dota 2 internal test
- 205790 Dota 2 (beta) test
var da = Dota2Api.create('a key', 570);
Information about DotaTV-supported leagues.
da.getLeagueListing({language: 'zh'}, function(err, result){
if(!err)
console.log(result);
})
A list of in-progress league matches, as well as details of that match as it unfolds.
da.getLiveLeagueGames(function(err, result){
if(!err)
console.log(result);
})
Information about a particular match.
da.getMatchDetails({match_id: 'xxx'}, function(err, result){
if(!err)
console.log(result);
})
A list of matches, filterable by various parameters.
da.getMatchHistory(function(err, result){
if(!err)
console.log(result);
})
A list of matches ordered by their sequence num.
da.getMatchHistoryBySequenceNum(function(err, result){
if(!err)
console.log(result);
})
A list of scheduled league games coming up.
da.getScheduledLeagueGames(function(err, result){
if(!err)
console.log(result);
})
A list of all the teams set up in-game.
da.getTeamInfoByTeamID(function(err, result){
if(!err)
console.log(result);
})
Stats about a particular player within a tournament.
da.getTournamentPlayerStats({account_id: 'xxx'}, function(err, result){
if(!err)
console.log(result);
})
Methods relating to Dota 2.
Dota 2 item rarity list.
da.getRarities({language: 'zh'}, function(err, result){
if(!err)
console.log(result);
})
A list of heroes within Dota 2.
da.getHeroes({language: 'zh'}, function(err, result){
if(!err)
console.log(result);
})
The current prizepool for specific tournaments.
da.getTournamentPrizePool(function(err, result){
if(!err)
console.log(result);
})