Skip to content

odds-api/odds-api-go

Repository files navigation

Odds API: easy access to odds, betting, sports, racing, and market data

Website API reference GitHub stars GitHub forks License Go Reference OpenAPI

odds-api/odds-api-go

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

Install from GitHub:

go get github.com/odds-api/odds-api-go

For local development from the GitHub repo:

git clone https://github.com/odds-api/odds-api-go.git
cd odds-api-go
go test ./...

Quickstart

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())

Common methods

  • ListSports
  • ListBookmakers
  • ListLeagues
  • SearchEvents
  • GetEvent
  • GetEventBookmakers
  • GetOddsSnapshot
  • GetOddsHistory
  • FindBestOdds
  • CompareBookmakers
  • FindArbitrage
  • FindPositiveEV
  • GetLineMovement
  • SearchRacingEvents
  • GetRacingEvent
  • GetRacingOdds
  • GetResults
  • GetAPIMetadata
  • GetMe
  • GetUsage
  • GetLimits
  • GetMarketSchema

Examples

examples/basic
examples/arbitrage-scanner

Run an example:

export ODDS_API_KEY="your_api_key"
go run ./examples/basic

Why use this SDK?

odds-api-go keeps the Python SDK's small, mock-friendly shape while using idiomatic Go:

  • context-aware requests
  • ODDS_API_KEY and ODDS_API_BASE_URL support
  • 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

Safety

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.

Links

About

Official Go SDK for odds-api.net

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages