接口说明
本平台所有标准枚举的唯一权威字典,供客户端程序化获取码值含义,避免硬编码。维度 dim:match_status(比赛状态)、position(球员位置)、event_type(事件类型)、stat_type(技术统计类型)、var_reason、var_result、event_reason。不传 dim 返回全部。
调用信息
- 请求
GET https://api.sports.csap.ai/api/v1/dict- 鉴权
- 请求头 X-API-Key: <你的 key>(也支持 Authorization: Bearer <key>;?key= 仍可用但不建议,key 会留在地址和日志里)
- 外部 key
- 可调用所有有效的 key 都能调用。
- 频率限制
- 每分钟 3000 次 · 每天 200000 次 · 按 key 配置(以 /api/v1/account 返回的 rate_per_min、quota_daily 为准;上面是试用 key 的值),超出回 429。另外整表快照、不带比赛 id 的统计列表等重型请求全站同时只处理 2 个,排不上回 429 + Retry-After。响应里暂时没有 X-RateLimit-* 头。 详见通用说明
请求参数 2
| 参数 | 类型 | 必填 | 示例 | 说明 |
|---|---|---|---|---|
| dim | string | 可选 | 维度过滤:match_status/position/event_type/stat_type/var_reason/var_result/event_reason;不传=全部 | |
| limit | integer | 可选 | 2 | 默认 2000 |
请求示例
curl "https://api.sports.csap.ai/api/v1/dict?limit=2" \ -H "X-API-Key: YOUR_API_KEY"
在线调试
示例返回
{
"code": 0,
"data": [
{
"code_id": 1,
"compat_code": 1,
"dim": "continent",
"key": "int",
"name_zh": "国际",
"short_code": "INT"
},
{
"code_id": 2,
"compat_code": 2,
"dim": "continent",
"key": "eu",
"name_zh": "欧洲",
"short_code": "EU"
}
],
"message": "success",
"success": true
}返回字段 7
code_idinteger该维度内的唯一码
示例: 1dimstring维度
示例: "continent"keystring机器名
name_enstring英文名
示例: "INT"name_zhstring中文名
示例: "国际"compat_codeinteger兼容接口(/api/v5)里使用的码值(多数=code_id)
示例: 1short_codestring短码(如位置 F/M/D/G)
示例: "INT"错误码
| HTTP | message | 场景 |
|---|---|---|
| 401 | missing API key / unauthorized | 没带 X-API-Key 或 key 无效、已停用 |
| 429 | rate limit exceeded / daily quota exceeded | 超过 key 的每分钟次数或每日配额 |
| 429 | server busy, retry later | 服务端并发名额已满(重型请求同时只有 2 个),按 Retry-After 秒后重试 |
| 500 | query error | 服务端查询失败,可重试 |