# 抖音 视频文稿 API (douyin.transcript)

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

抖音视频文稿按视频链接 `url` 把视频里说的话转成文字：`text` 是完整文稿，`segments` 是逐句时间轴，每句带起止秒数。同一次返回还带标题、发布时间、时长，点赞、评论、分享、收藏数，以及作者昵称、粉丝数和主页获赞总数。它回答「这条视频到底说了什么」，适合拆解爆款口播、核对达人怎么介绍产品，以及对语音内容做关键词和话题分析。

`url` 用 https://www.douyin.com/video/<视频 ID> 这样的视频页链接，主页和搜索页不行。文稿保持视频原来的语言，不做翻译；视频里没有可识别的语音时返回空结果，不扣费。`audio_url`、`video_url` 是会过期的签名链接，要留存请及时下载。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| url | not declared | yes | not declared | 目标抖音视频的完整链接，格式如 https://www.douyin.com/video/<视频ID>。video 读取该视频详情，comments 读取其评论，transcript 提取该视频的语音文稿；不要传用户主页或搜索页。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| url | 该记录在原平台上的可访问链接。 |
| title | 标题。平台无标题概念时（如纯文本帖）为 null。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| play_count | 仅热点宝视频榜单上是真实播放数。在 billboard_video_hot、billboard_low_fan_explosion、billboard_high_completion 上是抖音平台自己统计的播放数；其余能力上抖音不对外公开播放量，值多为 0，不代表真实播放，热度请看点赞、评论、分享数。 |
| like_count | 点赞数。null 表示该平台或该接口不公开此数据，不等于 0。 |
| comment_count | 评论数。null 表示不公开，不等于 0。 |
| share_count | 分享/转发数。null 表示不公开，不等于 0。 |
| collect_count | 收藏数。null 表示不公开，不等于 0。 |
| author_name | 作者昵称（显示名）。 |
| author_avatar | 作者头像。 |
| author_follower_count | 作者粉丝数。null 表示不公开。 |
| segments | 转写的逐句时间轴（transcript）：每句带 start、end（秒）和 text。 |
| video_url | 视频播放地址（带签名、会过期，要留存请及时下载）；图文笔记或来源没给时为 null。 |
| audio_url | 音频地址：transcript 是视频音轨（mp3），music_search、music_detail 是这段音乐的播放地址；可能会过期。 |
| duration_sec | 视频时长（秒）。 |
| duration_seconds | 时长，单位秒。非视频/音频内容为 null。 |
| recommend_count | 作品的推荐数（transcript）。 |
| author_like_count | 作者主页获赞总数（search / user_posts / video / transcript）。 |
| 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": "douyin",
  "action": "transcript",
  "params": {
    "url": "https://www.douyin.com/video/7664932486333451554"
  }
}'
```

```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": "transcript",
        "params": {
            "url": "https://www.douyin.com/video/7664932486333451554",
        },
    },
    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": "douyin",
  "action": "transcript",
  "results": {
    "id": …,
    "url": …,
    "title": …,
    "text": …,
    "posted_at": …,
    "play_count": …,
    "like_count": …,
    "comment_count": …,
    "share_count": …,
    "collect_count": …,
    "author_name": …,
    "author_avatar": …,
    "author_follower_count": …,
    "segments": …,
    "video_url": …,
    "audio_url": …,
    "duration_sec": …,
    "duration_seconds": …,
    "recommend_count": …,
    "author_like_count": …,
    "platform": …
  },
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### `text` 和 `segments` 有什么区别？

`text` 是整段文稿，一次给全，适合直接检索关键词或做摘要；`segments` 把同一段文稿拆成逐句，每句带开始、结束的秒数和句子文字，适合定位某句话出现在第几秒、截取片段或自己生成字幕。个别视频没有逐句时间轴时，以 `text` 为准。

### 一次能转写多条视频吗？

不能。每次调用只读一个视频 `url`、返回一份文稿，批量处理就逐条调用。抖音的视频详情和评论能力也接受同一个视频链接，可以在一轮循环里同时拿到每条视频的文稿、元数据和观众评论。

### 能用这份返回判断视频的热度吗？

可以参考互动数，但别用播放量。`like_count`、`comment_count`、`share_count`、`collect_count` 反映互动，null 表示不公开，不等于 0；`author_follower_count` 和 `author_like_count` 说明作者的体量。抖音不公开播放量，`play_count` 多为 0，不代表真实播放，排序时请排除。

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