IN DEVELOPMENT · FREE DURING BETA

bet365 odds over WebSocket

Real-time odds without polling: why streaming matters for live prices, how to build a consumer that survives disconnects, and what OddsDirect is building.

Status: OddsDirect is in development and not live yet. This page explains the subject and what the API is being built to do. Endpoints, response formats and limits will be published in the docs when the beta opens.

Why odds should be pushed, not polled

With polling you ask "anything new?" every few seconds. You either ask too often (wasted requests, rate limits) or too rarely (missed changes). With a WebSocket the server keeps one connection open and pushes each change the moment it happens.

Polling (REST)WebSocket (push)
FreshnessLimited by your polling intervalChanges arrive as they happen
Request costEvery poll counts, even with no changesOne connection, updates only
ComplexitySimpleNeeds reconnect and resync logic
Best forPre-match, small projectsLive odds, alerts, trading tools

A robust consumer pattern

Every streaming integration needs the same three things: reconnect with backoff, resync after a gap, and idempotent updates. Here is the pattern in Python. It is generic: it shows the structure, not the OddsDirect protocol.

reconnect with exponential backoffpython
# Illustrative pattern for consuming any odds stream. The OddsDirect stream URL,
# authentication and message format will be published in the docs at beta launch.
import asyncio, json, random
import websockets   # pip install websockets

async def consume(url: str, handle):
    delay = 1
    while True:
        try:
            async with websockets.connect(url, ping_interval=20) as ws:
                delay = 1                      # connected: reset the backoff
                async for raw in ws:
                    handle(json.loads(raw))
        except (OSError, websockets.ConnectionClosed):
            await asyncio.sleep(delay + random.random())
            delay = min(delay * 2, 30)         # exponential backoff, capped
            # after a reconnect, re-fetch a full snapshot before applying new updates

Checklist for production

  • Snapshot first: load the full state, then apply updates.
  • Resync after reconnect: never assume you saw every update.
  • Keep the key server-side: proxy the stream to browsers if you need to.
  • Back off: exponential delays with jitter, capped at around 30 seconds.
  • Watch freshness: alert if no message arrives for longer than expected.

The OddsDirect WebSocket

OddsDirect is building real-time bet365 odds updates over WebSocket, alongside the REST API. This is an upcoming feature.

Stream URL, auth and message format: coming soonDocumented in the docs at launch. Join the Discord to hear first.

Frequently asked questions

Does OddsDirect have a WebSocket?

Real-time updates over WebSocket are part of the planned product and marked as upcoming. The connection URL, authentication and message format will be documented at launch.

Is a WebSocket better than polling for odds?

For live odds, usually yes: you receive each change as it happens and avoid spending requests on unchanged data. Polling is fine for slow-moving pre-match data or small projects.

What happens if my WebSocket disconnects?

Reconnect with exponential backoff, then reload a full snapshot before applying new updates. Updates that arrived while you were offline are otherwise lost.

Can I use the WebSocket from a browser?

Browsers can open WebSocket connections, but an API key should never be exposed in front-end code. Connect from your server and forward what your users need.

Be first in line for a beta key

The API will be free during the beta. Keys go out in our Discord first.

Related