返回符合筛选条件的直播,按观众数排序,含标题、游戏和主播信息。
POST
/api/v1/twitch/search/live额度扣减: 本接口每次成功请求会从套餐额度中扣减 1 单位。
请求参数
必填参数
该接口没有必填参数。
可选参数
| 名称 | 位置 | 类型 | 说明 |
|---|---|---|---|
user_id | body | object | User ID example: string |
user_login | body | object | User login name example: string |
game_id | body | object | Game (category) ID example: string |
type | body | object | Stream type filter for the live list. Possible values: all, live; default all example: string |
language | body | object | Language example: string |
first | body | integer | Page size, maximum 100, default 20 example: 0 |
before | body | object | Previous page cursor example: string |
after | body | object | Next page cursor example: string |
响应字段
| 名称 | 类型 | 说明 |
|---|---|---|
success | boolean | Success |
code | integer | Code |
message | string | Message |
data | object | - |
data.more | boolean | Has more |
data.offset | string | offset |
data.data | array<object> | data |
在线调试
https://openapi.scdata.cc/api/v1/twitch/search/live
请先从 Dashboard 选择一个 API key
发送请求前请先准备一个 API key。前往 Dashboard
JSON 请求体
cURL 示例
bash
curl -X POST "https://openapi.scdata.cc/api/v1/twitch/search/live" \-H "Authorization: YOUR_API_KEY" \-H "Content-Type: application/json" \-d '{"user_id":"string","user_login":"string","game_id":"string","type":"string","language":"string","first":0,"before":"string","after":"string"}'
响应示例 (200 application/json)
json
{"success": true,"code": 200,"message": "Request successful","data": {"more": true,"offset": "string","data": [{"id": "string","user_id": "string","user_login": "string","user_name": "string","game_id": "string","game_name": "string","type": "string","title": "string","viewer_count": 0,"started_at": "2019-08-24T14:15:22.123Z","language": "string","thumbnail_url": "string","tags": ["string"],"is_mature": true}]}}
使用场景
- 实时机会捕捉 — 查看谁正在直播新发布的游戏,趁热度联系。
- 直播看板 — 在内部监控屏上展示某分类下的热门直播频道。