Skip to main content
WEBSOCKET
WebSocket API Reference: Live Odds Stream and Messages

Overview

The WebSocket feed delivers real-time odds updates with the same response format as the REST API /odds endpoint. Instead of polling, you receive instant updates whenever odds change.
Add-on Feature: WebSocket access is available as an add-on. Subscribe through odds-api.io to enable it for your account.

Connection

Endpoint:
Authentication:
  • API key passed as query parameter
  • Up to two concurrent connections per API key
  • Opening a third closes the oldest one
  • Reconnecting within 2 seconds of that is refused with close code 1013, so back off a few seconds and retry
  • More connections per key are available as an add-on on request
Close codes: When the server ends a connection it sends a close frame with one of these codes and a short reason: A close without a frame (1006 in most clients) means the network dropped or the connection stopped answering pings. Reconnect with backoff and lastSeq. Compression: permessage-deflate is required. Node ws, the built-in WebSocket in Node.js 22+, browsers and Python websockets negotiate it by default; Python websocket-client and PHP textalk/websocket do not support it. Connections without it are refused with HTTP 426. See the guide for other languages. Pricing: 2x the REST API price Bookmakers: The WebSocket automatically sends updates for all bookmakers you have selected in your account. Manage your bookmakers via the /bookmakers/selected/select endpoint.

Filter Parameters

The markets parameter is required for the odds channel (the default). It is not needed if you subscribe only to scores/status. Check valid names with GET /v3/markets?sport=<sport>.
Using leagues or eventIds is recommended to reduce bandwidth. You cannot use both together.

Channels

Use channels to choose which streams you receive. Omitting it keeps the default odds stream, so existing connections are unaffected. Subscribe to any combination - for example a scoreboard app can use channels=scores,status with no odds traffic.
channels is an allowlist - you receive only the channels you list. If you want odds, you must include odds (e.g. channels=odds,scores,status); connecting with channels=scores,status stops odds delivery. Omitting channels entirely keeps the default odds-only stream.
sport, leagues, eventIds and status filters apply to score/status messages too. These messages are event-level (no bookie, no markets) and are best-effort live state - they carry no seq and are not replayed on reconnect. When you reconnect with lastSeq and subscribe to status, the server resends the current status of every live event, and of events settled or cancelled in the last 12 hours, that match your filters. They arrive after the replay and before replay_complete, so a transition you missed while away still reaches you. After a lastSeq reconnect with scores or status, you get a clock message for each live event with elapsed time, sent after any messages that queued during the catch-up. For scores, fetch the current value from GET /events after reconnecting.

Example URLs

Error Responses (400 Bad Request)

Message Types

deleted and no_markets carry an empty markets array and are always delivered, even when a markets= filter is set. A no_markets for a re-issued event carries replacedBy, the id of the event to use, and goes to every odds connection whatever its status filter. With a markets= filter, no_markets is also sent when the bookmaker still prices the event but none of your markets remain. Clear what you hold for that event and bookmaker. It carries the seq of the update it stands in for, is not repeated while your markets stay away, and can arrive for an event you have not seen yet on the connection.

Welcome Message

Sent immediately after connection:

Message Format

Each update includes a seq field, a global sequence number that never decreases on your connection: updates are delivered in seq order, so the latest seq you received is always your resume point. The same update sent for several bookmakers shares one seq, so identify a frame by id, bookie and seq together. Track it for gap-free reconnection via lastSeq. Seqs are global across all customers, so the ones you receive are not consecutive. Rarely, during a brief server-side interruption, an odds update is sent without seq. Apply it as normal but keep your stored lastSeq unchanged. If you reconnect from a lastSeq older than such an update, the server sends current state (or resync_required) instead of a replay, so nothing is missed.

Score & Status Messages

score (scores channel) and status (status channel) messages describe the event itself - no bookie, no markets. A score message carries only scores - it is sent on every score change and does not include a status field. A status message is sent once per status transition (a new match appearing as pending, kickoff to live, settled, cancelled) and includes the current scores, so a status-only subscriber gets the final result on settle. The scores object matches the GET /events shape. Live score and live-status messages also include a clock snapshot (same shape as the clock field on GET /events/live) when clock data is available, so you can re-anchor a client-side ticker on every real event. It is omitted on pending/settled/cancelled messages and on sports without a clock. If a fixture is re-issued (for example with home and away corrected), the old event is cancelled and replacedBy points to the event to use. A cancelled status message for such an event carries replacedBy. Every connection on the odds channel, whatever its status filter, also gets a no_markets with replacedBy for each of your bookmakers on the old event, so a client without the status channel learns the new id too. It carries a seq and is replayed on reconnect. The old event gets no odds after that, and the new event’s odds arrive as normal created/updated messages. See Handling Re-issued Fixtures.

Clock Messages

Every 30 seconds, each live event whose clock carries elapsed time (playedSeconds, or periodStartedAt on feeds without a played clock) gets a clock message. Sports without a game clock (for example tennis or table tennis) get none. A clock that has not changed, such as at half-time, is not repeated every 30 seconds but at least every 5 minutes. It goes to connections subscribed to scores or status, with the same sport, leagues, eventIds and status filters as score messages. Like score/status it is best-effort and has no seq.
To show a ticking clock, count forward from playedSeconds locally while running is true, and replace your value with the server’s on every clock snapshot (from a clock, score or status message). Hold it still while running is false. A match sitting at 0-0, or one you start watching mid-half, gets its first clock within about 30 seconds; to show it right away on a fresh connect, seed it with one GET /events/live call (a lastSeq reconnect gets a clock message right after its catch-up). Clients that ignore unknown message types are unaffected.
See the Live Events guide for the full clock field reference and the client-side ticker recipe. The top-level scores.home/away is the OT/penalty-inclusive result. The periods map may contain: The mapN_score keys are added after a series settles, usually within minutes, and only for the maps where a verified score is available, so treat each one as optional. Other esports titles carry the map winner only.
score/status messages are best-effort live state: they carry no seq and are not replayed on reconnect. After reconnecting, fetch the current value from GET /events. The full-time key is ft (the legacy feed used fulltime).

Quick Start

Handling Message Types

Best Practices

Use leagues or eventIds filters when you only need specific data. This reduces bandwidth and improves performance.
Always implement exponential backoff for reconnections to handle network issues gracefully.
Handle welcome, created, updated, deleted, no_markets, and resync_required to keep your data in sync.
Each API key can hold two connections at once, for example a primary and a standby. Opening a third closes the oldest, so reuse your connections instead of opening a new one per request. A new connection within 2 seconds of that is refused with close code 1013 (try again later), so wait a few seconds before reconnecting. More connections per key are available as an add-on on request.
If receiving many updates, process them asynchronously to avoid blocking your main thread.

Benefits Over REST API

Get Access

Enable WebSocket Access

Subscribe to WebSocket as an add-on through your odds-api.io account

WebSocket Guide

Detailed guide with advanced examples

Fetching Odds

Learn about REST API odds fetching
Last modified on November 14, 2026