Go SDK for odds-api.net, an OpenAPI-first sports betting odds API for coding agents and developers.
Collect a free API key from odds-api.net.
Install . Quickstart . Common methods . Examples . Safety . Security
Install from GitHub:
go get github.com/odds-api/odds-api-goFor local development from the GitHub repo:
git clone https://github.com/odds-api/odds-api-go.git
cd odds-api-go
go test ./...package main
import (
"context"
"fmt"
"os"
oddsapi "github.com/odds-api/odds-api-go"
)
func main() {
client := oddsapi.NewClient(oddsapi.WithAPIKey(os.Getenv("ODDS_API_KEY")))
events, err := client.SearchEvents(context.Background(), oddsapi.QueryParams{
"sport": "rugby-league",
"league": "NRL",
})
if err != nil {
panic(err)
}
fmt.Println(events)
}The SDK also reads ODDS_API_KEY and ODDS_API_BASE_URL from the environment:
client := oddsapi.NewClient()
sports, err := client.ListSports(context.Background())ListSportsListBookmakersListLeaguesSearchEventsGetEventGetEventBookmakersGetOddsSnapshotGetOddsHistoryFindBestOddsCompareBookmakersFindArbitrageFindPositiveEVGetLineMovementSearchRacingEventsGetRacingEventGetRacingOddsGetResultsGetAPIMetadataGetMeGetUsageGetLimitsGetMarketSchema
examples/basic
examples/arbitrage-scanner
Run an example:
export ODDS_API_KEY="your_api_key"
go run ./examples/basicodds-api-go keeps the Python SDK's small, mock-friendly shape while using idiomatic Go:
- context-aware requests
ODDS_API_KEYandODDS_API_BASE_URLsupport- API key auth with
X-API-Key - optional bearer token support
- transport injection for tests
- standard library HTTP client
- helper methods for common sports, racing, odds, betting, account, and metadata workflows
Arbitrage and positive EV examples are betting research workflows, not guaranteed-profit systems. Always account for stale odds, limits, delays, suspensions, voids, jurisdiction, and execution risk.
- Website: https://odds-api.net
- API: https://api.odds-api.net/v1
- OpenAPI: https://github.com/odds-api/odds-api/blob/main/openapi.yaml
- Main repo: https://github.com/odds-api/odds-api
- Go package docs: https://pkg.go.dev/github.com/odds-api/odds-api-go