Documentation Index
Fetch the complete documentation index at: https://docs.sx.bet/llms.txt
Use this file to discover all available pages before exploring further.
This WebSocket API will be deprecated on July 1, 2026. See the Migration Guide to move to the Centrifuge-based API.
Subscribe to live score changes for a particular event.
CHANNEL NAME FORMAT
live_scores:{sportXEventId}
| Name | Type | Description |
|---|
| sportXEventId | string | The event ID you wish to subscribe to |
MESSAGE PAYLOAD FORMAT
| Name | Type | Description |
|---|
| teamOneScore | number | The current score for the home team (teamOneName in the Market object) |
| teamTwoScore | number | The current score for the away team (teamTwoName in the Market object) |
| sportXEventId | string | The event ID for this update |
| currentPeriod | string | An identifier for the current period |
| periodTime | string | The current time for the period. “-1” if not applicable (for example, in tennis) |
| sportId | number | The sport ID for this market |
| leagueId | number | The league ID for this market |
| periods | Period | Individual period information |
| extra | string | JSON encoded extra data for this live score update |
where a Period object looks like
| Name | Type | Description |
|---|
| label | string | The period name |
| isFinished | boolean | true if the period is over |
| teamOneScore | string | The score of the home team (teamOneName in the Market object) |
| teamTwoScore | string | The score of the away team (teamTwoName in the Market object) |
To get the actual line, you’ll have to fetch the market using the marketHash
const sportXEventId = "L7178624";
const channel = realtime.channels.get(`live_scores:${sportXEventId}`);
channel.subscribe((message) => {
console.log(message.data);
});
The above command returns JSON structured like this:
{
"teamOneScore": 2,
"teamTwoScore": 1,
"sportXEventId": "L7178624",
"currentPeriod": "4th Set",
"periodTime": "-1",
"sportId": 6,
"leagueId": 1263,
"periods": [
{
"label": "1st Set",
"isFinished": true,
"teamOneScore": "4",
"teamTwoScore": "6"
},
{
"label": "2nd Set",
"isFinished": true,
"teamOneScore": "6",
"teamTwoScore": "3"
},
{
"label": "3rd Set",
"isFinished": true,
"teamOneScore": "7",
"teamTwoScore": "5"
},
{
"label": "4th Set",
"isFinished": false,
"teamOneScore": "1",
"teamTwoScore": "2"
},
{
"label": "Game",
"isFinished": false,
"teamOneScore": "0",
"teamTwoScore": "0"
}
],
"extra": "[{\"Name\":\"Turn\",\"Value\":\"2\"},{\"Name\":\"DoubleFaults\",\"Value\":\"{\\\"3/6\\\":\\\"0,0,0,0,0\\\",\\\"3/7\\\":\\\"0,2,0,0,0\\\",\\"
}