# Twitch 直播切片 API (twitch.clips)

- Canonical page: [https://everyinfra.com/twitch-api/clips](https://everyinfra.com/twitch-api/clips?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "twitch", "action": "clips", "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

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| username | not declared | yes | not declared | profile / clips 的 Twitch 频道登录短名，可带 @，不解析完整 twitch.tv URL。 |
| period | not declared | no | not declared | clips 的时间窗：LAST_DAY 最近一天、LAST_WEEK 最近一周（默认）、LAST_MONTH 最近一月、ALL_TIME 不限；大小写会归一，非法值回落 LAST_WEEK。 |
| limit | integer (1–30) | no | 10 | 这次调用最多返回的条数，整数，1–30；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| title | 标题。平台无标题概念时（如纯文本帖）为 null。 |
| url | 该记录在原平台上的可访问链接。 |
| view_count | 浏览/播放数。null 表示不公开，不等于 0。 |
| duration_seconds | 时长，单位秒。非视频/音频内容为 null。 |
| duration_sec | platform-native meaning |
| game | 游戏名。 |
| channel_username | 频道用户名。 |
| channel_name | 频道名。 |
| curator_username | 剪辑者用户名（Clip 由观众剪出）。 |
| curator_name | 剪辑者昵称。 |
| thumbnail_url | 缩略图链接，分辨率低于 image_url。 |
| created_at | 创建时间，格式同 posted_at。 |
| 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": "clips",
  "params": {
    "username": "shroud"
  }
}'
```

```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": "clips",
        "params": {
            "username": "shroud",
        },
    },
    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": "clips",
  "results": [
    {
      "id": "•••",
      "title": "wtf !!",
      "url": "https://www.twitch.tv/shroud/clip/SeductiveFurryPotCmonBruh--v2IUlxXQxpw8YUZ",
      "view_count": 2230,
      "duration_seconds": 39,
      "game": "Active Matter",
      "channel_username": "shroud",
      "channel_name": "shroud",
      "curator_username": "•••",
      "curator_name": "Taisseeer",
      "thumbnail_url": "https://static-cdn.jtvnw.net/twitch-video-assets/twitch-vap-video-assets-prod-us-west-2/f4e752a4-c4c1-42b9-a4a1-a7a28106a717/landscape/thumb/thumb-0000000000-1920x1080.jpg",
      "created_at": "2026-09-19T22:08:27+00:00",
      "platform": "twitch"
    },
    {
      "id": "•••",
      "title": "Pilot Kill",
      "url": "https://www.twitch.tv/shroud/clip/BreakableAssiduousBulgogiUnSane-oAR-wxU-JuRMLxdl",
      "view_count": 1042,
      "duration_seconds": 21,
      "game": "WARDOGS",
      "channel_username": "shroud",
      "channel_name": "shroud",
      "curator_username": "•••",
      "curator_name": "primo11119",
      "thumbnail_url": "https://static-cdn.jtvnw.net/twitch-video-assets/twitch-vap-video-assets-prod-us-west-2/f45445b1-9e8c-4cfd-88b0-d6cbe5d00b61/landscape/thumb/thumb-0000000000-1920x1080.jpg",
      "created_at": "2026-09-21T18:00:52+00:00",
      "platform": "twitch"
    }
  ],
  "count": 10,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## 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
