WebSocket API
此 WebSocket 用于针对单场比赛的变动提供实时更新。
连接详情
- 端点:
wss://api.oddspapi.io/v4/ws?apiKey=YOUR_API_KEY - 数据方向: 单向(服务器 → 客户端)
- 认证方式: API Key —
YOUR_API_KEY
数据结构
所有消息都包含 fixtureId。除完整对象外,只会传输有变化的字段值, players 完整对象除外。
{
"fixtureId": "string",
"betradarId": "number?",
"startTime": "number?",
"participant1Id": "number?",
"participant2Id": "number?",
"sportId": "number?",
"updatedAt": "string?",
"tournamentId": "number?",
"seasonId": "number|null",
"sofascoreId": "number|null",
"betgeniusId": "number|null",
"flashscoreId": "string|null",
"statusId": "number|null",
"bookmakerOdds": {
"bookmaker": {
"bookmakerFixtureId": "string|null",
"fixturePath": "string|null",
"markets": {
"marketId": {
"bookmakerMarketId": "string|null",
"outcomes": {
"outcomeId": {
"players": {
"playerId": {
"limit": "number|null",
"price": "number",
"active": "boolean",
"oddsId": "string|null",
"betslip": "any|null",
"playerId": "number",
"changedAt": "string",
"playerName": "string|null",
"exchangeMeta": "any|null"
}
}
}
}
}
}
}
}
}关键特性
- 部分更新: 只发送发生变化的字段
- 完整球员对象: 当任一字段发生变化时,整条球员对象会被重发
- 单一博彩公司更新: 每条消息只包含一个博彩公司的数据更新
- 时间戳机制:
updatedAt在任一顶级字段更新时进行变更
示例
示例 1:比赛元数据更新
{
"fixtureId": "id2704726161008023",
"statusId": 1,
"updatedAt": "2025-06-11T16:55:28.415401+00:00"
}示例 2:球员赔率更新
{
"fixtureId": "id1100097561092987",
"bookmakerOdds": {
"starcasino.be": {
"markets": {
"111": {
"outcomes": {
"111": {
"players": {
"0": {
"active": true,
"betslip": null,
"bookmakerOutcomeId": "2535416646",
"changedAt": "2025-06-11T16:55:30.284055+00:00",
"limit": null,
"playerName": null,
"price": 1.345,
"exchangeMeta": {},
"playerId": 0
}
}
}
}
}
}
}
}
}示例 3:博彩公司信息更新
{
"fixtureId": "id1100023561139799",
"bookmakerOdds": {
"22bet": {
"bookmakerFixtureId": "265591179",
"fixturePath": "https://22bets.com/line/basketball/5226-e/265591179-kk-partizan-buducnost-podgorica"
}
}
}示例 4:多市场同时更新
{
"fixtureId": "id1001509158796975",
"bookmakerOdds": {
"stake": {
"markets": {
"101": {
"outcomes": {
"101": {
"players": {
"0": {
"active": true,
"betslip": null,
"bookmakerOutcomeId": "2535416646",
"changedAt": "2025-06-11T16:55:30.284055+00:00",
"limit": null,
"playerName": null,
"price": 1.345,
"exchangeMeta": {},
"playerId": 0
}
}
},
"102": {
"players": {
"0": {
"active": true,
"betslip": null,
"bookmakerOutcomeId": "2535416646",
"changedAt": "2025-06-11T16:55:30.284055+00:00",
"limit": null,
"playerName": null,
"price": 1.345,
"exchangeMeta": {},
"playerId": 0
}
}
}
}
}
}
}
}
}示例 5:比分更新
{
"fixtureId": "id1000085362245214",
"scores": {
"periods": {
"2": {
"participant1Score": 0,
"participant2Score": 0,
"updatedAt": "2025-07-23T16:56:37.122614+00:00"
}
}
}
}上一页GET scores
