Skip to content

zwacky/tango

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tango GoDoc

Complete wrapper for Valve's DOTA 2 Web API exposed cleanly to Go.

Supports all available WebAPI methods except for GetTournamentPlayerStats and GetTournamentPrizePool as they both only work for LeagueID=65006, which is The International 2013.

Example

package main

import (
    "fmt"
	"log"

	"github.com/fortytw2/tango"
)

var matchID = 271145478

func main() {
	api := tango.NewWebAPI("API KEY")

	m, err := api.GetMatch(matchID)
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println("DOTA 2 Match", matchID)
	fmt.Println("Winner -", m.Victor)

	fmt.Println("Radiant Heroes")
	for _, player := range m.Radiant {
		fmt.Println(player.Hero.LocalizedName)
	}

	fmt.Println("Dire Heroes")
	for _, player := range m.Dire {
		fmt.Println(player.Hero.LocalizedName)
	}
}

Should be very straightforward to use, check Godoc for complete documentation and open an issue here on GitHub if anything goes wrong.

LICENSE

MIT, see LICENSE

About

complete DOTA2 Web API wrapper

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%