# TikTok Music chart API (tiktok.music_chart)

- Canonical page: https://everyinfra.com/en/tiktok-api/music_chart
- Endpoint: POST /api/v1/social with {"platform": "tiktok", "action": "music_chart", "params": {...}}
- Price: $0.000806 per call ($0.81 per 1,000 requests); failed and empty results are not charged
- Returns: list, default 50, max 50 per call (larger values are capped)
- 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_chart

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| chart | enum: top50 / viral50 | no | not declared | Which music chart `music_chart` reads: `top50` (default) or `viral50`. |
| limit | integer (1–50) | no | 50 | The most rows to return in this call, an integer from 1 to 50. The default applies when you leave it out, and a call can return fewer rows. Larger values are accepted and capped at the maximum. |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| rank | platform-native meaning |
| id | The record's unique ID on the platform. Unique only within one platform; IDs can repeat across platforms. |
| url | Link to the record on the platform. |
| title | Title. null when the platform has no titles (for example text-only posts). |
| author_name | Author's display name. |
| album | platform-native meaning |
| language | Content language code (for example zh, en) as judged by the platform; it can be wrong. |
| duration_seconds | Duration in seconds. null for content that is not video or audio. |
| duration_sec | platform-native meaning |
| use_count | platform-native meaning |
| is_commercial | platform-native meaning |
| released_at | platform-native meaning |
| cover_image_url | platform-native meaning |
| audio_url | 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": "tiktok",
  "action": "music_chart",
  "params": {}
}'
```

```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_chart",
        "params": {},
    },
    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": "music_chart",
  "results": [
    {
      "rank": …,
      "id": …,
      "url": …,
      "title": …,
      "author_name": …,
      "album": …,
      "language": …,
      "duration_seconds": …,
      "duration_sec": …,
      "use_count": …,
      "is_commercial": …,
      "released_at": …,
      "cover_image_url": …,
      "audio_url": …,
      "platform": …
    }
  ],
  "count": …,
  "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
