# Douyin On-screen video comments API (douyin.danmaku)

- Canonical page: [https://everyinfra.com/en/douyin-api/danmaku](https://everyinfra.com/en/douyin-api/danmaku?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "douyin", "action": "danmaku", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: list
- 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=douyin&action=danmaku

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| url | not declared | yes | not declared | The Douyin video whose danmaku you want: a numeric video ID, a `https://www.douyin.com/video/<video_id>` link, a `v.douyin.com` short link or a whole share text that contains a short link. |
| page_token | not declared | no | not declared | Page token for `danmaku`. Leave it out for the first page, then pass back the previous response's `next_page_token` exactly as received, keeping the other inputs unchanged. Tokens last 24 hours; the last page has no `next_page_token`. Each page is one stretch of up to 32 seconds of the video; to read the whole video, page until there is no `next_page_token`. |
| limit | integer (1–) | no | not declared | The most rows to return in this call, an integer of 1 or more. The default applies when you leave it out, and a call can return fewer rows. |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | The record's unique ID on the platform. Unique only within one platform; IDs can repeat across platforms. |
| text | Body text with HTML removed, returned in full and never cut short (on a few platforms the list results themselves carry only an excerpt; the platform's field notes say so). |
| video_id | ID of the video: on comments, the video the comment belongs to; on post_history, the video you asked about. |
| video_time | platform-native meaning |
| video_time_seconds | platform-native meaning |
| like_count | Likes. null means the platform or this capability does not disclose it; it is not 0. |
| author_uid | Numeric user ID of the author (on comments, of the commenter). author_id is the secUid; both identify the same person. |
| is_ad | Whether the post is an ad. |
| danmaku_count | platform-native meaning |
| platform | Source platform identifier, the same as platform in the request (for example 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": "douyin",
  "action": "danmaku",
  "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": "danmaku",
        "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-11-21T07:17:52Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed; the list keeps the first 2 of 824. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "douyin",
  "action": "danmaku",
  "results": [
    {
      "id": "•••",
      "text": "好厉害",
      "video_id": "7633646113853104116",
      "video_time": "00:00",
      "video_time_seconds": 0,
      "like_count": 0,
      "author_uid": "•••",
      "is_ad": false,
      "danmaku_count": 868,
      "platform": "douyin"
    },
    {
      "id": "•••",
      "text": "小学生想吃",
      "video_id": "7633646113853104116",
      "video_time": "00:00",
      "video_time_seconds": 0,
      "like_count": 0,
      "author_uid": "•••",
      "is_ad": false,
      "danmaku_count": 868,
      "platform": "douyin"
    }
  ],
  "next_page_token": …,
  "pagination": { … },
  "count": 824,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

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