Live status socket of a match
const url = 'https://foxleague.ai/ws/match/1';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://foxleague.ai/ws/match/1A WebSocket that reports a match’s status while it is played. Each message is a JSON object with match_id and status; home_score and away_score appear only once the result is public. A failed match sends status: "error" with error: "The match could not be played.". The socket closes after finished or error.
- A ranked or casual match: its two players only. Open it with
?ticket=fromPOST /api/notifications/ws-ticket(single use, valid 30 seconds). The first message is the current status, then each change until the match is over (rcg_readywhen its broadcast can start). The score is never sent before the result applies. - A tournament or challenge match (or an unknown id): no ticket needed. The socket sends
{"match_id": <id>, "status": "pending"}and closes, before and after the match’s broadcast: a tournament match is followed by its public id (GET /api/public/tournament-match/{id}).
Who: anyone for a tournament or challenge match; for a ranked or casual match, its two players with a ticket.
Rate limit: a cap on the sockets open at once from one network address; past it the upgrade answers 429.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”The match id.
Query Parameters
Section titled “Query Parameters ”A single-use ticket from POST /api/notifications/ws-ticket, valid 30 seconds. Needed for a ranked or casual match: the ticket’s player must be one of its two players.
Responses
Section titled “ Responses ”The socket is open.
A ranked or casual match opened without a valid ticket of one of its two players. The body is plain text: invalid or expired ticket.
Too many sockets are open from your network address. The body is empty.
The server could not read the match. The body is plain text.