# TikTok 用户视频 API (tiktok.user_videos)

- Canonical page: https://everyinfra.com/tiktok-api/user_videos
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "tiktok", "action": "user_videos", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, default 10, max 50 per call
- Mode: sync; add "mode": "async" for slow tasks

TikTok 用户视频按 `username` 列出一个公开账号发布的视频，每条带文案、点赞、评论、分享、播放和收藏数、发布时间、时长、背景音乐，以及这条是否广告、是否赞助、是否在主页置顶。它回答「这个账号发了什么、哪几条数据最好」，适合筛选达人、盯竞品账号，或者复盘一个账号的内容。

可选的 `sort`、`min_likes` 和 `until` 分别管排序、视频的最低点赞数和发布时间上界，默认 10 条，单次最多 50 条。同样返回视频列表的话题内容那一页，一次最多 30 条，也没有这几个筛选。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| username | not declared | yes | not declared | 公开 TikTok 用户短名，可带 @，不要把抖音 secUid 或完整主页 URL 塞入此字段。followers 只取粉丝数量；shop_creator 查询指定市场的带货达人信息。 |
| min_likes | integer | no | not declared | user_videos 的作者视频最低点赞数筛选，使用正整数；不是作者粉丝数或评论点赞门槛。 |
| sort | enum: newest / oldest / popular | no | not declared | user_videos 的作者视频排序：newest 最新、oldest 最早、popular 热门。只用于 user_videos，search 不支持排序。 |
| until | not declared | no | not declared | user_videos 的作者视频发布时间上界，不是数据采集时间；只用于 user_videos。 |
| limit | integer (1–50) | no | 10 | 这次调用最多返回的条数，整数，1–50；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| url | 该记录在原平台上的可访问链接。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| author_name | 评价人名字（shop_product_reviews），平台已打码，如 n**h。 |
| author_username | 作者用户名（@handle），通常可用于拼 URL。 |
| like_count | 点赞数。null 表示该平台或该接口不公开此数据，不等于 0。 |
| comment_count | 评论数。null 表示不公开，不等于 0。 |
| share_count | 分享/转发数。null 表示不公开，不等于 0。 |
| view_count | 浏览/播放数。null 表示不公开，不等于 0。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| collect_count | 收藏数。null 表示不公开，不等于 0。 |
| repost_count | 转发数。 |
| duration_sec | platform-native meaning |
| duration_seconds | 时长，单位秒。非视频/音频内容为 null。 |
| cover_image_url | 视频封面图链接（带签名，会过期）。 |
| language | 内容语言代码（如 zh、en），由平台判定，可能不准。 |
| country | 国家或地区。可能是全称也可能是 ISO 代码，取决于平台，未归一。 |
| hashtags | 正文里的话题标签数组，按出现顺序；没有时不出现这个字段。 |
| music | 背景音乐：id、title（曲名）、author、is_original（是否原声）、play_url（音频地址，会过期）、cover_url。 |
| is_ad | 是否广告视频。 |
| is_pinned | 是否在作者主页置顶。 |
| is_sponsored | 是否含赞助内容。 |
| is_slideshow | 是否图文轮播（不是视频）。 |
| has_shop_product | 视频是否挂了 TikTok Shop 商品；没有这个键表示无法判定。 |
| author_id | 作者在原平台的唯一 ID。 |
| author_url | 作者在原平台的主页链接。 |
| author_avatar_url | 作者头像图片链接（多数平台带签名、会过期）。 |
| author_bio | platform-native meaning |
| author_is_verified | platform-native meaning |
| author_is_private | 作者是否私密账号。 |
| author_is_seller | 作者是否 TikTok Shop 卖家。 |
| author_follower_count | 作者粉丝数。null 表示不公开。 |
| author_following_count | platform-native meaning |
| author_like_count | platform-native meaning |
| author_video_count | platform-native meaning |
| 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_videos",
  "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_videos",
        "params": {
            "username": "nasa",
        },
    },
    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": "tiktok",
  "action": "user_videos",
  "results": [
    {
      "id": "•••",
      "url": "https://www.tiktok.com/@nasa/video/7665075736742530317",
      "text": "Something big just landed on TikTok.",
      "author_name": "NASA",
      "author_username": "nasa",
      "like_count": 92900,
      "comment_count": 2806,
      "share_count": 3098,
      "view_count": 1400000,
      "posted_at": "2026-07-21T20:09:02+00:00",
      "platform": "tiktok"
    },
    {
      "id": "•••",
      "url": "https://www.tiktok.com/@nasa/video/7689547576265149710",
      "text": "There's plenty happening across NASA as September comes to a close!\n \n🇺🇸 NASA’s Inspiration Tour heads to Arizona\n🧑‍🚀 Crew-13 prepares to launch on 10/1\n🔬 New discovery about life at the extremes\n✈️ Studying the future of air mobility\n \nHere's your NASA Minute!",
      "author_name": "NASA",
      "author_username": "nasa",
      "like_count": 2711,
      "comment_count": 129,
      "share_count": 48,
      "view_count": 33100,
      "posted_at": "2026-09-25T18:52:22+00:00",
      "platform": "tiktok"
    }
  ],
  "count": 10,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### `username` 能填完整的主页链接吗？

不能。只填用户短名，带不带 @ 都可以；完整主页链接和抖音的 secUid 都不行。手里只有关键词、还不知道是哪个账号时，先走关键词搜索，取结果里的 `author_username` 填到这里。

### 怎么只取热门的视频，或者只取某个时间之前的？

`sort` 取 `popular` 按热门排，`newest` 最新在前，`oldest` 最早在前。`min_likes` 填正整数，筛的是视频自己的点赞数，不是作者粉丝数或评论点赞。`until` 限定发布时间上界，说的是视频发布时间，不是数据采集时间。这三个参数只用于用户视频。

### 每条结果里的作者字段有什么用？

同一个账号的每一行都带作者信息：`author_follower_count` 为 null 表示不公开，`author_is_seller` 标出作者是不是 TikTok Shop 卖家，`author_is_private` 标出是不是私密账号。`is_pinned` 为真的行是作者在主页置顶的视频，统计发布节奏时先把它单独标出来。

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