Skip to content

SevenWhite/node-dota2-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dota2 Web Api

Build Status

Dota2 web api node.js version.See detail here

Install

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);
  })

API

Methods relating to Dota 2 matches.

Dota2Api.create(key, [ID])

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);

Dota2Api.prototype.getLeagueListing([options], callback)

Information about DotaTV-supported leagues.

  da.getLeagueListing({language: 'zh'}, function(err, result){
    if(!err)
      console.log(result);
  })

Dota2Api.prototype.getLiveLeagueGames(callback)

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);
  })

Dota2Api.prototype.getMatchDetails([options], callback)

Information about a particular match.

  da.getMatchDetails({match_id: 'xxx'}, function(err, result){
    if(!err)
      console.log(result);
  })

Dota2Api.prototype.getMatchHistory([options], callback)

A list of matches, filterable by various parameters.

  da.getMatchHistory(function(err, result){
    if(!err)
      console.log(result);
  })

Dota2Api.prototype.getMatchHistoryBySequenceNum([options], callback)

A list of matches ordered by their sequence num.

  da.getMatchHistoryBySequenceNum(function(err, result){
    if(!err)
      console.log(result);
  })

Dota2Api.prototype.getScheduledLeagueGames([options], callback)

A list of scheduled league games coming up.

  da.getScheduledLeagueGames(function(err, result){
    if(!err)
      console.log(result);
  })

Dota2Api.prototype.getTeamInfoByTeamID([options], callback)

A list of all the teams set up in-game.

  da.getTeamInfoByTeamID(function(err, result){
    if(!err)
      console.log(result);
  })

Dota2Api.prototype.getTournamentPlayerStats([options], callback)

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.

Dota2Api.prototype.getRarities([options], callback)

Dota 2 item rarity list.

  da.getRarities({language: 'zh'}, function(err, result){
    if(!err)
      console.log(result);
  })

Dota2Api.prototype.getHeroes([options], callback)

A list of heroes within Dota 2.

  da.getHeroes({language: 'zh'}, function(err, result){
    if(!err)
      console.log(result);
  })

Dota2Api.prototype.getTournamentPrizePool([options], callback)

The current prizepool for specific tournaments.

  da.getTournamentPrizePool(function(err, result){
    if(!err)
      console.log(result);
  })

License

The MIT License

About

Dota2 web api node.js version

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 93.4%
  • Makefile 6.6%