Multiplexed WebSocket — subscribe to markets, scores, plays, and live channels
Establishes a single WebSocket connection carrying multiple logical channels. Instead of query-parameter filters, send JSON subscribe messages after connecting.
Connection: wss://therundown.io/api/v2/ws?key=YOUR_API_KEY
Channels:
markets— market price updates (same payloads as/api/v2/ws/markets)scores— score and event-status updates (no live game state fields)plays— play-by-play deltas for live games. Requires an Ultra plan or higher (the live game state entitlement); aplaysorlivesubscribe from a non-entitled key is rejected with error codeforbidden.live— score/status deltas includinglive_game_state, plus play-by-play deltas, on one subscription. Requires an Ultra plan or higher;live_game_stateandgame_stateare accepted aliases.
Subscribe (client → server):
{
"action": "subscribe",
"id": "p1",
"channel": "plays",
"params": { "sport_ids": [3], "event_ids": ["<eventID>"] }
}
The server acknowledges with {"type":"subscribed","id":"p1","sequence":N,"message":"subscribed to plays"}.
Supported params filters: sport_ids, event_ids (plus market_ids and
affiliate_ids on the markets channel). Unsubscribe with
{"action":"unsubscribe","id":"p1"}.
Delta messages (server → client) are wrapped in an envelope tagged with your
subscription id:
{
"type": "delta",
"id": "p1",
"sequence": 42,
"sub_sequence": 7,
"delta_last_id": "...",
"data": { "meta": { "type": "play" }, "data": { ... } }
}
Snapshots: add "snapshot": true to params to receive current state
(snapshot frames, then snapshot_complete) before deltas begin; an active
subscription can request a fresh snapshot at any time with
{"action":"snapshot","id":"p1"}. Snapshot requests need a bounded scope and
are metered as data points like the equivalent REST reads.
Errors: {"type":"error","id":"...","code":"...","message":"..."} with codes
forbidden (plays/live without Ultra+), invalid_channel, missing_id,
duplicate_id, and subscription_limit (plan’s concurrent subscription cap
reached).
Concurrent connection and subscription limits vary by tier. See the WebSocket reference for full protocol details.
Authorizations
API key as query parameter
Response
WebSocket upgrade successful