Documentation / Live
GET /streamFree key, archive on paid
Snooker API: The live feed as Server-Sent Events, sent as it happens: one connection holds for five minutes, then reconnects by itself from the last event
The live feed as Server-Sent Events, sent as it happens: one connection holds for five minutes, then reconnects by itself from the last event.
GEThttps://api.snookerapi.net/v1/stream
Try it
Parameters
| Name | Type | What it is |
|---|---|---|
| match_id | id | Only this match (mt_ id). |
| types | string | Only these event types, comma separated: match.started, frame.won, match.finished, century.made. |
| since | id | Replay from after this le_ id. EventSource sends Last-Event-ID by itself on reconnecting. |
| token | string | A token from GET /v1/stream/token, for a browser. Elsewhere send the key in a header as usual. |
Returns
| Field | Type | What it holds |
|---|---|---|
| id | string | The record's own id: stable, and the same in every call. |
| type | string | match.started, frame.won, match.finished or century.made. |
| at | string | When we had it (UTC). |
| event | object | The event: id, name and season. |
| match | object or null | The match: id, stage, round and both players; null for a century. |
| data | object | What changed: the scores and best of, the frames won, the winner, or the century's player and points. |
Example answer
A real answer, read from the data within the last hour: GET /v1/stream?types=frame.won,match.finished
{
"content_type": "text/event-stream",
"one_event": "id: le_7qk3m2xa\nevent: frame.won\ndata: {\"id\":\"le_7qk3m2xa\",\"type\":\"frame.won\",\"at\":\"...\",\"event\":{...},\"match\":{...},\"data\":{\"score_one\":4,\"score_two\":3,\"best_of\":11,\"frames_won\":1}}"
}Errors
| Status | Code | When |
|---|---|---|
| 401 | unauthorized | No key, or a key that is not valid. Errors |
| 400 | bad_request | A parameter has the wrong shape. Errors |
| 422 | unknown_parameter | A parameter this call does not take. Errors |
| 429 | rate_limited | Too many calls this minute; wait for Retry-After. Errors |