> ## Documentation Index
> Fetch the complete documentation index at: https://docs.keyapi.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 热门音乐详情

> 获取热门 TikTok 音乐的详细数据，包括使用次数、关联视频示例和热度时间线。

<div className="inline-flex items-center gap-2 px-4 py-2 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg">
  <span className="text-base">🪙</span>
  <span className="text-sm font-medium text-yellow-900 dark:text-yellow-100"><span className="font-semibold">2 credits</span><span className="text-yellow-700 dark:text-yellow-300 ml-1">每次请求</span></span>
</div>

## Copy for AI

<div className="my-6 rounded-xl border border-gray-200 bg-gray-50 p-5 dark:border-gray-800 dark:bg-gray-900/40">
  <div className="min-w-0">
    <p className="text-base font-semibold text-gray-900 dark:text-gray-100">🤖 让 AI 帮你写调用代码</p>
    <p className="mt-1 text-sm text-gray-700 dark:text-gray-300">点击按钮复制一段结构化提示词，可直接交给 ChatGPT、Claude 或其他 AI 助手生成接口调用代码。</p>
  </div>

  <div className="mt-4">
    <button type="button" className="inline-flex items-center gap-2 rounded-md border border-emerald-300 bg-emerald-50 px-3 py-2 text-sm font-medium text-emerald-800 hover:bg-emerald-100 dark:border-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-100 dark:hover:bg-emerald-900/50" onClick={() => navigator.clipboard.writeText("我想调用 KeyAPI 接口：GET https://api.keyapi.ai/v1/tiktok/trending/music/detail\n\n请帮我编写调用代码，并包含必要的错误处理、参数校验和响应处理逻辑。\n\n接口信息：\n\nEndpoint: GET https://api.keyapi.ai/v1/tiktok/trending/music/detail\n\nDescription: TikTok 的「热门音乐详情」接口用于根据指定标识查询完整信息，返回基础资料、统计指标以及示例中的扩展字段。可结合接口参数进行筛选或分页查询。\n\nRequired Headers:\n--header 'Authorization: Bearer <YOUR_API_KEY>'\n\nParameters:\n- period (Optional): period 参数. Example: 7\n- region (Optional): 地区或国家代码，例如 US、GB、DE. Example: US\n- clip_id (Optional): clip_id 标识符. Example: 6703723351497508865\n\nExample Response:\n{\n  \"code\": 0,\n  \"message\": \"success\",\n  \"data\": {\n    \"disliked\": null,\n    \"like_count\": null,\n    \"liked\": null,\n    \"sound\": {\n      \"audience_ages\": null,\n      \"audience_countries\": [\n        {\n          \"country_info\": {\n            \"id\": \"458258\",\n            \"label\": \"LV\",\n            \"value\": \"Latvia\"\n          },\n          \"score\": 1426\n        },\n        {\n          \"country_info\": {\n            \"id\": \"3202326\",\n            \"label\": \"HR\",\n            \"value\": \"Croatia\"\n          },\n          \"score\": 1050\n        },\n        {\n          \"country_info\": {\n            \"id\": \"597427\",\n            \"label\": \"LT\",\n            \"value\": \"Lithuania\"\n          },\n          \"score\": 933\n        },\n        {\n          \"country_info\": {\n            \"id\": \"732800\",\n            \"label\": \"BG\",\n            \"value\": \"Bulgaria\"\n          },\n          \"score\": 792\n        },\n        {\n          \"country_info\": {\n            \"id\": \"2782113\",\n            \"label\": \"AT\",\n            \"value\": \"Austria\"\n          },\n          \"score\": 713\n        },\n        {\n          \"country_info\": {\n            \"id\": \"798549\",\n            \"label\": \"RO\",\n            \"value\": \"Romania\"\n          },\n          \"score\": 710\n        },\n        {\n          \"country_info\": {\n            \"id\": \"2264397\",\n            \"label\": \"PT\",\n            \"value\": \"Portugal\"\n          },\n          \"score\": 698\n        },\n        {\n          \"country_info\": {\n            \"id\": \"2510769\",\n            \"label\": \"ES\",\n            \"value\": \"Spain\"\n          },\n          \"score\": 638\n        },\n        {\n          \"country_info\": {\n            \"id\": \"2658434\",\n            \"label\": \"CH\",\n            \"value\": \"Switzerland\"\n          },\n          \"score\": 591\n        },\n        {\n          \"country_info\": {\n            \"id\": \"1821275\",\n            \"label\": \"MO\",\n            \"value\": \"Macao\"\n          },\n          \"score\": 572\n        }\n      ],\n      \"audience_interests\": [\n        {\n          \"interest_info\": {\n            \"id\": \"10004\",\n            \"label\": \"diversify_10004\",\n            \"value\": \"Scripted Drama\"\n          },\n          \"score\": 1186\n        },\n        {\n          \"interest_info\": {\n            \"id\": \"10011\",\n            \"label\": \"diversify_10011\",\n            \"value\": \"Other Talent\"\n          },\n          \"score\": 248\n        },\n        {\n          \"interest_info\": {\n            \"id\": \"10049\",\n            \"label\": \"diversify_10049\",\n            \"value\": \"Entertainment News\"\n          },\n          \"score\": 233\n        },\n        {\n          \"interest_info\": {\n            \"id\": \"10073\",\n            \"label\": \"diversify_10073\",\n            \"value\": \"Selfies\"\n          },\n          \"score\": 215\n        },\n        {\n          \"interest_info\": {\n            \"id\": \"10081\",\n            \"label\": \"diversify_10081\",\n            \"value\": \"Street Interviews & Social Experiments\"\n          },\n          \"score\": 196\n        }\n      ],\n      \"author\": \"Chihei Hatakeyama\",\n      \"clip_id\": \"6703723351497508865\",\n      \"country_code\": \"US\",\n      \"cover\": \"https://p16-sg.tiktokcdn.com/aweme/720x720/tos-alisg-v-2774/ocjWmiaBw4AAcY8ifAzsAAB5EQd8FDEDsu3Awo.jpeg\",\n      \"duration\": 60,\n      \"if_cml\": false,\n      \"is_search\": false,\n      \"link\": \"https://www.tiktok.com/music/x-6703723351497508865\",\n      \"longevity\": {\n        \"popular_days\": 0,\n        \"current_popularity\": 0\n      },\n      \"music_url\": null,\n      \"on_list_times\": null,\n      \"promoted\": false,\n      \"rank\": null,\n      \"rank_diff\": null,\n      \"related_items\": null,\n      \"song_id\": \"6703723270476138498\",\n      \"title\": \"New Sun\",\n      \"trend\": [\n        {\n          \"time\": 1769472000,\n          \"value\": 0.06\n        },\n        {\n          \"time\": 1769558400,\n          \"value\": 0.05\n        },\n        {\n          \"time\": 1769644800,\n          \"value\": 0.31\n        },\n        {\n          \"time\": 1769731200,\n          \"value\": 0.3\n        },\n        {\n          \"time\": 1769817600,\n          \"value\": 0.1\n        },\n        {\n          \"time\": 1769904000,\n          \"value\": 0.36\n        },\n        {\n          \"time\": 1769990400,\n          \"value\": 1\n        }\n      ],\n      \"url_title\": \"New-Sun\"\n    }\n  },\n  \"requestId\": \"10ddeaa7-1b62-43c1-918c-f0e164fdb631\"\n}\n\n请根据以上信息给出可直接运行的示例代码。")}>
      ✨ 复制给 AI
    </button>
  </div>
</div>


## OpenAPI

````yaml zh/tiktok.zh.openapi.json GET /v1/tiktok/trending/music/detail
openapi: 3.0.1
info:
  title: Tiktok API 中文文档
  description: Tiktok API 的中文参考文档，包含接口用途、参数说明、响应状态和示例结构。
  version: 1.0.0
servers:
  - url: https://api.keyapi.ai
    description: Production
security: []
tags:
  - name: TikTok Influencer
  - name: TikTok Shop Creator
  - name: TikTok Shop
  - name: TikTok Content
  - name: TikTok Intelligence
paths:
  /v1/tiktok/trending/music/detail:
    get:
      tags:
        - TikTok 趋势洞察
      summary: 热门音乐详情
      description: 获取热门 TikTok 音乐的详细数据，包括使用次数、关联视频示例和热度时间线。
      operationId: get_api_v3_realtime_trending_popular_music_detail
      parameters:
        - name: period
          in: query
          description: 查询时间范围，可选值：7=近 7 天，30=近 30 天，120=近 120 天。
          required: false
          schema:
            type: string
            example: '7'
            default: '7'
          example: '7'
        - name: region
          in: query
          description: 国家/地区代码。
          required: false
          schema:
            type: string
            example: US
            default: US
          example: US
        - name: clip_id
          in: query
          description: 取值来自音乐列表接口的响应数据。
          required: false
          schema:
            type: string
            example: '6703723351497508865'
            default: '6703723351497508865'
          example: '6703723351497508865'
      responses:
        '200':
          description: 请求成功
          content:
            application/json:
              schema:
                type: object
                properties: {}
                example:
                  code: 0
                  message: success
                  data:
                    disliked: null
                    like_count: null
                    liked: null
                    sound:
                      audience_ages: null
                      audience_countries:
                        - country_info:
                            id: '458258'
                            label: LV
                            value: Latvia
                          score: 1426
                        - country_info:
                            id: '3202326'
                            label: HR
                            value: Croatia
                          score: 1050
                        - country_info:
                            id: '597427'
                            label: LT
                            value: Lithuania
                          score: 933
                        - country_info:
                            id: '732800'
                            label: BG
                            value: Bulgaria
                          score: 792
                        - country_info:
                            id: '2782113'
                            label: AT
                            value: Austria
                          score: 713
                        - country_info:
                            id: '798549'
                            label: RO
                            value: Romania
                          score: 710
                        - country_info:
                            id: '2264397'
                            label: PT
                            value: Portugal
                          score: 698
                        - country_info:
                            id: '2510769'
                            label: ES
                            value: Spain
                          score: 638
                        - country_info:
                            id: '2658434'
                            label: CH
                            value: Switzerland
                          score: 591
                        - country_info:
                            id: '1821275'
                            label: MO
                            value: Macao
                          score: 572
                      audience_interests:
                        - interest_info:
                            id: '10004'
                            label: diversify_10004
                            value: Scripted Drama
                          score: 1186
                        - interest_info:
                            id: '10011'
                            label: diversify_10011
                            value: Other Talent
                          score: 248
                        - interest_info:
                            id: '10049'
                            label: diversify_10049
                            value: Entertainment News
                          score: 233
                        - interest_info:
                            id: '10073'
                            label: diversify_10073
                            value: Selfies
                          score: 215
                        - interest_info:
                            id: '10081'
                            label: diversify_10081
                            value: Street Interviews & Social Experiments
                          score: 196
                      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
                      longevity:
                        popular_days: 0
                        current_popularity: 0
                      music_url: null
                      on_list_times: null
                      promoted: false
                      rank: null
                      rank_diff: null
                      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: 10ddeaa7-1b62-43c1-918c-f0e164fdb631
        '400':
          description: 请求参数错误，请检查必填字段和参数格式
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 400
                  data: null
                  message: 'Missing required parameter: handle'
        '401':
          description: 鉴权失败，请检查 Authorization Header 中的 Bearer Token 或 API Key 是否有效
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 401
                  data: null
                  message: apiKey is null
        '402':
          description: 账户余额或额度不足
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 402
                  data: null
                  message: apiKey quota is not enough
        '429':
          description: 请求过于频繁，已触发限流
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 429
                  data: null
                  message: qps limit exceeded
        '500':
          description: 服务器内部错误，请稍后重试
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 500
                  data: null
                  message: Internal server error
      deprecated: false
      security:
        - JWT Bearer: []
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.keyapi.ai/v1/tiktok/trending/music/detail?period=7&region=US&clip_id=6703723351497508865' \
              --header 'Authorization: Bearer <YOUR_API_KEY>'
        - lang: python
          label: Python
          source: |-
            import requests

            response = requests.get(
                'https://api.keyapi.ai/v1/tiktok/trending/music/detail',
                params={"period": "7", "region": "US", "clip_id": "6703723351497508865"},
                headers={'Authorization': 'Bearer <YOUR_API_KEY>'}
            )
            print(response.json())
        - lang: javascript
          label: JavaScript
          source: >-
            const params = new URLSearchParams({"period": "7", "region": "US",
            "clip_id": "6703723351497508865"});


            const response = await
            fetch(`https://api.keyapi.ai/v1/tiktok/trending/music/detail?${params}`,
            {
              method: 'GET',
              headers: { 'Authorization': 'Bearer <YOUR_API_KEY>' }
            });

            const data = await response.json();

            console.log(data);
components:
  securitySchemes:
    JWT Bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |-
        接口鉴权凭证。请在请求 Header 中传入 `Authorization: Bearer <YOUR_API_KEY>`。
        可在 [Dashboard](https://keyapi.ai/app/dashboard) 获取你的 API Key。

````