跳转到主要内容
GET
/
v1
/
tiktok
/
trending
/
music
cURL
curl --request GET \
  --url 'https://api.keyapi.ai/v1/tiktok/trending/music?search_keyword=FALSE&page=1&limit=20&period=7&region=US&new_to_top_100=false&commercial_music=false' \
  --header 'Authorization: Bearer <YOUR_API_KEY>'
import requests

response = requests.get(
'https://api.keyapi.ai/v1/tiktok/trending/music',
params={"search_keyword": "FALSE", "page": "1", "limit": "20", "period": "7", "region": "US", "new_to_top_100": "false", "commercial_music": "false"},
headers={'Authorization': 'Bearer <YOUR_API_KEY>'}
)
print(response.json())
const params = new URLSearchParams({"search_keyword": "FALSE", "page": "1", "limit": "20", "period": "7", "region": "US", "new_to_top_100": "false", "commercial_music": "false"});

const response = await fetch(`https://api.keyapi.ai/v1/tiktok/trending/music?${params}`, {
method: 'GET',
headers: { 'Authorization': 'Bearer <YOUR_API_KEY>' }
});
const data = await response.json();
console.log(data);
{
  "code": 0,
  "message": "success",
  "data": {
    "pagination": {
      "page": 1,
      "size": 1,
      "total": 99,
      "has_more": true
    },
    "sound_list": [
      {
        "author": "Chihei Hatakeyama",
        "clip_id": "6703723351497508865",
        "country_code": "US",
        "cover": "https://p16-sg.tiktokcdn.com/aweme/720x720/tos-alisg-v-2774/ocjWmiaBw4AAcY8ifAzsAAB5EQd8FDEDsu3Awo.jpeg",
        "duration": 60,
        "if_cml": false,
        "is_search": false,
        "link": "https://www.tiktok.com/music/x-6703723351497508865",
        "on_list_times": null,
        "promoted": false,
        "rank": 1,
        "rank_diff": 0,
        "rank_diff_type": 2,
        "related_items": null,
        "song_id": "6703723270476138498",
        "title": "New Sun",
        "trend": [
          {
            "time": 1769472000,
            "value": 0.06
          },
          {
            "time": 1769558400,
            "value": 0.05
          },
          {
            "time": 1769644800,
            "value": 0.31
          },
          {
            "time": 1769731200,
            "value": 0.3
          },
          {
            "time": 1769817600,
            "value": 0.1
          },
          {
            "time": 1769904000,
            "value": 0.36
          },
          {
            "time": 1769990400,
            "value": 1
          }
        ],
        "url_title": "New-Sun"
      }
    ]
  },
  "requestId": "3b515c7d-e2ca-4b32-81dc-3a029504d1d3"
}
{
"code": 400,
"data": null,
"message": "Missing required parameter: handle"
}
{
"code": 401,
"data": null,
"message": "apiKey is null"
}
{
"code": 402,
"data": null,
"message": "apiKey quota is not enough"
}
{
"code": 429,
"data": null,
"message": "qps limit exceeded"
}
{
"code": 500,
"data": null,
"message": "Internal server error"
}
🪙2 credits每次请求

Copy for AI

🤖 让 AI 帮你写调用代码

点击按钮复制一段结构化提示词,可直接交给 ChatGPT、Claude 或其他 AI 助手生成接口调用代码。

授权

Authorization
string
header
必填

接口鉴权凭证。请在请求 Header 中传入 Authorization: Bearer <YOUR_API_KEY>。 可在 Dashboard 获取你的 API Key。

查询参数

search_keyword
string
默认值:FALSE

搜索关键词;传 FALSE 字符串表示不搜索,传非空字符串时按关键词搜索。

示例:

"FALSE"

page
string
默认值:1

分页页码,用于指定查询结果的目标页。

示例:

"1"

limit
string
默认值:20

每页返回数量,取值范围 1 到 20;超过最大值时会按 20 处理。

示例:

"20"

period
string
默认值:7

查询时间范围,可选值:7=近 7 天,30=近 30 天,120=近 120 天。

示例:

"7"

region
string
默认值:US

国家/地区代码;必须从指定国家/地区代码映射表中选择单个值,不支持多个值。

示例:

"US"

new_to_top_100
string
默认值:false

是否仅筛选首次进入 Top 100 的热门话题;false=不筛选,true=仅筛选首次进入 Top 100 的话题。

示例:

"false"

commercial_music
string
默认值:false

是否筛选可商用音乐;false=不筛选,true=仅筛选可商用音乐。

示例:

"false"

响应

请求成功

The response is of type object.