Skip to main content

Official Python client for TheOddsAPI: real-time sports odds from 50+ sportsbooks across 26 sports, plus player props, Pinnacle-anchored edges, fair odds, and historical snapshots.

Project description

theoddsapi

Official Python client for TheOddsAPI: real-time sports odds from 50+ sportsbooks across 26 sports, normalized into one JSON shape, plus player props, Pinnacle-anchored edge detection, fair odds, and historical snapshots.

Zero dependencies. Python 3.8+.

Install

pip install theoddsapi

Quick start

from theoddsapi import TheOddsAPI

client = TheOddsAPI("YOUR_API_KEY")

for sport in client.sports()["data"]:
    print(sport)

odds = client.odds("baseball_mlb", oddsFormat="decimal")

Get a free key in minutes at theoddsapi.com/start. No credit card.

Endpoints

Every endpoint is one method. Core data: sports(), odds(), events(), best_lines(). Business plan: props(), edges(), fair_odds(), consensus(), arbitrage(), value_bets(), historical_odds(), historical_settlements(). Account: me().

edges = client.edges("basketball_nba", min_edge=50)
history = client.historical_odds("baseball_mlb", bookmakers="pinnacle", limit=500)

Errors

Non-2xx responses raise TheOddsAPIError with .status and .detail. Transient 5xx responses are retried with exponential backoff automatically.

from theoddsapi import TheOddsAPI, TheOddsAPIError

try:
    client.props("baseball_mlb")
except TheOddsAPIError as e:
    if e.status == 403:
        print("Props require the Business plan:", e.detail)

Links

Full reference: theoddsapi.com/docs · Guides: theoddsapi.com/guides · Free calculators: theoddsapi.com/tools

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

theoddsapi_client-1.0.0.tar.gz (3.0 kB view details)

Uploaded Source

File details

Details for the file theoddsapi_client-1.0.0.tar.gz.

File metadata

  • Download URL: theoddsapi_client-1.0.0.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for theoddsapi_client-1.0.0.tar.gz
Algorithm Hash digest
SHA256 eb8980a0cbadf80cee713f8e0c2ee82b1f375e1de5304795731620b645bd02dd
MD5 4180c7401b768c7608e460db4c599fa3
BLAKE2b-256 704d9773003b3b62f5909453c24d921aa15f349b4a73b41271bcc90a5514b16b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page