# YouTube 频道播放列表 API (youtube.channel_playlists)

- Canonical page: [https://everyinfra.com/youtube-api/channel_playlists](https://everyinfra.com/youtube-api/channel_playlists?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "youtube", "action": "channel_playlists", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, one page of up to 30 per call; the number of rows varies from page to page and a short page is not the end (limit is ignored; pass the top-level next_page_token from the response as page_token for the next page; no next_page_token means the end)
- Pagination: pass next_page_token back as page_token for the next page, other params unchanged; one call per page, tokens last 24 hours
- 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=youtube&action=channel_playlists

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| channel_id | not declared | yes | not declared | YouTube 频道：UC 开头的频道编号、频道链接（https://www.youtube.com/@NASA）或 @用户名。认不出的在扣费前拒绝（422）。 |
| page_token | not declared | no | not declared | 翻页令牌。第一页不传；响应有 next_page_token 时原样作 page_token 传回，其他参数不变。一页约 30 个播放列表，个数会变，limit 不起作用。每页算一次调用；令牌 24 小时有效。没有 next_page_token 就是翻不下去了。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| type | 记录类型，取值随能力而定（如 video / image / text）。 |
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| url | 该记录在原平台上的可访问链接。 |
| title | 标题。平台无标题概念时（如纯文本帖）为 null。 |
| author_name | 作者昵称（显示名）。 |
| author_id | 作者在原平台的唯一 ID。 |
| author_url | 作者在原平台的主页链接。 |
| thumbnail_url | 缩略图链接，分辨率低于 image_url。 |
| playlist_id | 这一行是播放列表或合辑时的列表编号，否则是 null。 |
| video_count | 视频数；channel_playlists 里是这个播放列表的视频数。 |
| video_count_estimated | 为 true 表示 video_count（视频数）是从 YouTube 显示的约数（如 1.2M）换算的估算值，不是准确数；准确数时没有这个字段。 |
| is_course | 这个播放列表是不是课程（channel_playlists）。 |
| 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": "youtube",
  "action": "channel_playlists",
  "params": {
    "channel_id": "UCLA_DiR1FfKNvjuUpBHmylQ"
  }
}'
```

```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": "youtube",
        "action": "channel_playlists",
        "params": {
            "channel_id": "UCLA_DiR1FfKNvjuUpBHmylQ",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

No real sample for these example parameters yet: structure only, every value is a placeholder (…).

```text
{
  "id": "req_…",
  "platform": "youtube",
  "action": "channel_playlists",
  "results": [
    {
      "type": …,
      "id": …,
      "url": …,
      "title": …,
      "author_name": …,
      "author_id": …,
      "author_url": …,
      "thumbnail_url": …,
      "playlist_id": …,
      "video_count": …,
      "video_count_estimated": …,
      "is_course": …,
      "platform": …
    }
  ],
  "next_page_token": …,
  "pagination": { … },
  "count": …,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## Also

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