Skip to content

jasonodonnell/go-opendota

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-opendota Build Status Go Report Card GoDoc

Go-OpenDota is a simple Go package for accessing the OpenDota API.

Successful queries return native Go structs.

Services

  • Benchmarks
  • Distributions
  • Explorer
  • Health
  • Hero Stats
  • Heroes
  • Leagues
  • Live
  • Matches
  • Metadata
  • Players
  • Pro Matches
  • Pro Players
  • Public Matches
  • Rankings
  • Records
  • Replays
  • Schema
  • Search
  • Status
  • Teams

Install

go get github.com/jasonodonnell/go-opendota

Examples

Match

// OpenDota client
client := opendota.NewClient(httpClient)

// Get Match Data
match, res, err := client.MatchService.Match(3559037317)
fmt.Println(match.DireTeam.Name, "VS", match.RadiantTeam.Name)

Player

// OpenDota client
client := opendota.NewClient(httpClient)

// Get Player Data
player, res, err := client.PlayerService.Player(111620041)
fmt.Println(player.Profile.Name, player.SoloCompetitiveRank)

// Player Param
params := &opendota.PlayerParam{
	Win: 1,
}
// Get Won Matches For Player
wins, res, err := client.PlayerService.Matches(111620041, params)
for _, game := range wins {
	fmt.Println(game.MatchID, game.HeroID)
}

License

MIT License

Gopher

Thanks to Maria Ninfa for the Gopher!

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages