调用信息
- 请求
GET https://api.sports.csap.ai/api/v1/widget/options- 鉴权
- 请求头 X-API-Key: <你的 key>(也支持 Authorization: Bearer <key>;?key= 仍可用但不建议,key 会留在地址和日志里)
- 外部 key
- 需单独开通需要为 key 开通对应的接口和数据域,未开通时返回 403。
- 频率限制
- 每分钟 3000 次 · 每天 200000 次 · 按 key 配置(以 /api/v1/account 返回的 rate_per_min、quota_daily 为准;上面是试用 key 的值),超出回 429。另外整表快照、不带比赛 id 的统计列表等重型请求全站同时只处理 2 个,排不上回 429 + Retry-After。响应里暂时没有 X-RateLimit-* 头。 详见通用说明
请求参数 0
该接口无请求参数。
请求示例
curl "https://api.sports.csap.ai/api/v1/widget/options" \ -H "X-API-Key: YOUR_API_KEY"
在线调试
示例返回
{
"code": 0,
"data": {
"grant": {
"domains": [
"example.com",
"*.example.com"
],
"enabled": true,
"max_concurrent": 20,
"modules": [],
"organization_id": 2,
"organization_name": "外部测试(无内部授权)",
"templates": [],
"updated_at": "2026-11-09T14:22:29.680618Z",
"updated_by": "admin@opendata.local",
"views": [
"2.5d",
"3d"
]
},
"layouts": [
{
"description": "舞台 + 比分条 + 数据页签",
"enabled": true,
"id": "standard",
"min_width": 320,
"name": "标准",
"ratio_25d": "800:280",
"ratio_3d": "16:9",
"sort": 1,
"tab_order": [
"stats",
"timeline",
"scene"
],
"updated_at": "2026-11-09T14:13:45.452135Z",
"updated_by": "",
"views": [
"2.5d",
"3d"
]
},
{
"description": "舞台在左,数据面板在右侧常驻",
"enabled": true,
"id": "wide",
"min_width": 320,
"name": "宽屏",
"ratio_25d": "800:280",
"ratio_3d": "16:9",
"sort": 2,
"tab_order": [
"stats",
"timeline",
"scene"
],
"updated_at": "2026-11-09T14:13:45.452135Z",
"updated_by": "",
"views": [
"2.5d",
"3d"
]
},
{
"description": "只有舞台和比分条",
"enabled": true,
"id": "compact",
"min_width": 320,
"name": "紧凑",
"ratio_25d": "800:280",
"ratio_3d": "16:9",
"sort": 3,
"tab_order": [
"stats",
"timeline",
"scene"
],
"updated_at": "2026-11-09T14:13:45.452135Z",
"updated_by": "",
"views": [
"2.5d",
"3d"
]
}
],
"modules": [
{
"allowed": true,
"id": "scorebar",
"only_25d": false
},
{
"allowed": true,
"id": "sceneLabel",
"only_25d": true
},
{
"allowed": true,
"id": "eventCard",
"only_25d": false
}
],
"templates": [
{
"allowed": true,
"enabled": true,
"id": "classic",
"name": "官方经典",
"sort": 1,
"theme": {
"accent": "#ffb400",
"away": "#01bdff",
"bg": "#333333",
"home": "#fdbf04",
"pitch": "classic",
"text": "#ffffff"
},
"tier": "trial",
"updated_at": "2026-11-09T14:13:45.452135Z",
"updated_by": ""
},
{
"allowed": true,
"enabled": true,
"id": "night",
"name": "夜间",
"sort": 2,
"theme": {
"accent": "#a3e635",
"away": "#f472b6",
"bg": "#0f1419",
"home": "#22d3ee",
"pitch": "dark",
"text": "#e5e7eb"
},
"tier": "trial",
"updated_at": "2026-11-09T14:13:45.452135Z",
"updated_by": ""
},
{
"allowed": true,
"enabled": true,
"id": "flat",
"name": "简约平面",
"sort": 3,
"theme": {
"accent": "#f59e0b",
"away": "#ef4444",
"bg": "#f3f4f6",
"home": "#2563eb",
"pitch": "flat",
"text": "#111827"
},
"tier": "pro",
"updated_at": "2026-11-09T14:13:45.452135Z",
"updated_by": ""
}
],
"views": [
"2.5d",
"3d"
]
},
"message": "success",
"success": true
}返回字段 5
grantobject本组织的开通范围· 10
layoutsarray<object>布局列表· 12
modulesarray<object>开启的数据模块· 3
templatesarray<object>模板列表· 9
viewsarray可用画面(2.5d / 3d)
错误码
| HTTP | message | 场景 |
|---|---|---|
| 401 | missing API key / unauthorized | 没带 X-API-Key 或 key 无效、已停用 |
| 403 | 动画直播组件未开通,请联系商务 | 这个组织没开通动画直播组件,或开通已停用 |
| 403 | explicit endpoint and data-domain entitlement required | 需要单独开通这个接口和数据域 |
| 429 | rate limit exceeded / daily quota exceeded | 超过 key 的每分钟次数或每日配额 |
| 429 | server busy, retry later | 服务端并发名额已满(重型请求同时只有 2 个),按 Retry-After 秒后重试 |
| 500 | query error | 服务端查询失败,可重试 |