TheOddsAPI
Home Swagger Guides Build with AI My Key Pricing FAQ

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/.

US Major
NBA · MLB · NFL · NHL
College + WNBA
NCAAB · NCAAF · WNBA
Combat
UFC · Boxing
Soccer
EPL · Champions League · La Liga · Bundesliga · Serie A · Ligue 1 · MLS · Liga MX · Europa League · Eredivisie · Championship · World Cup 2026 (Business)
International
Cricket · Tennis · Euroleague · AFL (+ player props on Business) · NRL (+ player props on Business)
FREE: NBA + MLB PRO: All 25 sports + US books BUSINESS: + Pinnacle + Intl books + Historical + Props + Intelligence

Endpoints

GET /sports/ List sports for your tier
GET /odds/?sport_key= Live odds from 50 books
GET /events/?sport_key= Upcoming events
GET /best-lines/?sport_key= Best price per outcome across books
GET /historical/odds?sport_key= Historical snapshots for backtesting BIZ
GET /historical/settlements?sport_key= Graded HIT/MISS/PUSH outcomes + payouts BIZ
GET /props/?sport_key= Player props — NBA, NHL, MLB, WNBA, AFL, NRL BIZ
GET /edges/?sport_key= Pinnacle-anchored edge detection BIZ
GET /futures/?sport_key= Championship / outright winners (NBA, NHL, MLB, UCL) BIZ
GET /intelligence/fair-odds Vig-removed fair prices (H2H only) BIZ
GET /intelligence/consensus Median / mean market center (H2H only) BIZ
GET /intelligence/arbitrage Cross-book arb detection BIZ
GET /intelligence/value Value bets vs vig-removed consensus BIZ
GET /intelligence/market-analysis Per-event hold %, efficiency, tightest/widest book BIZ
GET /me/ Your usage, tier, and quota

Markets

Market key
Also known as
Description
h2h
Moneyline
Who wins the game
spreads
Run line / Puck line / Handicap
Point spread
totals
Over/Under
Total points, runs, or goals
player_*
Player props
NBA (8), NHL (5), MLB (4), WNBA (8), AFL (4), NRL (4) — NFL during NFL season — Business tier

Query parameters

Param
Example
Description
sport_key
basketball_nba
Required on most endpoints
markets
h2h,spreads
Filter markets (default: all)
event_id
abc123
Filter to one event
regions
us,uk,eu,au
Filter books by region (comma-separated). Omit for all.
bookmakers
draftkings,fanduel,pinnacle
Filter to specific book keys (comma-separated). Composes with regions as intersection.

Rate limits

Tier
Daily
Monthly
FREE
25
~750
PRO $29
667
~20,000
BIZ $99
6,667
~200,000

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

Issue
Fix
401 / Missing key
Pass your key as a header (x-api-key: YOUR_KEY) or query param (?x-api-key=YOUR_KEY). Check base URL is api.theoddsapi.com
403 on a sport
Free tier only gets NBA + MLB. Upgrade to Pro for all sports.
Empty response
Sport may be off-season. Check /sports/ for active sports.
Only seeing moneylines
All 3 markets return by default. Filter with &markets=spreads,totals
Rate limit hit
Check /me/ for usage. Resets at midnight UTC. Upgrade for more.
400 Unsupported region
Valid regions are us, uk, eu, au. Comma-separate for multiple.
400 Unknown bookmaker
The 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.

Ready to build?

Get your API key and start pulling live odds in seconds.