{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok Ads Library Scraper: Top Ads & CTR, from $0.69/1K",
    "description": "$0.69/1K ads, no start fee. No login. TikTok's top-performing ads from the Creative Center Top Ads library by country, period, industry or brand keyword: CTR rank, likes, budget level, objective, video and cover links, landing page. Paste ad links too.",
    "version": "0.1",
    "x-build-id": "Rw1k4kzAwwjgbyV7o"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/laptime~tiktok-ads-library-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-laptime-tiktok-ads-library-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/laptime~tiktok-ads-library-scraper/runs": {
      "post": {
        "operationId": "runs-sync-laptime-tiktok-ads-library-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/laptime~tiktok-ads-library-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-laptime-tiktok-ads-library-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "Two-letter codes, one search per country. TikTok's Top Ads covers 28 markets: US, GB, CA, AU, DE, FR, IT, ES, NL, SE, RO, TR, AE, SA, ZA, MX, BR, AR, CO, JP, KR, ID, MY, PH, SG, TH, VN, PK. ALL = one search across all of them. Default: [\"US\"].",
            "items": {
              "type": "string",
              "enumSuggestedValues": [
                "ALL",
                "AR",
                "AU",
                "BR",
                "CA",
                "CO",
                "FR",
                "DE",
                "ID",
                "IT",
                "JP",
                "MY",
                "MX",
                "NL",
                "PK",
                "PH",
                "RO",
                "SA",
                "SG",
                "ZA",
                "KR",
                "ES",
                "SE",
                "TH",
                "TR",
                "AE",
                "GB",
                "US",
                "VN"
              ],
              "enumTitles": [
                "All countries",
                "Argentina",
                "Australia",
                "Brazil",
                "Canada",
                "Colombia",
                "France",
                "Germany",
                "Indonesia",
                "Italy",
                "Japan",
                "Malaysia",
                "Mexico",
                "Netherlands",
                "Pakistan",
                "Philippines",
                "Romania",
                "Saudi Arabia",
                "Singapore",
                "South Africa",
                "South Korea",
                "Spain",
                "Sweden",
                "Thailand",
                "Turkey",
                "United Arab Emirates",
                "United Kingdom",
                "United States",
                "Vietnam"
              ]
            },
            "default": [
              "US"
            ]
          },
          "period": {
            "title": "Period",
            "type": "string",
            "description": "Top ads of the last 7, 30 or 180 days. Default: 30 days.",
            "default": "30"
          },
          "sortBy": {
            "title": "Sort by",
            "type": "string",
            "description": "for_you (default) = TikTok's own mix; like = most likes; ctr = best CTR; impression = most reach; cvr = best conversion rate; play_6s_rate or play_2s_rate = best 6- or 2-second view rate. With more than 20 ads wanted, the other orders are read too.",
            "default": "for_you"
          },
          "keywords": {
            "title": "Brand or product keywords",
            "type": "array",
            "description": "Optional. Each keyword is its own search in the Top Ads library of each country, as in the site's search box (e.g. \"shoes\", \"skincare\", \"Temu\"). Empty = the top ads of each country.",
            "items": {
              "type": "string"
            }
          },
          "industries": {
            "title": "Industries",
            "type": "array",
            "description": "Optional industry ids, one search per industry. Each id is two digits plus nine zeros (14000000000 = Beauty & Personal Care): 10 Education, 11 Vehicles, 12 Baby & Kids, 13 Finance, 14 Beauty, 15 Tech & Electronics, 16 Appliances, 17 Travel, 18 Household, 19 Pets, 20 Apps, 21 Home Improvement, 22 Apparel, 23 News & Entertainment, 24 Business Services, 25 Games, 26 Life Services, 27 Food & Beverage, 28 Sports & Outdoor, 29 Health, 30 E-commerce. Empty = all.",
            "items": {
              "type": "string",
              "enumSuggestedValues": [
                "22000000000",
                "16000000000",
                "20000000000",
                "12000000000",
                "14000000000",
                "24000000000",
                "30000000000",
                "10000000000",
                "13000000000",
                "27000000000",
                "25000000000",
                "29000000000",
                "21000000000",
                "18000000000",
                "26000000000",
                "23000000000",
                "19000000000",
                "28000000000",
                "15000000000",
                "17000000000",
                "11000000000"
              ],
              "enumTitles": [
                "Apparel & Accessories",
                "Appliances",
                "Apps",
                "Baby, Kids & Maternity",
                "Beauty & Personal Care",
                "Business Services",
                "E-Commerce (Non-app)",
                "Education",
                "Financial Services",
                "Food & Beverage",
                "Games",
                "Health",
                "Home Improvement",
                "Household Products",
                "Life Services",
                "News & Entertainment",
                "Pets",
                "Sports & Outdoor",
                "Tech & Electronics",
                "Travel",
                "Vehicle & Transportation"
              ]
            }
          },
          "adUrls": {
            "title": "Ad links or IDs",
            "type": "array",
            "description": "A separate list, not a filter: Creative Center ad links (ads.tiktok.com/business/creativecenter/topads/<id>/...) or ad IDs. Each gives one row with its landing page, countries, comments and shares. Without other filters, no country search runs.",
            "items": {
              "type": "string"
            }
          },
          "objectives": {
            "title": "Campaign objectives",
            "type": "array",
            "description": "Keep only ads with these campaign objectives: campaign_objective_traffic, campaign_objective_app_install, campaign_objective_conversion, campaign_objective_video_view, campaign_objective_reach, campaign_objective_lead_generation, campaign_objective_product_sales, campaign_objective_app_promotion. Ads left out are not charged. Empty = every objective.",
            "items": {
              "type": "string",
              "enumSuggestedValues": [
                "campaign_objective_traffic",
                "campaign_objective_app_install",
                "campaign_objective_conversion",
                "campaign_objective_video_view",
                "campaign_objective_reach",
                "campaign_objective_lead_generation",
                "campaign_objective_product_sales",
                "campaign_objective_app_promotion"
              ],
              "enumTitles": [
                "Traffic",
                "App Installs",
                "Conversions",
                "Video Views",
                "Reach",
                "Lead Generation",
                "Product Sales",
                "App Promotion"
              ]
            }
          },
          "minLikes": {
            "title": "Minimum likes",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only ads with at least this many likes. Ads left out are not charged. Empty = no minimum."
          },
          "maxItems": {
            "title": "Max ads (whole run)",
            "minimum": 1,
            "type": "integer",
            "description": "Hard cap on ads delivered (and charged) by the whole run. TikTok shows a logged-out visitor 20 top ads per search, so above 20 the Actor also reads the other sort orders and industries. Default: 20.",
            "default": 20
          },
          "includeDetails": {
            "title": "Include ad details",
            "type": "boolean",
            "description": "Opens each ad's page for the landing page link and domain, every country the ad ran in, comments, shares and the 720p video. Charged as ad-details per ad where found. Off by default.",
            "default": false
          },
          "onlyNew": {
            "title": "Only new ads (monitoring)",
            "type": "boolean",
            "description": "Skip ads this monitor delivered in earlier runs, so a scheduled run returns only new top ads. A run with nothing new costs nothing.",
            "default": false
          },
          "monitorName": {
            "title": "Monitor name",
            "type": "string",
            "description": "Names the \"Only new ads\" memory. Runs with the same name share it. Empty = one memory per task or input."
          },
          "aiAnalysis": {
            "title": "AI creative analysis",
            "type": "boolean",
            "description": "Adds per ad: ad category, offer type, hook, hook type, persuasion angle, offer, target audience, funnel stage, tone, product category, language and a one-line summary (aiStatus \"ok\"), from the ad text. Charged as ai-creative-analysis per analysed ad; ads without text are skipped and not charged. Off by default.",
            "default": false
          },
          "aiCustomLabels": {
            "title": "Custom AI questions",
            "type": "array",
            "description": "Your own questions per ad, as \"name: question\" (e.g. \"hasDiscount: yes/no: the ad mentions a discount\"). Starting with yes/no gives true/false. Answers land in aiLabels. Up to 10.",
            "items": {
              "type": "string"
            }
          },
          "aiContext": {
            "title": "AI context",
            "type": "string",
            "description": "Optional context for the AI, e.g. \"We sell skincare; label competitor ads by angle\". Up to 500 characters."
          },
          "aiApiKey": {
            "title": "Your own LLM API key (optional)",
            "type": "string",
            "description": "Optional: an OpenRouter (sk-or-), OpenAI, Anthropic (sk-ant-) or Gemini (AIza) key. With your own key AI analysis is not charged by us. Empty = our hosted model."
          },
          "aiModel": {
            "title": "AI model (with your own key)",
            "type": "string",
            "description": "Model name for your own key, e.g. gpt-4.1-mini. Empty = a sensible default for the key."
          },
          "telemetry": {
            "title": "Anonymous error reports",
            "type": "boolean",
            "description": "Sends the Actor's author an anonymous report when a run hits an error (error type, failing step, HTTP status, counts). Never your input, results, URLs or account. Untick to turn it off.",
            "default": true
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}