> ## 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/insights/ads\n\n请帮我编写调用代码，并包含必要的错误处理、参数校验和响应处理逻辑。\n\n接口信息：\n\nEndpoint: GET https://api.keyapi.ai/v1/tiktok/insights/ads\n\nDescription: TikTok 的「广告洞察」接口用于评估表现、趋势、排名和业务机会，返回统计字段、明细列表和分页信息。适用于达人发现、内容分析、趋势跟踪和增长研究。可结合接口参数进行筛选或分页查询。\n\nRequired Headers:\n--header 'Authorization: Bearer <YOUR_API_KEY>'\n\nParameters:\n- search_keyword (Optional): 搜索关键词. Example: FALSE\n- order_by (Optional): order_by 参数. Example: for_you\n- page (Optional): 页码. Example: 1\n- limit (Optional): 返回数量上限. Example: 20\n- period (Optional): period 参数. Example: 7\n- region (Optional): 地区或国家代码，例如 US、GB、DE. Example: nothing\n- industry (Optional): industry 参数. Example: nothing\n- objective (Optional): objective 参数. Example: nothing\n- ad_language (Optional): ad_language 参数. Example: nothing\n- ad_format (Optional): ad_format 参数. Example: nothing\n- like (Optional): like 参数. Example: nothing\n\nExample Response:\n{\n  \"code\": 0,\n  \"message\": \"success\",\n  \"data\": {\n    \"materials\": [\n      {\n        \"ad_title\": \"หมดเก่งมาก\",\n        \"brand_name\": \"\",\n        \"cost\": 2,\n        \"ctr\": 0.89,\n        \"favorite\": false,\n        \"id\": \"7599496668887564304\",\n        \"industry_key\": \"label_23132000000\",\n        \"is_search\": true,\n        \"like\": 58400,\n        \"objective_key\": \"campaign_objective_video_view\",\n        \"tag\": 2,\n        \"video_info\": {\n          \"vid\": \"v29044g50000d4sn397og65m159dbpqg\",\n          \"duration\": 33.8,\n          \"cover\": \"https://p16-sign-sg.tiktokcdn.com/tos-alisg-p-0037/oMaUBL5lEVpCYT7IcAPQ5cCd1ixAZiEBs2aIV~tplv-noop.image?dr=18692&refresh_token=754132a5&x-expires=1770134518&x-signature=Y2HoCVgbuaqkcxIQShxr1oNUYUM%3D&t=9276707c&ps=14f1eb3e&shp=9e36835a&shcp=317596d8&idc=my&VideoID=v29044g50000d4sn397og65m159dbpqg\",\n          \"video_url\": {\n            \"720p\": \"https://v16m-default.tiktokcdn.com/437306c551d75065fac84cd69e613e83/69821bf6/video/tos/alisg/tos-alisg-pve-0037c001/oQGT2QpiVYDaaBLEdVQ1l56FIQ7C5EExABPic/?a=0&bti=NTU4QDM1NGA%3D&ch=0&cr=0&dr=0&lr=tiktok_business&cd=0%7C0%7C0%7C0&cv=1&br=2456&bt=1228&cs=0&ds=3&ft=cApXJCz7ThWHEWo.1GZmo0P&mime_type=video_mp4&qs=0&rc=PDhoOTYzMzw6Zjk0NzhoZUBpanNnOHA5cjxxNzMzODczNUBeXzAwMDA2X2AxMi0wYGM1YSNuXzYuMmQ0MHBhLS1kMTZzcw%3D%3D&vvpl=1&l=202602031801244A1B2C464168A5C8DBB2&btag=e00088000\"\n          },\n          \"width\": 576,\n          \"height\": 1024\n        }\n      }\n    ],\n    \"pagination\": {\n      \"has_more\": true,\n      \"page\": 1,\n      \"size\": 1,\n      \"total_count\": 400\n    }\n  },\n  \"requestId\": \"9aa4d8b1-8ae8-4f6b-9c4c-3756f02bb020\"\n}\n\n请根据以上信息给出可直接运行的示例代码。")}>
      ✨ 复制给 AI
    </button>
  </div>
</div>


## OpenAPI

````yaml zh/tiktok.zh.openapi.json GET /v1/tiktok/insights/ads
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/insights/ads:
    get:
      tags:
        - TikTok 趋势洞察
      summary: 广告洞察
      description: 获取高表现 TikTok 广告洞察，包括广告创意类型、互动率和行业分布。
      operationId: get_api_v3_realtime_insights_top_ads_list
      parameters:
        - name: search_keyword
          in: query
          description: 搜索关键词；传 FALSE 字符串表示不搜索，传非空字符串时按关键词搜索。
          required: false
          schema:
            type: string
            example: 'FALSE'
            default: 'FALSE'
          example: 'FALSE'
        - name: order_by
          in: query
          description: >-
            排序或指标类型，选择一个值：Recommendation=for_you，Exposure=impression，Click-through
            rate=ctr，2-second completion rate=play_2s_rate，6-second completion
            rate=play_6s_rate，CVR=cvr，Number of likes=like。
          required: false
          schema:
            type: string
            example: for_you
            default: for_you
          example: for_you
        - name: page
          in: query
          description: 分页页码，用于指定查询结果的目标页。
          required: false
          schema:
            type: string
            example: '1'
            default: '1'
          example: '1'
        - name: limit
          in: query
          description: 每页返回数量，取值范围 1 到 20；超过最大值时会按 20 处理。
          required: false
          schema:
            type: string
            example: '20'
            default: '20'
          example: '20'
        - 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: 国家/地区代码，例如 US。
          required: false
          schema:
            type: string
            example: nothing
            default: nothing
          example: nothing
        - name: industry
          in: query
          description: 行业 ID，可从热门趋势的行业分类映射中获取。
          required: false
          schema:
            type: string
            example: nothing
            default: nothing
          example: nothing
        - name: objective
          in: query
          description: >-
            投放目标，可选；默认值 nothing 表示不选择投放目标。Number of visits=1，App
            installations=2，Conversions=3，Video views=4，Reach=5，Lead
            generation=8，Product sales=14。
          required: false
          schema:
            type: string
            example: nothing
            default: nothing
          example: nothing
        - name: ad_language
          in: query
          description: >-
            广告语言，可选；默认值 nothing
            表示不选择广告语言。English=en，Spanish=es，Arabic=ar，Vietnamese=vi，Thai=th，German=de，Indonesian=id，Portuguese=pt，French=fr，Malay=ms，Dutch=n，Japanese=ja，Italian=it，Romanian=ro，Traditional
            Chinese=zh-Hant，Korean=ko。
          required: false
          schema:
            type: string
            example: nothing
            default: nothing
          example: nothing
        - name: ad_format
          in: query
          description: 广告样式，选择一个值；默认值 nothing 表示不筛选。Spark Ads=1，Non-Spark Ads=2。
          required: false
          schema:
            type: string
            example: nothing
            default: nothing
          example: nothing
        - name: like
          in: query
          description: >-
            点赞数分位筛选，可选；默认值 nothing 表示不筛选。Top 1-20%=1，Top 21-40%=2，Top
            41-60%=3，Top 61-80%=4，Top 81-100%=5。
          required: false
          schema:
            type: string
            example: nothing
            default: nothing
          example: nothing
      responses:
        '200':
          description: 请求成功
          content:
            application/json:
              schema:
                type: object
                properties: {}
                example:
                  code: 0
                  message: success
                  data:
                    materials:
                      - ad_title: หมดเก่งมาก
                        brand_name: ''
                        cost: 2
                        ctr: 0.89
                        favorite: false
                        id: '7599496668887564304'
                        industry_key: label_23132000000
                        is_search: true
                        like: 58400
                        objective_key: campaign_objective_video_view
                        tag: 2
                        video_info:
                          vid: v29044g50000d4sn397og65m159dbpqg
                          duration: 33.8
                          cover: >-
                            https://p16-sign-sg.tiktokcdn.com/tos-alisg-p-0037/oMaUBL5lEVpCYT7IcAPQ5cCd1ixAZiEBs2aIV~tplv-noop.image?dr=18692&refresh_token=754132a5&x-expires=1770134518&x-signature=Y2HoCVgbuaqkcxIQShxr1oNUYUM%3D&t=9276707c&ps=14f1eb3e&shp=9e36835a&shcp=317596d8&idc=my&VideoID=v29044g50000d4sn397og65m159dbpqg
                          video_url:
                            720p: >-
                              https://v16m-default.tiktokcdn.com/437306c551d75065fac84cd69e613e83/69821bf6/video/tos/alisg/tos-alisg-pve-0037c001/oQGT2QpiVYDaaBLEdVQ1l56FIQ7C5EExABPic/?a=0&bti=NTU4QDM1NGA%3D&ch=0&cr=0&dr=0&lr=tiktok_business&cd=0%7C0%7C0%7C0&cv=1&br=2456&bt=1228&cs=0&ds=3&ft=cApXJCz7ThWHEWo.1GZmo0P&mime_type=video_mp4&qs=0&rc=PDhoOTYzMzw6Zjk0NzhoZUBpanNnOHA5cjxxNzMzODczNUBeXzAwMDA2X2AxMi0wYGM1YSNuXzYuMmQ0MHBhLS1kMTZzcw%3D%3D&vvpl=1&l=202602031801244A1B2C464168A5C8DBB2&btag=e00088000
                          width: 576
                          height: 1024
                    pagination:
                      has_more: true
                      page: 1
                      size: 1
                      total_count: 400
                  requestId: 9aa4d8b1-8ae8-4f6b-9c4c-3756f02bb020
        '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/insights/ads?search_keyword=FALSE&order_by=for_you&page=1&limit=20&period=7&region=nothing&industry=nothing&objective=nothing&ad_language=nothing&ad_format=nothing&like=nothing' \
              --header 'Authorization: Bearer <YOUR_API_KEY>'
        - lang: python
          label: Python
          source: |-
            import requests

            response = requests.get(
                'https://api.keyapi.ai/v1/tiktok/insights/ads',
                params={"search_keyword": "FALSE", "order_by": "for_you", "page": "1", "limit": "20", "period": "7", "region": "nothing", "industry": "nothing", "objective": "nothing", "ad_language": "nothing", "ad_format": "nothing", "like": "nothing"},
                headers={'Authorization': 'Bearer <YOUR_API_KEY>'}
            )
            print(response.json())
        - lang: javascript
          label: JavaScript
          source: >-
            const params = new URLSearchParams({"search_keyword": "FALSE",
            "order_by": "for_you", "page": "1", "limit": "20", "period": "7",
            "region": "nothing", "industry": "nothing", "objective": "nothing",
            "ad_language": "nothing", "ad_format": "nothing", "like":
            "nothing"});


            const response = await
            fetch(`https://api.keyapi.ai/v1/tiktok/insights/ads?${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。

````