# TikTok 用某音乐的视频 API (tiktok.sound_videos)

- Canonical page: https://everyinfra.com/tiktok-api/sound_videos
- Endpoint: POST /api/v1/social with {"platform": "tiktok", "action": "sound_videos", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed and empty results are not charged
- Returns: list, one page of up to 20 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

TikTok「用某音乐的视频」按 `music_id` 列出用了同一首音乐的公开视频，每条带文案、互动计数、发布时间、作者，以及视频里的 `music` 背景音乐信息和 `is_ad`、`is_sponsored`、`has_shop_product` 这类标记。它回答「这首歌被谁拿去做了视频、怎么用的」，适合评估一首歌的带动效果，或者找用这首歌发片的创作者。

翻页令牌 24 小时有效。和话题内容那一页比，这里需要翻页，也没有作者的粉丝数、关注数、点赞数、视频数和是否卖家这几项统计。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| music_id | not declared | yes | not declared | 音乐 ID（music_search / music_chart 行里的 id、视频行 music.id），或 https://www.tiktok.com/music/<名字>-<ID> 链接。 |
| page_token | not declared | no | not declared | 翻页令牌：把上一次响应里的 next_page_token 原样传回，拿下一页；不传从第一页开始。令牌 24 小时有效，每页算一次调用。每页最多 20 条，常见 12–13 条；短页不代表到底，没有 next_page_token 才是最后一页。 |

## 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 | 作者是否私密账号。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |
| next_page_token | platform-native meaning |

## 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": "sound_videos",
  "params": {
    "music_id": "7252896191606835201"
  }
}'
```

```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": "sound_videos",
        "params": {
            "music_id": "7252896191606835201",
        },
    },
    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": "sound_videos",
  "results": [
    {
      "id": …,
      "url": …,
      "text": …,
      "author_name": …,
      "author_username": …,
      "like_count": …,
      "comment_count": …,
      "share_count": …,
      "view_count": …,
      "posted_at": …,
      "collect_count": …,
      "repost_count": …,
      "duration_sec": …,
      "duration_seconds": …,
      "cover_image_url": …,
      "language": …,
      "country": …,
      "hashtags": …,
      "music": …,
      "is_ad": …,
      "is_pinned": …,
      "is_sponsored": …,
      "is_slideshow": …,
      "has_shop_product": …,
      "author_id": …,
      "author_url": …,
      "author_avatar_url": …,
      "author_bio": …,
      "author_is_verified": …,
      "author_is_private": …,
      "platform": …,
      "next_page_token": …
    }
  ],
  "next_page_token": …,
  "pagination": { … },
  "count": …,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### `music_id` 从哪里拿？

有三个来源：音乐搜索和音乐榜结果行里的 `id`，视频结果里 `music` 的 id，或者形如 https://www.tiktok.com/music/<名字>-<ID> 的音乐链接，直接粘贴链接也行。

### 为什么一页只有十几条？

每页最多 20 条，常见只有 12 到 13 条，这是正常的，不能拿条数判断有没有读完。读完的标志只有一个：响应里不再出现 `next_page_token`。每页算一次调用。

### 能用它统计一首歌被用了多少次吗？

不能当总数用。每页条数、排序和是否收全，都以返回为准。想知道一首歌一共被多少个视频用过，看音乐搜索和音乐榜里「用过这首音乐的视频数」；这一项适合抽样看具体的视频。

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