# 抖音 评论 API (douyin.comments)

- Canonical page: https://everyinfra.com/douyin-api/comments
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "douyin", "action": "comments", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed calls and empty results are not charged
- Billing unit: every 20 rows you ask for count as one call; blocks that come back with no rows are not charged
- Returns: list, default 20, max 150 per call
- Pagination: pass next_page_token back as page_token for the next page, other params unchanged; each page is billed by its row count, one call per 20 rows, tokens last 24 hours
- Mode: sync; add "mode": "async" for slow tasks

抖音评论接口按视频 `url` 读取这条视频下的评论，每条带正文、点赞数、回复数、评论者昵称和 ID、IP 属地与发布时间。它回答「观众对这条视频怎么说」，适合做口碑与情感分析、收集产品反馈，或者找出互动最积极的观众。

不带 `page_token` 时只读头部一批评论（含部分回复）；要读全部一级评论，从 `page_token` 传空字符串开始逐页翻。`liked_by_author` 标出被视频作者点过赞的评论，`is_reply` 和 `reply_to_id` 能把回复还原到它所回复的评论下面。`ip_location` 是平台展示的属地，不是用户填写的地址。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| url | not declared | yes | not declared | 目标抖音视频的完整链接，格式如 https://www.douyin.com/video/<视频ID>。video 读取该视频详情，comments 读取其评论，transcript 提取该视频的语音文稿；不要传用户主页或搜索页。 |
| page_token | not declared | no | not declared | 翻页令牌（user_posts / comments）。从第一页开始翻：传空字符串 page_token=""；之后把上一页响应里的 next_page_token 原样传回取下一页，其余参数保持不变。令牌 24 小时内有效，只能在同一账户、同一组参数下使用，过期或参数变了返回 422，从第一页重新开始即可；翻到底时响应里没有 next_page_token（pagination.has_more 为 false）。user_posts 每页算一次调用，每页最多 100 条、最新优先，翻页时不按 since 过滤（需要时间窗请按 posted_at 自行过滤）。comments 每页最多 50 条顶层评论，按条数分档计费：每 20 条算一次，一页按 50 条算 3 次（传更小的 limit 按 limit 算），一条都没返回的档不扣费。不带 page_token 是单次调用：user_posts 取最新一批（可用 since）；comments 只读头部评论（含回复，同样每 20 条算一次），默认 20 条，limit 再大最多也只有约 50-60 条，一般没有 next_page_token。 |
| limit | integer (1–150) | no | 20 | 这次调用最多返回的条数，整数，1–150；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| next_page_token | 翻页令牌（search / user_posts / comments / comment_replies / billboard_video_hot / billboard_low_fan_explosion / billboard_high_completion / billboard_account_search / music_search / billboard_rise_list / billboard_topic_hot）：作为下一次请求的 page_token 原样传回取下一页（其余参数不变，24 小时内有效）；同一页每行的值相同，响应顶层也有同一个 next_page_token。没有该字段即到底。评论翻页逐页覆盖全部顶层评论。 |
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| like_count | 点赞数。null 表示该平台或该接口不公开此数据，不等于 0。 |
| reply_count | 回复数，通常用于评论的子回复。null 表示不公开。 |
| author_name | 作者昵称（显示名）。 |
| author_id | 作者在原平台的唯一 ID。 |
| ip_location | IP 属地（平台强制展示，非用户填写）。 |
| is_hot | 该评论是否带「热评」标记（comments）。 |
| is_reply | 是否为回复。 |
| reply_to_id | 被回复评论 ID：comments 的回复行上是它挂在哪条顶层评论下；comment_replies 每行都是请求的那条顶层评论。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| video_id | 评论所属视频 ID（comments）。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |
| liked_by_author | 评论是否被作者点赞。作者亲自点赞的评论互动价值高。 |
| author_avatar_url | 作者头像链接：search / user_posts / video 行上是博主的，comments 行上是评论者的。 |
| author_uid | 作者（评论里是评论者）的数字用户 ID；author_id 是 secUid，两者是同一个人的两种 ID。 |
| images | 图片链接数组，按平台展示顺序；没有图片时不出现这个字段。 |
| mentioned_users | 评论里 @ 到的人：user_id（secUid）、uid（数字 ID）、nickname；没有 @ 时没有这个键。 |

## 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": "douyin",
  "action": "comments",
  "params": {
    "url": "https://www.douyin.com/video/7633646113853104116"
  }
}'
```

```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": "douyin",
        "action": "comments",
        "params": {
            "url": "https://www.douyin.com/video/7633646113853104116",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

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

```text
{
  "id": "req_…",
  "platform": "douyin",
  "action": "comments",
  "results": [
    {
      "id": "•••",
      "text": "也夸夸我好吗？毕竟辛苦了大半天",
      "like_count": 36613,
      "reply_count": 3920,
      "author_name": "•••",
      "author_id": "•••",
      "ip_location": "•••",
      "liked_by_author": false,
      "is_reply": false,
      "posted_at": "2026-05-16T07:44:26+00:00",
      "author_avatar_url": "https://p3.douyinpic.com/•••",
      "author_uid": "•••",
      "video_id": "7633646113853104116",
      "images": [
        "https://p26-sign.douyinpic.com/tos-cn-i-p14lwwcsbr/0ca1d6122bc04436ae1ef616727fbdc4~tplv-p14lwwcsbr-7.image?lk3s=7b078dd2&x-expires=1792177200&x-signature=3jHJJizWcJ%2FOsppJ8hAkTk5coBQ%3D&from=2064092626&se=false&sc=image&biz_tag=aweme_comment&l=202610162149377E1F6EF12980549AC8D7"
      ],
      "platform": "douyin"
    },
    {
      "id": "•••",
      "text": "女人也可以做漂亮饭[抠鼻][抠鼻][抠鼻][抠鼻]",
      "like_count": 7668,
      "reply_count": 646,
      "author_name": "•••",
      "author_id": "•••",
      "ip_location": "•••",
      "liked_by_author": false,
      "is_reply": false,
      "posted_at": "2026-05-12T15:26:16+00:00",
      "author_avatar_url": "https://p3.douyinpic.com/•••",
      "author_uid": "•••",
      "video_id": "7633646113853104116",
      "images": [
        "https://p26-sign.douyinpic.com/tos-cn-i-p14lwwcsbr/f0e9dd3639b04e57b7d33803eaaeda1e~tplv-p14lwwcsbr-7.image?lk3s=7b078dd2&x-expires=1792177200&x-signature=q4h%2BPvenriDiq5zb5NDE%2Fva2qZo%3D&from=2064092626&se=false&sc=image&biz_tag=aweme_comment&l=202610162149377E1F6EF12980549AC8…"
      ],
      "platform": "douyin"
    }
  ],
  "next_page_token": …,
  "pagination": { … },
  "count": 48,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### 怎么读到一条视频的全部评论？

第一次把 `page_token` 传空字符串，之后把每页的 `next_page_token` 原样传回，其他参数不变；每页最多 50 条一级评论，没有 `next_page_token` 就是到底，令牌 24 小时内有效。评论按热度翻页，评论多的视频可能少两到三成。不带 `page_token` 的单次调用只给头部约 50–60 条（含回复），一般没有 `next_page_token`。

### 回复和一级评论怎么区分？

看 `is_reply`：为真表示这一行是回复，`reply_to_id` 是被回复评论的 ID。按这两个字段可以把结果整理成评论树，`reply_count` 则是每条评论下的回复数。

### 哪些评论最值得先看？

可以先看 `liked_by_author` 为真的评论，它们是视频作者亲自点赞的，互动价值通常较高；再按 `like_count` 从高到低，看观众最认同的观点。

## Also

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