接口说明
建议每10S更新
- 请求方式
GET- 请求地址
https://api.superscore.cn/volleyball/odds/inPlay- Content-Type
application/x-www-form-urlencoded;charset=UTF-8
请求头与鉴权
| 字段 | 类型 | 必填 | 文档示例值 | 说明 |
|---|---|---|---|---|
token | string | 是 | test | token仅供测试,正式站请设置IP |
商户密钥仅保存在自己的服务端。测试 token 与正式 IP 授权的适用范围以本表及账户授权说明为准。
请求参数
Query 查询参数
| 字段 | 类型 | 必填 | 文档示例值 | 说明 |
|---|---|---|---|---|
languageId | string | 否 | zh | No comments found. |
matchId | int32 | 是 | 0 | No comments found. |
companyIds | string | 否 | — | 盘口id,逗号隔开,默认全部 |
categoryIds | string | 否 | — | 玩法id,逗号隔开,默认全部 |
示例值用于说明字段;比赛、球队、联赛等 ID 应从实际接口取得,不能直接使用占位值。字段中的日期、枚举、分页范围与更新建议完整保留原始说明。
调用示例
替换 YOUR_MERCHANT_KEY、YOUR_MATCH_ID 等占位值后,在已授权的服务端调用。示例不会在本页面发起真实请求。
cURL
curl --get 'https://api.superscore.cn/volleyball/odds/inPlay' \
--header 'token: YOUR_MERCHANT_KEY' \
--data-urlencode 'languageId=YOUR_LANGUAGE_ID' \
--data-urlencode 'matchId=YOUR_MATCH_ID' \
--data-urlencode 'companyIds=YOUR_COMPANY_IDS' \
--data-urlencode 'categoryIds=YOUR_CATEGORY_IDS'JavaScript / Node.js
// 仅在服务端保存商户密钥;替换示例占位值。
const url = new URL("https://api.superscore.cn/volleyball/odds/inPlay");
url.search = new URLSearchParams({
"languageId": "YOUR_LANGUAGE_ID",
"matchId": "YOUR_MATCH_ID",
"companyIds": "YOUR_COMPANY_IDS",
"categoryIds": "YOUR_CATEGORY_IDS"
});
const response = await fetch(url, {
method: "GET",
headers: {
"token": "YOUR_MERCHANT_KEY"
}
});
if (!response.ok) throw new Error('HTTP ' + response.status);
const result = await response.json();
if (result.success !== true) throw new Error(String(result.message || result.code));
console.log(result.data);Python 标准库示例
# 标准库示例;商户密钥仅保存在服务端。
import json
from urllib.parse import urlencode
from urllib.request import Request, urlopen
parameters = {
"languageId": "YOUR_LANGUAGE_ID",
"matchId": "YOUR_MATCH_ID",
"companyIds": "YOUR_COMPANY_IDS",
"categoryIds": "YOUR_CATEGORY_IDS"
}
headers = {
"token": "YOUR_MERCHANT_KEY"
}
url = "https://api.superscore.cn/volleyball/odds/inPlay"
if parameters:
url += '?' + urlencode(parameters)
with urlopen(Request(url, headers=headers, method="GET"), timeout=15) as response:
result = json.load(response)
if not result.get('success'):
raise RuntimeError(result.get('message') or result.get('code'))
print(result.get('data'))返回参数
字段路径保留完整层级;[] 表示数组元素,<key> 表示按数据内容变化的映射键。success、code、message 与 data 均按接口定义列出。
| 字段路径 | 类型 | 说明与枚举 |
|---|---|---|
success | boolean | 是否成功 |
message | string | 提示信息 |
data | object | 数据 |
data.matchId | int32 | 比赛id |
data.updateTime | int64 | 更新时间 |
data.categoryList | array | 玩法 |
data.categoryList[].id | int32 | 玩法id |
data.categoryList[].stop | boolean | True – 投注暂停/市场不活跃 False – 投注活跃 |
data.categoryList[].sort | int32 | 排序 |
data.categoryList[].companyList | array | 市场 |
data.categoryList[].companyList[].id | int32 | 盘口id |
data.categoryList[].companyList[].ts | int64 | 更新时间 |
data.categoryList[].companyList[].stop | boolean | True – 投注暂停/市场不活跃 False – 投注活跃 |
data.categoryList[].companyList[].type | int32 | 1早,2即,3临,4滚 |
data.categoryList[].companyList[].score | string | 比分 滚球字段 |
data.categoryList[].companyList[].minute | string | 时间 滚球字段 |
data.categoryList[].companyList[].odds | array | 指数 |
data.categoryList[].companyList[].odds[].id | string | 名称 |
data.categoryList[].companyList[].odds[].name | string | 名称 |
data.categoryList[].companyList[].odds[].nameZh | string | 名称 |
data.categoryList[].companyList[].odds[].value | string | 值 |
data.categoryList[].companyList[].odds[].stop | boolean | True – 投注暂停/市场不活跃 False – 投注活跃 |
data.categoryList[].companyList[].odds[].handicap | string | 滚球字段 |
data.categoryList[].companyList[].odds[].oddsChild | array | 子指数 |
data.categoryList[].companyList[].odds[].oddsChild[].name | string | 名称 |
data.categoryList[].companyList[].odds[].oddsChild[].nameZh | string | 名称 |
data.categoryList[].companyList[].odds[].oddsChild[].value | string | 值 |
data.categoryList[].companyList[].odds[].oddsChild[].stop | boolean | True – 投注暂停/市场不活跃 False – 投注活跃 |
code | string | 编码 |
timestamp | int64 | 时间 |
响应结构示例
下面的值仅展示字段类型,不是实时数据或真实调用结果。动态 map 的键取决于实际返回,不编造固定字段。
展开完整 JSON 结构
{
"success": false,
"message": "示例字符串",
"data": {
"matchId": 0,
"updateTime": 0,
"categoryList": [
{
"id": 0,
"stop": false,
"sort": 0,
"companyList": [
{
"id": 0,
"ts": 0,
"stop": false,
"type": 0,
"score": "示例字符串",
"minute": "示例字符串",
"odds": [
{
"id": "示例字符串",
"name": "示例字符串",
"nameZh": "示例字符串",
"value": "示例字符串",
"stop": false,
"handicap": "示例字符串",
"oddsChild": [
{
"name": "示例字符串",
"nameZh": "示例字符串",
"value": "示例字符串",
"stop": false
}
]
}
]
}
]
}
]
},
"code": "示例字符串",
"timestamp": 0
}错误处理与使用说明
- 先检查 HTTP 状态,再解析 JSON;网络失败或非 JSON 响应不能当作成功。
- 业务响应 success 为 false 时,读取 code 和 message;不要把业务错误与 HTTP 状态混为一谈。
- 保存原始错误码、请求时间及接口路径用于排查,日志中移除商户密钥。
- 按该接口的数据更新建议、账户授权和调用频率请求;日期和时间戳单位以字段说明为准。
- 允许字段缺失或数据为空,按接口中的稳定 ID 关联资料,不依赖数组顺序。