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

# Top Ad Insights Detail

> Retrieve detailed insights for a specific top-performing TikTok ad, including creative analysis and performance metrics.

<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">per request</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">🤖 Why Code When AI Can Do It For You?</p>
    <p className="mt-1 text-sm text-gray-700 dark:text-gray-300">Stop writing code like it's 1970! Let AI do the heavy lifting - click the sparkles to copy a perfectly formatted prompt for ChatGPT, Claude, or your favorite AI assistant.</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(`I want to make an API call to https://api.keyapi.ai/v1/tiktok/insights/ad/detail.

Please help me write code to make this API call and handle the response appropriately. Include error handling and best practices.

Here are the details:

Endpoint: GET https://api.keyapi.ai/v1/tiktok/insights/ads/detail

Description: Retrieve detailed insights for a specific top-performing TikTok ad, including creative analysis and performance metrics.

Required Headers:
--header 'Authorization: Bearer <YOUR_API_KEY>'

Parameters:
- material_id (Optional): Advertising Material ID. Example: 7599659133885874193

Example Response:
{
"code": 0,
"message": "success",
"data": {
"ad_title": "Como funciona a nova linha Elseve Colágeno Lifter de @L'Oréal Paris Brasil ?? Eu fiquei encantada com o resultado no meu cabelo, quanto ela encorpou minhas pontas e quis entender mais a fundo como ela age! ✨ #Publicidade, #ElseveHairCare, #ElseveColageno #LorealParis",
"brand_name": "",
"comment": 51,
"cost": 2,
"country_code": [
  "BR"
],
"ctr": 0.32,
"favorite": false,
"has_summary": false,
"highlight_text": "",
"id": "7599659133885874193",
"industry_key": "label_14101000000",
"is_search": false,
"keyword_list": null,
"landing_page": "https://www.loreal-paris.com.br/cuidados-com-o-cabelo/elseve/collagen-lifter?utm_source=tiktok&utm_medium=social_video_paid&utm_content=oap_haca_elseve-collagen-lifter_video_aw&utm_campaign=oap_haca_elseve-collagen-lifter_nam_ifcom&utm_term=bc-protocolo-da-pele&utm_id=__CAMPAIGN_ID__",
"like": 12704,
"objective_key": "campaign_objective_video_view",
"objectives": [
  {
    "label": "campaign_objective_video_view",
    "value": 4
  }
],
"pattern_label": [],
"share": 96,
"source": "Others",
"source_key": 73,
"video_info": {
  "vid": "v14044g50000d5n96qfog65maoi77nk0",
  "duration": 69.52,
  "cover": "https://p16-sign-sg.tiktokcdn.com/tos-alisg-p-0037/oIbAQBEp4tDfRGgvNrhnF5uBfsUNlpQEkjQpEo~tplv-noop.image?dr=18692&refresh_token=6e934a69&x-expires=1770134827&x-sig
... (truncated)`)}
    >
      <span>✨</span>
      <span>Copy for AI</span>
    </button>
  </div>
</div>


## OpenAPI

````yaml en/tiktok.openapi.json GET /v1/tiktok/insights/ads/detail
openapi: 3.0.1
info:
  title: Tiktok API english documentation
  description: >-
    The english reference documentation of the Tiktok API includes the
    interface's purpose, parameter description, response status, and sample
    structure.
  version: 1.0.0
servers:
  - url: https://api.keyapi.ai
    description: Production
security: []
tags:
  - name: TikTok Influencer
  - name: TikTok Shop
  - name: TikTok Content
  - name: TikTok Intelligence
paths:
  /v1/tiktok/insights/ads/detail:
    get:
      tags:
        - TikTok Intelligence
      summary: Top Ad Insights Detail
      description: >-
        Retrieve detailed insights for a specific top-performing TikTok ad,
        including creative analysis and performance metrics.
      operationId: get_api_v3_realtime_insights_top_ads_detail
      parameters:
        - name: material_id
          in: query
          description: Advertising Material ID
          required: false
          schema:
            type: string
            example: '7599659133885874193'
            default: '7599659133885874193'
          example: '7599659133885874193'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties: {}
                example:
                  code: 0
                  message: success
                  data:
                    ad_title: >-
                      Como funciona a nova linha Elseve Colágeno Lifter de
                      @L'Oréal Paris Brasil ?? Eu fiquei encantada com o
                      resultado no meu cabelo, quanto ela encorpou minhas pontas
                      e quis entender mais a fundo como ela age! ✨ #Publicidade,
                      #ElseveHairCare, #ElseveColageno #LorealParis
                    brand_name: ''
                    comment: 51
                    cost: 2
                    country_code:
                      - BR
                    ctr: 0.32
                    favorite: false
                    has_summary: false
                    highlight_text: ''
                    id: '7599659133885874193'
                    industry_key: label_14101000000
                    is_search: false
                    keyword_list: null
                    landing_page: >-
                      https://www.loreal-paris.com.br/cuidados-com-o-cabelo/elseve/collagen-lifter?utm_source=tiktok&utm_medium=social_video_paid&utm_content=oap_haca_elseve-collagen-lifter_video_aw&utm_campaign=oap_haca_elseve-collagen-lifter_nam_ifcom&utm_term=bc-protocolo-da-pele&utm_id=__CAMPAIGN_ID__
                    like: 12704
                    objective_key: campaign_objective_video_view
                    objectives:
                      - label: campaign_objective_video_view
                        value: 4
                    pattern_label: []
                    share: 96
                    source: Others
                    source_key: 73
                    video_info:
                      vid: v14044g50000d5n96qfog65maoi77nk0
                      duration: 69.52
                      cover: >-
                        https://p16-sign-sg.tiktokcdn.com/tos-alisg-p-0037/oIbAQBEp4tDfRGgvNrhnF5uBfsUNlpQEkjQpEo~tplv-noop.image?dr=18692&refresh_token=6e934a69&x-expires=1770134827&x-signature=0L2KwLankwcC65PCIuiFk2XfXJY%3D&t=9276707c&ps=14f1eb3e&shp=9e36835a&shcp=317596d8&idc=my&VideoID=v14044g50000d5n96qfog65maoi77nk0
                      video_url:
                        720p: >-
                          https://v16m-default.tiktokcdn.com/b1a2a709977192920eea44b7c8c4b7fc/69821d2b/video/tos/alisg/tos-alisg-pve-0037c001/osDAxm0Eui3BYARkw0q50fiEiCAIhQt2lozVJI/?a=0&bti=NTU4QDM1NGA%3D&ch=0&cr=0&dr=0&lr=tiktok_business&cd=0%7C0%7C0%7C0&cv=1&br=2302&bt=1151&cs=0&ds=3&ft=cApXJCz7ThWH1Po.1GZmo0P&mime_type=video_mp4&qs=0&rc=OjppOzpkOzk1Z2Y8N2hlO0BpM3E6cnA5cnQ8ODMzODczNEAzNDMxXjNhXzQxNWMuX2AyYSNoNGZeMmRjM2thLS1kMTFzcw%3D%3D&vvpl=1&l=2026020318055856A5DED5454BBCD13158&btag=e00090000
                      width: 576
                      height: 1024
                    voice_over: false
                  requestId: 18f4667e-2f44-4095-840f-f88d9f175c5a
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 400
                  data: null
                  message: 'Missing required parameter: handle'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 401
                  data: null
                  message: apiKey is null
        '402':
          description: Payment Required
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 402
                  data: null
                  message: apiKey quota is not enough
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 429
                  data: null
                  message: qps limit exceeded
        '500':
          description: Internal Server Error
          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/detail?material_id=7599659133885874193' \
              --header 'Authorization: Bearer <YOUR_API_KEY>'
        - lang: python
          label: Python
          source: |-
            import requests

            response = requests.get(
                'https://api.keyapi.ai/v1/tiktok/insights/ads/detail',
                params={"material_id": "7599659133885874193"},
                headers={'Authorization': 'Bearer <YOUR_API_KEY>'}
            )
            print(response.json())
        - lang: javascript
          label: JavaScript
          source: >-
            const params = new URLSearchParams({"material_id":
            "7599659133885874193"});


            const response = await
            fetch(`https://api.keyapi.ai/v1/tiktok/insights/ads/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: |-
        API key for authentication. Format: `sk_live_xxxxxxxxxxxxx`
        Get your API key from the [Dashboard](http://keyapi.ai/app/dashboard).

````