Connection
Authentication
Pass your API key via:- Query string (recommended for browser clients):
?x-api-key=YOUR_API_KEY - Header:
x-api-key: YOUR_API_KEY
Sport Selection
Optionally set thex-sport header during connection to scope live-scores to a specific sport (default: football).
Supported values: football, basketball, ice-hockey, tennis, rugby, handball, volleyball, baseball, american-football, cricket, futsal, mma, motorsport, darts, snooker, badminton, table-tennis, beach-volley, cycling, esports, bandy, aussie-rules, floorball, minifootball, waterpolo.
Message Format
All messages are JSON. Send actions to subscribe/unsubscribe from channels:Available Channels
| Channel | Description | Delivery |
|---|---|---|
live-scores | All live match scores & status changes (auto-scoped to your x-sport) | NATS push ā sub-second |
live-scores:{sport} | Live scores for a specific sport (e.g. live-scores:basketball) | NATS push ā sub-second |
match:{matchId} | Score & status updates for a single match | NATS push ā sub-second |
match:{matchId}:incidents | Goals, cards, substitutions, VAR decisions | NATS-triggered fetch ā sub-second |
match:{matchId}:stats | Match statistics (possession, shots, passes) | NATS-triggered fetch ā sub-second |
match:{matchId}:odds | Live odds from all providers | NATS-triggered fetch ā sub-second |
match:{matchId}:lineups | Team lineups (typically available pre-match) | Polling ā 60s interval |
Delivery Modes
- NATS push ā Data is pushed directly from the real-time feed with no delay
- NATS-triggered fetch ā When any match update is detected, detailed data is fetched instantly (no waiting for poll cycle)
- Polling ā Data is fetched at regular intervals (used for lineups which rarely change)
Response Types
welcome
Sent immediately on connection:
subscribed
Confirms a channel subscription:
snapshot
Last known data sent immediately upon subscribing (if available):
update
New data pushed in real-time:
pong
Response to a ping (for keep-alive):
Quick Start Examples
Best Practices
Subscribe only to channels you need
Subscribe only to channels you need
Each subscription consumes server resources. Only subscribe to channels your application actively uses.
Use incidents for real-time match events
Use incidents for real-time match events
Use
match:{id}:incidents for real-time match events rather than polling the REST endpoint.Handle snapshot messages
Handle snapshot messages
When you subscribe, you immediately get the last known state so your UI is never blank.
Send periodic pings
Send periodic pings
Send
{"action":"ping","channel":"live-scores"} every 30s to keep the connection alive.Reconnect with backoff
Reconnect with backoff
If disconnected, reconnect with exponential backoff (1s, 2s, 4s, 8sā¦).
Unsubscribe when done
Unsubscribe when done
Unsubscribe from match channels when the user navigates away.