Endpoints
Auth and scope filtering
The handshake validatesapi_key. After upgrade, the server pushes only the message types your key’s scopes allow:
Frames you aren’t entitled to are silently dropped — no
403 per-frame, no errors. Use /v1/whoami to confirm your stream scopes before debugging missing frames.
Frame envelope
data is the same shape (and same scope-filtered field set) as the matching REST endpoint — match.updated mirrors GET /cs2/v1/matches/{id}, bet_settlement mirrors a settlement entry, etc.
Snapshot semantics
On connect the server sends a snapshot of currently-relevant state (live matches, active markets) before switching to incremental frames. After that it polls and emits a frame only when the underlying state actually changes — no constant chatter.
Frames carry a content-hash; if nothing changed in the polling tick, nothing is pushed.
Frame format
WebSocket frames are JSON only. The REST surface offers XML for the seven feed endpoints (see Content negotiation); the WS channel does not — frames are always JSON regardless of theAccept header on the upgrade.
Clients that need XML for their archival pipeline can hit the matching REST endpoint with Accept: application/xml after each interesting frame.
Keep-alive
The server sends analive envelope every 10s — same shape as REST /v1/alive. If you don’t see one for ~30s, reconnect.
Reconnect strategy
- Reconnect with exponential backoff (start 1s, cap at 30s).
- After reconnect, kick off a stateful recovery replay — the AMQP path republishes the current market state plus settlements/voids since your last processed timestamp and terminates with
<snapshot_complete>. - Unique-ish frame ids live in
meta.seq— use it to dedupe across reconnects.