# Twitch 直播列表 API (twitch.streams)

- Canonical page: [https://everyinfra.com/twitch-api/streams](https://everyinfra.com/twitch-api/streams?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "twitch", "action": "streams", "params": {...}}
- Price: $0.001389 per call ($1.39 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, default 10, max 30 per call
- Mode: sync; add "mode": "async" for slow tasks

Twitch 直播列表按分类名 `game` 返回这个分类下正在直播的频道，每场带直播 ID `stream_id`、主播用户名和显示名、粉丝数、直播标题、观看人数 `viewer_count`、开播时间 `started_at` 和直播间链接。它回答「这个游戏或分类此刻谁在播、多少人在看」，适合游戏厂商做发行监测、品牌找合适的主播合作，以及研究一个分类的直播热度。

`game` 要填 Twitch 上的精确分类名，例如 Just Chatting；返回的是正在进行的直播，不是历史录像。

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=twitch&action=streams

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| game | not declared | yes | not declared | streams 的精确 Twitch 分类名称，例如 Just Chatting；返回该分类正在直播的频道，不是该游戏的历史录像。 |
| limit | integer (1–30) | no | 10 | 这次调用最多返回的条数，整数，1–30；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| stream_id | 本场直播 ID。 |
| username | 用户名（@handle）。 |
| display_name | 显示名，可能与 username 不同。 |
| follower_count | 粉丝数。null 表示不公开，不等于 0。 |
| title | 标题。平台无标题概念时（如纯文本帖）为 null。 |
| viewer_count | 观看人数。 |
| game | 游戏名。 |
| started_at | 开始时间。 |
| url | 该记录在原平台上的可访问链接。 |
| avatar_url | 头像图片链接。部分平台给的是带尺寸参数的 CDN 链接，可能有时效。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "twitch",
  "action": "streams",
  "params": {
    "game": "Just Chatting"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "twitch",
        "action": "streams",
        "params": {
            "game": "Just Chatting",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-09-26T08:56:04Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed; the list keeps the first 2 of 10. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "twitch",
  "action": "streams",
  "results": [
    {
      "stream_id": "•••",
      "username": "•••",
      "display_name": "•••",
      "follower_count": 1694011,
      "title": "話す→えぺ→でっかい歩き",
      "viewer_count": 14479,
      "game": "Just Chatting",
      "started_at": "2026-09-26T09:46:10+00:00",
      "url": "https://www.twitch.tv/fps_shaka",
      "avatar_url": "https://static-cdn.jtvnw.net/•••",
      "platform": "twitch"
    },
    {
      "stream_id": "•••",
      "username": "•••",
      "display_name": "•••",
      "follower_count": 402704,
      "title": "押忍！",
      "viewer_count": 6706,
      "game": "Just Chatting",
      "started_at": "2026-09-26T09:00:37+00:00",
      "url": "https://www.twitch.tv/yuyuta0702",
      "avatar_url": "https://static-cdn.jtvnw.net/•••",
      "platform": "twitch"
    }
  ],
  "count": 10,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### `game` 应该怎么填？

填 Twitch 分类页上显示的完整名称，例如 Just Chatting。可以先读热门直播，结果里每场的 `game` 就是准确的分类名，照抄过来最稳妥。

### 怎么估计一个分类的热度？

把返回直播的 `viewer_count` 加起来，就是这些直播间此刻的观看人数；定时读取，就能画出这个分类一天里的观看曲线。返回条数有上限，这个数只算返回的这几场。

### 怎么找适合合作的中小主播？

在结果里按 `viewer_count` 和 `follower_count` 筛选，去掉观看人数最高的头部频道，留下观看稳定、粉丝适中的主播。再看 `title` 是否贴合你的产品，`started_at` 能看出他们的开播时段。

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=twitch
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
