{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok Top Ads Scraper",
    "description": "Extract top-performing ad creatives from TikTok Creative Center: CTR, likes, video URLs, landing pages, and competitive intelligence across 49 countries and 21 industries. No API key needed. Export to JSON, CSV, or Excel.",
    "version": "0.1",
    "x-build-id": "E5IqUMxD60rwamHu0"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rastriq~tiktok-top-ads-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rastriq-tiktok-top-ads-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/rastriq~tiktok-top-ads-scraper/runs": {
      "post": {
        "operationId": "runs-sync-rastriq-tiktok-top-ads-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/rastriq~tiktok-top-ads-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-rastriq-tiktok-top-ads-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": {
          "startUrls": {
            "title": "Top Ads URLs",
            "type": "array",
            "description": "Paste one or more TikTok Creative Center Top Ads URLs. The actor extracts country, period, sort order, and other filters from the URL automatically.<br><br>When provided, these take priority over the manual filter fields below.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "keyword": {
            "title": "Search keyword",
            "type": "string",
            "description": "Search for ads by keyword (brand name, product, etc.). Leave empty to browse top ads without keyword filter.<br><br>Examples: <code>adidas</code>, <code>shopify</code>, <code>skincare</code>"
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of ads to extract per URL (or per filter combination). The API returns pages of 20 items.",
            "default": 100
          },
          "scrapeDetails": {
            "title": "Scrape ad details",
            "type": "boolean",
            "description": "If enabled, fetches full details for each ad (landing page URL, comments, shares, keywords). Slower but provides richer data.",
            "default": false
          },
          "countryCode": {
            "title": "Country",
            "enum": [
              "ES",
              "US",
              "GB",
              "FR",
              "DE",
              "IT",
              "PT",
              "BR",
              "MX",
              "AR",
              "CO",
              "CL",
              "PE",
              "NL",
              "BE",
              "AT",
              "CH",
              "PL",
              "SE",
              "NO",
              "DK",
              "FI",
              "IE",
              "AU",
              "NZ",
              "CA",
              "JP",
              "KR",
              "TH",
              "VN",
              "ID",
              "MY",
              "PH",
              "SG",
              "TW",
              "SA",
              "AE",
              "EG",
              "ZA",
              "NG",
              "TR",
              "RO",
              "CZ",
              "HU",
              "GR",
              "IL",
              "UA",
              "RU",
              "IN"
            ],
            "type": "string",
            "description": "Country to filter top ads.",
            "default": "ES"
          },
          "period": {
            "title": "Time period",
            "enum": [
              "7",
              "30",
              "180"
            ],
            "type": "string",
            "description": "Time window for top ads.",
            "default": "30"
          },
          "industries": {
            "title": "Industries",
            "uniqueItems": true,
            "type": "array",
            "description": "Filter by industry. Leave empty to include all industries.",
            "items": {
              "type": "string",
              "enum": [
                "10000000000",
                "11000000000",
                "12000000000",
                "13000000000",
                "14000000000",
                "15000000000",
                "16000000000",
                "17000000000",
                "18000000000",
                "19000000000",
                "20000000000",
                "21000000000",
                "22000000000",
                "23000000000",
                "24000000000",
                "25000000000",
                "26000000000",
                "27000000000",
                "28000000000",
                "29000000000",
                "30000000000"
              ],
              "enumTitles": [
                "App & Game",
                "Vehicles & Transportation",
                "Finance & Insurance",
                "Online Service",
                "E-commerce Platform",
                "Education & Training",
                "Food & Drink",
                "Government & Politics",
                "Home Improvement",
                "Lifestyle Service",
                "News & Entertainment",
                "Pets",
                "Clothing & Accessories",
                "Home Appliances",
                "Sports & Outdoor",
                "Tech & Electronics",
                "Travel",
                "Health & Wellness",
                "Mother, Kids & Baby",
                "Beauty & Personal Care",
                "Business Service"
              ]
            },
            "default": []
          },
          "orderBy": {
            "title": "Sort by",
            "enum": [
              "for_you",
              "ctr",
              "like",
              "impression",
              "play_2s_rate",
              "play_6s_rate",
              "cvr"
            ],
            "type": "string",
            "description": "How to sort the results.",
            "default": "for_you"
          },
          "objective": {
            "title": "Ad objective",
            "uniqueItems": true,
            "type": "array",
            "description": "Filter by ad objective. Leave empty for all objectives.",
            "items": {
              "type": "string",
              "enum": [
                "1",
                "2",
                "3",
                "4",
                "5",
                "8",
                "15"
              ],
              "enumTitles": [
                "Traffic",
                "App Installs",
                "Conversions",
                "Video Views",
                "Reach",
                "Lead Generation",
                "Product Sales"
              ]
            },
            "default": []
          },
          "adLanguage": {
            "title": "Ad language",
            "uniqueItems": true,
            "type": "array",
            "description": "Filter ads by language. Leave empty for all languages.",
            "items": {
              "type": "string",
              "enum": [
                "en",
                "es",
                "ar",
                "vi",
                "th",
                "de",
                "id",
                "pt",
                "fr",
                "ms",
                "nl",
                "ja",
                "it",
                "ro",
                "zh-Hant",
                "ko"
              ],
              "enumTitles": [
                "English",
                "Spanish",
                "Arabic",
                "Vietnamese",
                "Thai",
                "German",
                "Indonesian",
                "Portuguese",
                "French",
                "Malay",
                "Dutch",
                "Japanese",
                "Italian",
                "Romanian",
                "Chinese (Traditional)",
                "Korean"
              ]
            },
            "default": []
          },
          "adFormat": {
            "title": "Ad format",
            "enum": [
              "",
              "1",
              "2"
            ],
            "type": "string",
            "description": "Filter by ad format.",
            "default": ""
          },
          "minLikes": {
            "title": "Minimum likes",
            "enum": [
              "",
              "1",
              "2",
              "3",
              "4",
              "5"
            ],
            "type": "string",
            "description": "Filter by minimum likes tier.",
            "default": ""
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}