Odds API code examples
Happy-path examples for the three odds endpoints, in curl, Python (httpx), and Go (net/http). Authenticate every request with the x-api-key header (or Authorization: Bearer <key>). Base URL: https://api.bigballsdata.com. See Odds & verification for what each endpoint returns.
GET /v1/odds/historical
Every historical snapshot (opening, 24-hour, closing) for one match. Pro plan or higher. match_id is required; optional snapshot_type, sportsbook, market, limit (default 50, max 200), offset.
curl "https://api.bigballsdata.com/v1/odds/historical?match_id=YOUR_MATCH_UUID&snapshot_type=closing" \
-H "x-api-key: $BBS_API_KEY"import os, httpx
r = httpx.get(
"https://api.bigballsdata.com/v1/odds/historical",
params={"match_id": "YOUR_MATCH_UUID", "snapshot_type": "closing"},
headers={"x-api-key": os.environ["BBS_API_KEY"]},
)
body = r.json()
print(body["meta"]["total"], body["data"][:1])req, _ := http.NewRequest("GET",
"https://api.bigballsdata.com/v1/odds/historical?match_id=YOUR_MATCH_UUID&snapshot_type=closing", nil)
req.Header.Set("x-api-key", os.Getenv("BBS_API_KEY"))
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
b, _ := io.ReadAll(resp.Body)
fmt.Println(string(b))GET /v1/odds/closing-lines
Closing lines across every match of a sport in a date range, newest kickoff first. Edge plan or higher. sport, date_from, and date_to are required; optional limit (default 50, max 200), offset.
curl "https://api.bigballsdata.com/v1/odds/closing-lines?sport=basketball&date_from=2026-06-01&date_to=2026-06-20" \
-H "x-api-key: $BBS_API_KEY"import os, httpx
r = httpx.get(
"https://api.bigballsdata.com/v1/odds/closing-lines",
params={"sport": "basketball", "date_from": "2026-06-01", "date_to": "2026-06-20"},
headers={"x-api-key": os.environ["BBS_API_KEY"]},
)
body = r.json()
print(body["meta"]["total"], [(d["home"], d["away"]) for d in body["data"][:3]])req, _ := http.NewRequest("GET",
"https://api.bigballsdata.com/v1/odds/closing-lines?sport=basketball&date_from=2026-06-01&date_to=2026-06-20", nil)
req.Header.Set("x-api-key", os.Getenv("BBS_API_KEY"))
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
b, _ := io.ReadAll(resp.Body)
fmt.Println(string(b))GET /v1/odds/divergences
Cross-source disagreements between our two providers on game lines. Pro plan or higher. Provide either a match_id or a date_from + date_to window; optional sport, category (PRICE_DIFF / LINE_DIFF / MISSING_FROM_ONE / STALE), canonical_id (book), limit, offset.
curl "https://api.bigballsdata.com/v1/odds/divergences?sport=basketball&date_from=2026-06-19&date_to=2026-06-20&category=LINE_DIFF" \
-H "x-api-key: $BBS_API_KEY"import os, httpx
r = httpx.get(
"https://api.bigballsdata.com/v1/odds/divergences",
params={
"sport": "basketball",
"date_from": "2026-06-19",
"date_to": "2026-06-20",
"category": "LINE_DIFF",
},
headers={"x-api-key": os.environ["BBS_API_KEY"]},
)
body = r.json()
for d in body["data"][:5]:
print(d["canonical_id"], d["category"], d["magnitude"])req, _ := http.NewRequest("GET",
"https://api.bigballsdata.com/v1/odds/divergences?sport=basketball&date_from=2026-06-19&date_to=2026-06-20&category=LINE_DIFF", nil)
req.Header.Set("x-api-key", os.Getenv("BBS_API_KEY"))
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
b, _ := io.ReadAll(resp.Body)
fmt.Println(string(b))All three return the Stripe-style { data, meta } envelope. Paginate with limit / offset against meta.total. A plan below the endpoint's tier returns 403; a malformed query returns 400 with a suggested_fix.