https://github.com/jasonodonnell/go-opendota
Go client library for accessing the OpenDota API
https://github.com/jasonodonnell/go-opendota
api-client dota2 go go-library golang-library opendota
Last synced: 6 months ago
JSON representation
Go client library for accessing the OpenDota API
- Host: GitHub
- URL: https://github.com/jasonodonnell/go-opendota
- Owner: jasonodonnell
- License: mit
- Created: 2017-10-29T01:27:52.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-10-02T19:14:03.000Z (almost 7 years ago)
- Last Synced: 2025-12-17T14:48:15.499Z (7 months ago)
- Topics: api-client, dota2, go, go-library, golang-library, opendota
- Language: Go
- Homepage: https://godoc.org/github.com/jasonodonnell/go-opendota
- Size: 116 KB
- Stars: 38
- Watchers: 1
- Forks: 8
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-opendota [](https://travis-ci.org/jasonodonnell/go-opendota) [](https://goreportcard.com/report/github.com/jasonodonnell/go-opendota) [](https://godoc.org/github.com/jasonodonnell/go-opendota)

Go-OpenDota is a simple Go package for accessing the [OpenDota API](https://docs.opendota.com/#).
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
```bash
go get github.com/jasonodonnell/go-opendota
```
## Examples
### Match
```go
// 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
```go
// 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](LICENSE)
## Gopher
Thanks to [Maria Ninfa](http://marianinfa.mx/) for the Gopher!