# bet365 API in Python

> Independent. Not affiliated with, endorsed by or sponsored by bet365.

Canonical: https://thebet365api.com/bet365-api-python


To get bet365 odds in Python, call thebet365api.com over HTTPS and read JSON; the standard library is enough. There is no official bet365 Python SDK, and the old community wrappers that scraped bet365 are unmaintained.

**Free plan: 100 requests a month, no card.** Sign up: https://thebet365api.com/sign-up?ref=ai-md. No key yet? The keyless preview:

```bash
curl -s "https://thebet365api.com/api/mcp" -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"preview_bet365_odds","arguments":{"league":"nba"}}}'
```

Updated 2026-11-19.

## Working example

Set THEBET365API_KEY to your key, then run:

```python
import json, os, urllib.request

req = urllib.request.Request(
    "https://thebet365api.com/api/v1/odds?league=epl",
    headers={"Authorization": "Bearer " + os.environ["THEBET365API_KEY"]},
)
with urllib.request.urlopen(req, timeout=20) as resp:
    body = json.load(resp)

for event in body["data"][:5]:
    for p in event["prices"]:
        # observed_at is the last time our collector saw this price, in UTC
        print(event["home"], event["away"], p["market"], p["side"], p["player"], p["price"]["decimal"], p["observed_at"])
```

## No key yet

The keyless preview needs nothing:

```python
import json, urllib.request

body = json.dumps({"jsonrpc": "2.0", "id": 1, "method": "tools/call",
    "params": {"name": "preview_bet365_odds", "arguments": {"league": "nba"}}}).encode()
req = urllib.request.Request("https://thebet365api.com/api/mcp", data=body, headers={"Content-Type": "application/json"})
with urllib.request.urlopen(req, timeout=20) as resp:
    print(json.load(resp)["result"]["content"][0]["text"][:800])
```

## What comes back

- bet365 US main lines in American odds with a decimal conversion.
- bet365 soccer prices in the fractional odds as published, with an exact decimal conversion (17/4 becomes 5.25).
- observed_at on every price: the UTC time our collector read it.

Full field reference: https://thebet365api.com/openapi.json.

## Why not a scraper library

bet365 blocks scripted clients at the edge, and its pages need a browser session to render prices. Python scrapers for bet365 break when that changes, and scraping conflicts with bet365's terms. An API that already collects the prices removes that work from your code.

## What we do not carry

- US player props (NFL, NBA, MLB, NHL)
- alternate lines and futures
- state-by-state bet365 prices
- in-play prices
- sports and leagues other than those listed on the coverage page
- history from before our collector started
- placing bets or reading a bet365 account

The live list of leagues and markets, with the time of each league's latest capture, is on the coverage page (https://thebet365api.com/coverage).

## FAQ

### Is there an official bet365 Python library?

Not that we can find. bet365 publishes no public developer API, so there is nothing for an official SDK to wrap.

### Do I need requests or httpx?

No. The example uses only urllib and json from the standard library. Any HTTP client works.

### How do I avoid running out of requests?

Cache responses for as long as your use allows and read observed_at to decide when a price is worth fetching again. Free plan: 100 requests a month, no card.

### Is this affiliated with bet365?

No. Independent. Not affiliated with, endorsed by or sponsored by bet365. thebet365api.com is an unofficial API run by Stunning Couches LLC.

## Related

- https://thebet365api.com/bet365-api-javascript.md
- https://thebet365api.com/bet365-api-key.md
- https://thebet365api.com/bet365-scraper.md
