Quick start guide
Your first API call in under a minute.
Real-time sports odds from 50+ sportsbooks across 26 sports. One API key, one header, normalized JSON.
Your base URL
https://api.theoddsapi.com
All requests go to this URL. Make sure this is set correctly before making your first call.
Authentication
Pass your API key as the x-api-key header on every request. You can also pass it as a query parameter for quick browser testing.
Use the x-api-key HTTP header (recommended). For browser testing, ?apiKey=YOUR_KEY (or ?x-api-key=YOUR_KEY) also works. Don't put keys in production URLs.
Browser — paste this into your address bar
https://api.theoddsapi.com/me/?x-api-key=YOUR_API_KEY
cURL
curl -H "x-api-key: YOUR_API_KEY" \ https://api.theoddsapi.com/sports/
Python
# pip install requests import requests API_KEY = "YOUR_API_KEY" headers = {"x-api-key": API_KEY} resp = requests.get( "https://api.theoddsapi.com/odds/", headers=headers, params={"sport_key": "basketball_nba"} ) print(resp.json())
JavaScript (fetch)
const API_KEY = "YOUR_API_KEY"; const resp = await fetch( "https://api.theoddsapi.com/odds/?sport_key=basketball_nba", { headers: { "x-api-key": API_KEY } } ); const data = await resp.json(); console.log(data);
Get live odds
Pull real-time odds from DraftKings, FanDuel, BetMGM, Pinnacle, Betfair, and 45 more sportsbooks in a single call.
# NBA odds — all markets, all books curl -H "x-api-key: YOUR_API_KEY" \ "https://api.theoddsapi.com/odds/?sport_key=basketball_nba" # EPL soccer — Business tier adds Pinnacle + UK/EU books curl -H "x-api-key: YOUR_API_KEY" \ "https://api.theoddsapi.com/odds/?sport_key=soccer_epl" # MLB run lines (spreads) only curl -H "x-api-key: YOUR_API_KEY" \ "https://api.theoddsapi.com/odds/?sport_key=baseball_mlb&markets=spreads" # Champions League totals (over/under) curl -H "x-api-key: YOUR_API_KEY" \ "https://api.theoddsapi.com/odds/?sport_key=soccer_uefa_champs_league&markets=totals"
Prices default to American. Pass oddsFormat=decimal to receive decimal odds (1.909, 2.45). Currently applies to /odds/ only; other endpoints serve American.
The odds feed is live — it returns upcoming and in-play games, and finished games roll off. Poll before the first start to capture a full card, or scope a specific day with commenceTimeFrom / commenceTimeTo (ISO 8601 UTC — they filter on each game's start_time). For games that have already concluded, use /historical/odds (Business tier).
# Today's full MLB slate, regardless of when you poll curl -H "x-api-key: YOUR_API_KEY" \ "https://api.theoddsapi.com/odds/?sport_key=baseball_mlb&commenceTimeFrom=2026-05-27T00:00:00Z&commenceTimeTo=2026-05-28T00:00:00Z"
Response shape (live feed):
{
"success": true,
"source": "cache",
"data": [
{
"event_id": "a1b2c3d4",
"sport": "basketball",
"league": "NBA",
"home_team": "Los Angeles Lakers",
"away_team": "Boston Celtics",
"start_time": "2026-05-27T23:40:00Z",
"books": [
{
"book": "draftkings",
"market": "h2h",
"updated_at": "2026-05-27T22:10:01Z",
"outcomes": [
{ "name": "Los Angeles Lakers", "price": -110 },
{ "name": "Boston Celtics", "price": -110 }
]
}
]
}
]
}
Try it live in Swagger — click Authorize, paste your key, hit Try It. No terminal needed.
Using an AI assistant to write your integration? Paste our copy-paste spec for Claude / ChatGPT so it uses the right base URL, auth, and field names.
26 sports available
Hit /sports/ to see what's available on your tier.
sport_key is the specific league, not the general sport — e.g. basketball_nba, not basketball. Full list at GET /sports/.
Endpoints
Markets
Query parameters
Rate limits
Rate limit headers on every response: X-RateLimit-Remaining, X-RateLimit-Reset
50+ sportsbooks
Pro tier — US sportsbooks: DraftKings, FanDuel, BetMGM, Caesars, BetRivers, Fanatics, Bovada, and more.
Business tier adds international books: Pinnacle (sharp anchor), Betfair Exchange, William Hill, Marathonbet, Paddy Power, Sky Bet, Ladbrokes, Unibet, Coolbet, Matchbook, plus AU coverage (Sportsbet, TAB, Ladbrokes AU, PointsBet AU) on AFL/NRL/EPL/cricket/tennis. Coverage varies by sport.
Troubleshooting
x-api-key: YOUR_KEY) or query param (?x-api-key=YOUR_KEY). Check base URL is api.theoddsapi.com/sports/ for active sports.&markets=spreads,totals/me/ for usage. Resets at midnight UTC. Upgrade for more.us, uk, eu, au. Comma-separate for multiple.bookmakers param validates against our canonical book list. Omit the param to see all available books in the response, then copy the keys you want.