# TikTok 作者的合集 API (tiktok.user_playlists)

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| username | not declared | yes | not declared | TikTok 账号：@短名（如 nasa，可带 @）、主页链接 https://www.tiktok.com/@<短名>，或账号的 sec_uid。返回这个账号主页上的合集（Playlists）。号不存在时返回 200 和空结果，empty_reason 为 account_not_found，不扣费。 |
| page_token | not declared | no | not declared | 翻页令牌：把上一次响应里的 next_page_token 原样传回，拿下一页；不传从第一页开始。令牌 24 小时有效，每页算一次调用。每页最多 30 个合集。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| playlist_id | 合集 ID（user_playlists），原样传给 playlist_videos 的 playlist_id。 |
| title | 标题。平台无标题概念时（如纯文本帖）为 null。 |
| url | 该记录在原平台上的可访问链接。 |
| cover_image_url | 视频封面图链接（带签名，会过期）。 |
| video_count | 视频数。 |
| author_username | 作者用户名（@handle），通常可用于拼 URL。 |
| author_name | 评价人名字（shop_product_reviews），平台已打码，如 n**h；photos 里是作品作者的昵称。 |
| author_id | 作者在原平台的唯一 ID。 |
| author_sec_uid | 账号的 secUid：在 live_room 里是主播账号的 secUid，以 MS4w 开头；在 photos、playlist_videos、user_reposts、user_stories 里是作品作者账号的 secUid，在 user_playlists 里是合集作者账号的 secUid；在 music_detail 里是音乐作者账号的 secUid，原声才有。 |
| author_avatar_url | 作者头像图片链接（多数平台带签名、会过期）。 |
| 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": "tiktok",
  "action": "user_playlists",
  "params": {
    "username": "nasa"
  }
}'
```

```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": "tiktok",
        "action": "user_playlists",
        "params": {
            "username": "nasa",
        },
    },
    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": "tiktok",
  "action": "user_playlists",
  "results": [
    {
      "playlist_id": …,
      "title": …,
      "url": …,
      "cover_image_url": …,
      "video_count": …,
      "author_username": …,
      "author_name": …,
      "author_id": …,
      "author_sec_uid": …,
      "author_avatar_url": …,
      "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=tiktok
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
