Go client library for accessing the OpenDota API
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore Update gitignore Dec 4, 2017
.travis.yml Fix travis Dec 4, 2017
Gopkg.lock Add dep Dec 4, 2017
Gopkg.toml Add dep Dec 4, 2017
LICENSE Initial commit Oct 29, 2017
README.md Add go reportcard Dec 4, 2017
benchmark.go Make structs public Dec 1, 2017
benchmark_test.go Gofmt simplify Dec 4, 2017
distribution.go Make structs public Dec 1, 2017
distribution_test.go Gofmt simplify Dec 4, 2017
doc.go Gofmt simplify Dec 4, 2017
error.go Restructure files Nov 22, 2017
explorer.go Make structs public Dec 1, 2017
explorer_test.go Gofmt simplify Dec 4, 2017
health.go Fix doc comments Dec 4, 2017
health_test.go Make structs public Dec 1, 2017
hero.go Doc overhaul Nov 30, 2017
hero_test.go Gofmt simplify Dec 4, 2017
herostat.go Doc overhaul Nov 30, 2017
herostat_test.go Gofmt simplify Dec 4, 2017
league.go Doc overhaul Nov 30, 2017
league_test.go Gofmt simplify Dec 4, 2017
live.go Make structs public Dec 1, 2017
live_test.go Gofmt simplify Dec 4, 2017
match.go Gofmt fix Dec 4, 2017
match_test.go Gofmt simplify Dec 4, 2017
metadata.go Make structs public Dec 1, 2017
metadata_test.go Make structs public Dec 1, 2017
opendota.go Restructure files Nov 22, 2017
opendota_test.go Restructure files Nov 22, 2017
player.go Doc overhaul Nov 30, 2017
player_test.go Gofmt simplify Dec 4, 2017
promatch.go Doc overhaul Nov 30, 2017
promatch_test.go Gofmt simplify Dec 4, 2017
proplayer.go Doc overhaul Nov 30, 2017
proplayer_test.go Gofmt simplify Dec 4, 2017
publicmatch.go Doc overhaul Nov 30, 2017
publicmatch_test.go Gofmt simplify Dec 4, 2017
ranking.go Fix doc comments Dec 4, 2017
ranking_test.go Gofmt simplify Dec 4, 2017
record.go Doc overhaul Nov 30, 2017
record_test.go Gofmt simplify Dec 4, 2017
replay.go Doc overhaul Nov 30, 2017
replay_test.go Gofmt simplify Dec 4, 2017
schema.go Doc overhaul Nov 30, 2017
schema_test.go Gofmt simplify Dec 4, 2017
search.go Doc overhaul Nov 30, 2017
search_test.go Gofmt simplify Dec 4, 2017
status.go Make structs public Dec 1, 2017
status_test.go Gofmt simplify Dec 4, 2017
team.go Doc overhaul Nov 30, 2017
team_test.go Gofmt simplify Dec 4, 2017

README.md

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!