{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok Ads Scraper - Creative Center Top Ads & Ad Library",
    "description": "TikTok ads scraper for Creative Center Top Ads: video URLs, captions, industry, objective, CTR, likes & landing pages by country and period. Plus a Beta mode for the EU TikTok Ad Library (can be intermittently unavailable). No login. $2 / 1,000 ads.",
    "version": "0.1",
    "x-build-id": "7Txm7RUyWJPYQxL0N"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/adintel-labs~tiktok-ad-library-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-adintel-labs-tiktok-ad-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/adintel-labs~tiktok-ad-library-scraper/runs": {
      "post": {
        "operationId": "runs-sync-adintel-labs-tiktok-ad-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/adintel-labs~tiktok-ad-library-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-adintel-labs-tiktok-ad-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": {
          "source": {
            "title": "Data source",
            "enum": [
              "creativeCenterTopAds",
              "adLibrary"
            ],
            "type": "string",
            "description": "Primary (default): Creative Center Top Ads, production-verified. Ad Library (EU Commercial Content) is Beta / Experimental — TikTok's search endpoint intermittently returns HTTP 421 'system busy' even on EU residential IPs.",
            "default": "creativeCenterTopAds"
          },
          "keywords": {
            "title": "Keywords / advertiser names",
            "type": "array",
            "description": "Creative Center: keyword filter (leave empty for the overall top ads). Ad Library (Beta): advertiser names to search.",
            "items": {
              "type": "string"
            }
          },
          "country": {
            "title": "Country / region",
            "type": "string",
            "description": "Creative Center: country code (US, GB, DE, FR, JP, BR...). Ad Library (Beta): EU/EEA/UK/CH region code (FR, DE, GB...).",
            "default": "US"
          },
          "period": {
            "title": "Period (Creative Center)",
            "enum": [
              "7",
              "30",
              "180"
            ],
            "type": "string",
            "description": "Ranking window for Top Ads.",
            "default": "30"
          },
          "orderBy": {
            "title": "Sort by (Creative Center)",
            "enum": [
              "for_you",
              "like",
              "ctr",
              "impression"
            ],
            "type": "string",
            "description": "Sort order.",
            "default": "for_you"
          },
          "industryIds": {
            "title": "Industry IDs (Creative Center)",
            "type": "array",
            "description": "Optional Creative Center industry IDs (e.g. 22000000000 = Apparel & Accessories).",
            "items": {
              "type": "string"
            }
          },
          "objectiveIds": {
            "title": "Objective IDs (Creative Center)",
            "type": "array",
            "description": "1 Traffic, 2 App installs, 3 Conversions, 4 Video views, 5 Reach, 8 Lead generation, 14 Product sales.",
            "items": {
              "type": "string"
            }
          },
          "adLanguage": {
            "title": "Ad language (Creative Center)",
            "type": "string",
            "description": "e.g. en, es, de."
          },
          "dateFrom": {
            "title": "From date (Ad Library, Beta)",
            "type": "string",
            "description": "YYYY-MM-DD (default: 1 year ago)."
          },
          "dateTo": {
            "title": "To date (Ad Library, Beta)",
            "type": "string",
            "description": "YYYY-MM-DD (default: today)."
          },
          "maxResults": {
            "title": "Max ads per keyword",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum ads per keyword (or for the overall list).",
            "default": 50
          },
          "includeDetails": {
            "title": "Include ad details",
            "type": "boolean",
            "description": "Creative Center: landing page, all countries, comments & shares.",
            "default": true
          },
          "includeAiAnalysis": {
            "title": "AI ad-angle analysis (extra event)",
            "type": "boolean",
            "description": "Adds aiAnalysis (angle, hook, offer, audience, emotional triggers, funnel stage) to each ad. Charged per successfully analysed ad only.",
            "default": false
          },
          "llmApiKey": {
            "title": "LLM API key (optional)",
            "type": "string",
            "description": "OpenAI-compatible API key. Leave empty to use the Actor's built-in key (if configured)."
          },
          "llmModel": {
            "title": "LLM model",
            "type": "string",
            "description": "Model name for the OpenAI-compatible endpoint.",
            "default": "gpt-4o-mini"
          },
          "llmBaseUrl": {
            "title": "LLM base URL",
            "type": "string",
            "description": "OpenAI-compatible base URL (OpenAI, OpenRouter, Groq, xAI...).",
            "default": "https://api.openai.com/v1"
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Creative Center works from datacenter IPs. Ad Library mode is Beta / Experimental and geo-gated (HTTP 421 from outside the EU). TikTok's search endpoint also intermittently returns HTTP 421 'system busy' even on EU residential IPs. The Actor always pins RESIDENTIAL in the selected EU country (apifyProxyCountry) and matches the browser locale/timezone.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}