This is a go api client for the official Age Of Empires 4 Leaderboard.
It can be used to filter in the same manner as the website and can be useful if you wish to build go based apps and tools for displaying and working with the official data.
A quick example is shown below:
// Setup and reuse a client, this takes an http client with a configurable timeout
c := official.NewClient(aoe.NewHTTPClient())
// create a request using the client and apply filters
// always call Do to execute the request.
resp, err := c.NewRequest().
WithRegion(official.RegionNorthAmerica).
WithMatchType(official.MatchTypeCustom).
WithTeamSize(official.TeamSize4v4).
Do(context.Background()) // use a proper context in an actual app
if err != nil {
log.Fatal(err)
}
// do something with the results
fmt.Printf("total results found %d", resp.Count)
There are a few examples under the examples folder, these show paging, different filters etc.