# TikTok 音乐详情 API (tiktok.music_detail)

- Canonical page: [https://everyinfra.com/tiktok-api/music_detail](https://everyinfra.com/tiktok-api/music_detail?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "tiktok", "action": "music_detail", "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

## Health

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

## 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> 链接。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| url | 该记录在原平台上的可访问链接。 |
| title | 标题。平台无标题概念时（如纯文本帖）为 null。 |
| author_name | 评价人名字（shop_product_reviews），平台已打码，如 n**h。 |
| author_username | 作者用户名（@handle），通常可用于拼 URL。 |
| author_id | 作者在原平台的唯一 ID。 |
| author_sec_uid | 音乐作者账号的 secUid（music_detail）；原声才有。 |
| album | 专辑名（music_search / music_chart）；原声、没登记专辑的没有这个字段。 |
| duration_seconds | 时长，单位秒。非视频/音频内容为 null。 |
| duration_sec | platform-native meaning |
| use_count | 用过这首音乐的视频数（music_search / music_chart）。 |
| is_original | platform-native meaning |
| is_commercial | 是否 TikTok 商用曲库里的音乐（music_search / music_chart）。 |
| is_copyrighted | 这段音乐是否受版权保护（music_detail）。 |
| is_private | 是否私密账号。 |
| cover_image_url | 视频封面图链接（带签名，会过期）。 |
| audio_url | 试听音频链接（music_search / music_chart），多为 60 秒片段，带签名、会过期。 |
| 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": "music_detail",
  "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": "music_detail",
        "params": {
            "music_id": "7252896191606835201",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-11-21T07:21:31Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "tiktok",
  "action": "music_detail",
  "results": {
    "id": "•••",
    "url": "https://www.tiktok.com/music/Enchanted-(Taylor's-Version)-7252896191606835201",
    "title": "Enchanted (Taylor's Version)",
    "author_name": "T•••t",
    "album": "Speak Now (Taylor's Version)",
    "duration_seconds": 60,
    "use_count": 439400,
    "is_original": false,
    "is_copyrighted": true,
    "cover_image_url": "https://p16-common.tiktokcdn-us.com/tos-alisg-v-2774/ooblA8sF6kVQIgDoS6ZeutinBeACpIZPVEQCAB~tplv-tiktokx-cropcenter:720:720.jpeg?dr=9584&t=4d5b0474&ps=933b5bde&shp=08d74b56&shcp=81f88b70&idc=useast5",
    "audio_url": "https://sf16.tiktokcdn-us.com/obj/tos-alisg-ve-2774/oQMfgHZ2yCAQeFFzvD7YinadqsaaALfRnJ4DEg",
    "platform": "tiktok",
    "duration_sec": 60
  },
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

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