Twitch 能力清单
| action | 必填参数 | 可选参数 | 单次条数 | 模式 | 单价 / 次 | 返回字段 |
|---|---|---|---|---|---|---|
| search | keyword | — | 默认 10 · 最多 30 | 同步 | ¥0.01 | user_id · username · display_name · bio · url · avatar_url · banner_url · follower_count · is_partner · is_affiliate · is_live · current_viewers · stream_title · current_game · stream_started_at · last_broadcast_title · last_broadcast_game · last_broadcast_at · created_at |
| profile | username | include_clips, include_videos | — | 同步 | ¥0.01 | user_id · username · display_name · bio · url · avatar_url · banner_url · follower_count · is_partner · is_affiliate · is_live · current_viewers · stream_title · current_game · stream_started_at · last_broadcast_title · last_broadcast_game · last_broadcast_at · created_at |
| clips | username | period | 默认 10 · 最多 30 | 同步 | ¥0.01 | id · title · url · view_count · duration_seconds · game · channel_username · channel_name · curator_username · curator_name · thumbnail_url · created_at · platform |
| streams | game | keyword | 默认 10 · 最多 30 | 同步 | ¥0.01 | stream_id · username · display_name · follower_count · title · viewer_count · game · started_at · url · avatar_url · platform |
| top_streams | — | — | 默认 10 · 最多 30 | 同步 | ¥0.01 | stream_id · username · display_name · follower_count · title · viewer_count · game · started_at · url · avatar_url · platform |
| top_games | — | — | 默认 10 · 最多 200 | 同步 | ¥0.01 | id · name · viewer_count · broadcaster_count · box_art_url · url · platform |
返回字段含义
字段名跨 87 个平台统一,同一个键在哪个平台都是同一个意思—— 这也是换平台只需改 platform 一个字段的原因。 机器可读版:/api/v1/social/fields
- user_id
- 用户在原平台的唯一 ID。
- username
- 用户名(@handle)。
- display_name
- 显示名,可能与 username 不同。
- bio
- 个人简介,账号自己填写的文本。可能含换行和 emoji。
- url
- 该记录在原平台上的可访问链接。
- avatar_url
- 头像图片链接。部分平台给的是带尺寸参数的 CDN 链接,可能有时效。
- follower_count
- 粉丝数。null 表示不公开,不等于 0。
- created_at
- 创建时间,格式同 posted_at。
- id
- 该记录在原平台上的唯一标识。仅在同一平台内唯一,跨平台可能重复。
- title
- 标题。平台无标题概念时(如纯文本帖)为 null。
- view_count
- 浏览/播放数。null 表示不公开,不等于 0。
- duration_seconds
- 时长,单位秒。非视频/音频内容为 null。
- thumbnail_url
- 缩略图链接,分辨率低于 image_url。
- platform
- 数据来源平台标识,与请求里的 platform 一致(如 xiaohongshu、tiktok)。
- name
- 名称。用于账号/商品/商家类能力,指该对象本身的名字。
另有 Twitch 特有字段 banner_url · is_partner · is_affiliate · is_live · current_viewers · stream_title · current_game · stream_started_at · last_broadcast_title · last_broadcast_game · last_broadcast_at · game · channel_username · channel_name · curator_username · curator_name · stream_id · viewer_count · started_at · broadcaster_count · box_art_url,保留该平台自身的语义。
30 秒调用示例
curl -X POST https://api.everyinfra.com/api/v1/social \ -H "Authorization: Bearer omg_live_你的KEY" \ -H "Content-Type: application/json" \ -d '{"platform":"twitch","action":"search","params":{"keyword":"咖啡"}}'
返回长这样
{ "id": "twitch_…", "search": [ { "user_id": "…", "username": "…", "display_name": "…", "bio": "…", "url": "https://…", "avatar_url": "https://…", "banner_url": "https://…", "follower_count": 128, "is_partner": true, "is_affiliate": true, "is_live": true, "current_viewers": "…", "stream_title": "…", "current_game": "…", "stream_started_at": "2026-08-01T09:30:00Z", "last_broadcast_title": "…", "last_broadcast_game": "…", "last_broadcast_at": "2026-08-01T09:30:00Z", "created_at": "2026-08-01T09:30:00Z" } ], "count": 10, "billing": { "charged": true, "credits": 100, "cny": 0.01 }}
常见用例
关键词监控
按关键词轮询 Twitch 的新内容,配合 Gemini 文本 API 做情绪分类与异常波动告警。
账号与主体画像
按 Twitch 的主页数据建达人/商家档案,做投放筛选或竞品盯防。
Twitch API 常见问题
Twitch API 怎么调用?
统一入口 POST /api/v1/social,请求体传 platform="twitch"、action(见上方能力清单)和 params。鉴权用请求头 Authorization: Bearer <API Key>,同一把 Key 可以调用全部 87 个平台,不需要为每个平台单独申请。
Twitch API 怎么收费?
按次计费,¥0.01/次,从统一的 ¥ 钱包扣。一次调用一次计费,不按返回条数或页数加价;参数错误、鉴权失败和空结果都不计费。每次调用的响应里带 billing 字段,写明本次实扣多少。
Twitch API 一次能返回多少条数据?
按能力不同,单次最多 200 条(逐能力上限见上方清单的「单次条数」列)。传 limit 参数控制,不传则用默认值。一次调用就返回这么多条,不需要翻页、也不会因为条数多而多收钱。
Twitch API 返回哪些字段?
每个能力的返回字段都列在上方能力清单的「返回字段」列里,例如 search 返回 user_id、username、display_name、bio、url、avatar_url 等。字段名跨平台统一,换平台不用改解析代码。
可以先免费试用 Twitch API 吗?
可以。注册免费,加微信领邀请码可得 ¥5 免费额度(≈500 次数据调用或 400 次 AI 调用),足够把 Twitch 的 6 个能力都试一遍。无需信用卡。
开始调用 Twitch API
加微信领 ¥5 免费额度 —— ≈500 次数据调用或 400 次 AI 调用,足够把 Twitch 的能力全试一遍。