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.
Early Access: The WebSocket is currently in early access. To enable it, contact us at hello@odds-api.io.
Connection
Endpoint:- API key passed as query parameter
- One connection per API key
- New connections automatically close older ones
- 2x the REST API price
- One-time implementation fee
Message Types
Type | Description |
---|---|
created | New match added |
updated | Match or market changed |
deleted | Match removed |
no_markets | Match exists but currently no markets available |
Message Format
Quick Start
Handling Message Types
Best Practices
Implement Reconnection Logic
Implement Reconnection Logic
Always implement exponential backoff for reconnections to handle network issues gracefully.
Handle All Message Types
Handle All Message Types
Don’t just listen for
updated
- also handle created
, deleted
, and no_markets
to keep your data in sync.One Connection Per API Key
One Connection Per API Key
Remember that new connections automatically close older ones. Don’t create multiple connections with the same API key.
Process Updates Asynchronously
Process Updates Asynchronously
If receiving many updates, process them asynchronously to avoid blocking your main thread.
Benefits Over REST API
Feature | REST API | WebSocket |
---|---|---|
Latency | 100-500ms (polling) | <150ms (push) |
Request overhead | Multiple HTTP requests | Single persistent connection |
Real-time updates | Manual polling | Automatic push |
Bandwidth | Higher (repeated headers) | Lower (single connection) |
Best for | Batch requests | Live updates |
Get Access
Request WebSocket Access
Contact us at hello@odds-api.io to enable WebSocket access for your account