# bet365 odds WebSocket API

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

Canonical: https://thebet365api.com/bet365-websocket


bet365 has no public WebSocket or API. thebet365api.com runs one: wss://stream.thebet365api.com/v1/stream pushes every bet365 price and line change our collector stores, as JSON with the previous price, to any key including the free one. Unofficial: prices are republished from public odds aggregators.

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

## What the stream sends

WebSocket stream at wss://stream.thebet365api.com/v1/stream: every bet365 price and line change pushed as the collector stores it, with the previous price and a resumable id. Same key, every plan including Free, no delay; 1 request per connection plus 1 per 5 minutes connected.

- One price.changed message per stored change: event, league, teams, start time, market, side, team or player, line, price in American, decimal and fractional, the previous line and price, and observed_at, the time we read it.
- Filters on the URL: league (several, comma-separated), event_id, market and live. One connection can carry every league.
- Resume after a disconnect with ?after=<last id>: the missed changes (up to 24 hours) replay in order, then the stream continues live with no gap.
- A ping and a heartbeat message every 25 seconds, and a /health endpoint on the stream host.

| Plan | Connections at a time | Delay |
| --- | --- | --- |
| Free | 1 | None |
| Developer | 2 | None |
| Pro | 3 | None |
| Production | 5 | None |
| Scale | 10 | None |

Each connection counts 1 request when it opens and 1 per further 5 minutes, from the plan's monthly requests.

## Node.js

```javascript
const ws = new WebSocket("wss://stream.thebet365api.com/v1/stream?league=nba,epl");
ws.onopen = () => ws.send(JSON.stringify({ op: "auth", key: process.env.THEBET365API_KEY }));
ws.onmessage = (e) => {
  const m = JSON.parse(e.data);
  if (m.type === "price.changed")
    console.log(m.league, m.home, m.market, m.team ?? m.player ?? m.side, m.previous?.price.decimal, "->", m.price.decimal, m.observed_at);
};
ws.onclose = () => { /* reconnect after 1-30 s with ?after=<last m.id> */ };
```

## Python

```python
# pip install websockets
import asyncio, json, os, websockets

async def main():
    headers = {"Authorization": "Bearer " + os.environ["THEBET365API_KEY"]}
    async with websockets.connect("wss://stream.thebet365api.com/v1/stream?league=nba,epl", additional_headers=headers) as ws:
        async for raw in ws:
            m = json.loads(raw)
            if m["type"] == "price.changed":
                prev = m["previous"]["price"]["decimal"] if m["previous"] else None
                print(m["league"], m["home"], m["market"], m["team"] or m["player"] or m["side"], prev, "->", m["price"]["decimal"])

asyncio.run(main())
```

## How live is it?

Changes are pushed within about 2 seconds of being stored. Every price carries observed_at, the UTC time our collector read it. bet365 publishes no update time through our sources, so we never call the data real time; the status page shows the age of the latest capture. So a move reaches you about 1 to 3 minutes after the aggregator shows it: fast enough for line-move alerts, closing-line capture and models, not for in-play trading.

## 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

### Does bet365 have a WebSocket API?

Not a public one. bet365 offers no developer access to its prices and blocks scripted clients. thebet365api.com's stream is an independent, unofficial alternative.

### Is the WebSocket on the free plan?

Yes. Free plan: 100 requests a month, no card. One stream connection at a time, with no delay. A connection open all day uses about 288 requests, so the free month covers a few hours of testing; paid plans cover running it all day.

### Can I use it from a browser?

Yes. Browsers cannot set headers on a WebSocket, so send {"op":"auth","key":"bt_..."} as the first message. Never put the key in the URL.

### Does it carry in-play odds?

Only the in-play prices the source republishes, marked is_live: true, and coverage is partial. It is not an in-play trading feed.

### 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-odds-mcp.md
- https://thebet365api.com/bet365-api-javascript.md
- https://thebet365api.com/bet365-api-python.md
