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.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

theoddsapi_client-1.0.1-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: theoddsapi_client-1.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 0377be0cc5d52e0c02679aad810de04a9a1aec843a8ef9e794a84eb0adac4f04
MD5 fdb6c0107cbd2c9b7582524349ab9b68
BLAKE2b-256 5e2bc27054375f380abba1c693e83299282b39b8d3f0d2f7a65aa05f3540b8e2

See more details on using hashes here.

File details

Details for the file theoddsapi_client-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for theoddsapi_client-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 def728c5e49a39af950de89a21e146a3a45b5969497faadb0daef0976cfab92d
MD5 8f9d402988b4c38ef3077e52aa11bf61
BLAKE2b-256 c65ff27f14c6e56fae07a3c7132acedb2ecd520faf33710ce5c1ebd37d3c66bb

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