Client → Server messages
Send JSON objects to subscribe or unsubscribe from a match. Thematch_id is the integer id returned by the REST /matches endpoints.
Subscribe:
Control message fields
| Field | Type | Description |
|---|---|---|
action | string | "subscribe" to start receiving updates, "unsubscribe" to stop |
match_id | integer | The match id to subscribe to or unsubscribe from |
Server → Client frames
Every frame the server sends is a JSON object with anop field that identifies the frame type.
op | When sent | Additional fields |
|---|---|---|
snapshot | Immediately after a successful subscribe | data: full live snapshot object |
update | Whenever a subscribed match state changes | data: full live snapshot object |
error | On a bad control message or unauthorized subscription | error: human-readable reason string |
data object is a complete live snapshot, and always includes a match_id field. This lets a single connection multiplex updates from many matches — inspect data.match_id to route each frame to the right handler.
Example frames
v1 sends a full snapshot on every
update frame — there are no field-level deltas. Your handler can replace its local state entirely on each frame.Subscribing to a match outside your enabled sport allowlist returns an
error frame. The error message will indicate that the sport is not enabled for your API key.