API client for BSM - Go
- Go 99.3%
- Shell 0.7%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .editorconfig | ||
| .gitignore | ||
| api.go | ||
| api_client_test.go | ||
| api_test.go | ||
| club.go | ||
| constants.go | ||
| errors.go | ||
| field.go | ||
| game_class.go | ||
| game_winner.go | ||
| go.mod | ||
| leaderboard_Data.go | ||
| league.go | ||
| league_entry.go | ||
| league_group.go | ||
| LICENSE | ||
| match.go | ||
| match_test.go | ||
| person.go | ||
| playoff_series.go | ||
| playoff_series_test.go | ||
| publish_new_version.sh | ||
| README.md | ||
| table.go | ||
| table_test.go | ||
| team.go | ||
Go client for the BSM API
This is a small utility library that adds BSM response and query data structures and an API client to query the BSM API.
The functionality is limited to features I need for my other projects - many more endpoints exist and data shapes are by no means exhaustive.
BSM does not provide an OpenAPI document, but if your use case depends on full spec parity it might be beneficial to write one yourself and generate a client with OpenAPI Generator or similar tools (or just have a clanker go YOLO on the JSON responses).
Basic usage:
func callBSM() {
apiKey := "<insert your key here>"
client, _ := bsm.NewAPIClientWithURL("") // using default URL, will not error
matches, err := client.LoadMatchesWithFilterParams(map[string]string{
bsm.GamedayFilter: bsm.GameDayCurrent,
bsm.SeasonFilter: "2026",
bsm.SearchFilter: "cardinals",
}, apiKey)
if err != nil {
panic("loading BSM data failed")
}
// do something with the Match slice
}
Contributing
- PRs are welcome if you need more data types or endpoints. No slop plz.
- This is a simple library by a simple developer. Keep it simple.
- I know the code quality is not great and these days I don't write API clients by hand when OpenAPI exists.