{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok Ads Library FAST",
    "description": "🔮 Unlock TikTok's ad intelligence with our powerful scraper. Extract competitor campaigns, creative assets and performance metrics. Search by keyword, advertiser name or ID across all regions. Get comprehensive ad data for market-leading insights.",
    "version": "4.2",
    "x-build-id": "XhH3E3RZNPhtFQqca"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/data_xplorer~tiktok-ads-library-fast/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-data_xplorer-tiktok-ads-library-fast",
        "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/data_xplorer~tiktok-ads-library-fast/runs": {
      "post": {
        "operationId": "runs-sync-data_xplorer-tiktok-ads-library-fast",
        "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/data_xplorer~tiktok-ads-library-fast/run-sync": {
      "post": {
        "operationId": "run-sync-data_xplorer-tiktok-ads-library-fast",
        "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",
        "required": [
          "region"
        ],
        "properties": {
          "region": {
            "title": "Region",
            "enum": [
              "all",
              "FR",
              "AT",
              "BE",
              "BG",
              "HR",
              "CY",
              "CZ",
              "DK",
              "EE",
              "FI",
              "DE",
              "GR",
              "HU",
              "IS",
              "IE",
              "IT",
              "LV",
              "LI",
              "LT",
              "LU",
              "MT",
              "NL",
              "NO",
              "PL",
              "PT",
              "RO",
              "SK",
              "SI",
              "ES",
              "SE",
              "CH",
              "TR",
              "GB"
            ],
            "type": "string",
            "description": "Region code for which you want to scrape ads",
            "default": "FR"
          },
          "startDate": {
            "title": "Start Date",
            "type": "string",
            "description": "Start date for ads (format: YYYY-MM-DD, e.g. 2025-01-01). TikTok's library only goes back one year — earlier dates are clamped automatically.",
            "default": "2025-01-01"
          },
          "endDate": {
            "title": "End Date",
            "type": "string",
            "description": "End date for ads (format: YYYY-MM-DD, e.g. 2025-03-01). Leave empty for current date.",
            "default": ""
          },
          "queryType": {
            "title": "Query Type",
            "enum": [
              "1",
              "2",
              "url"
            ],
            "type": "string",
            "description": "Type of search query",
            "default": "2"
          },
          "query": {
            "title": "Search Keyword, Advertiser Name or URL",
            "type": "string",
            "description": "For Keyword: enter a search term. For Advertiser Name: enter the exact advertiser name (e.g. LEVI STRAUSS & CO.). For URL: paste a full TikTok Ads Library URL. The scraper auto-detects URLs. Leave empty to search all ads.",
            "default": ""
          },
          "advertiserBizId": {
            "title": "Advertiser ID (optional, Advertiser mode only)",
            "type": "string",
            "description": "Optional advertiser business ID (numeric). Only used when Query Type is 'Advertiser Name'. You can find it in the TikTok Ads Library URL as 'adv_biz_ids' parameter (e.g. 6886458055832109825). Leave empty if unknown.",
            "default": ""
          },
          "adStatus": {
            "title": "Ad Status",
            "enum": [
              "1",
              "0",
              "2"
            ],
            "type": "string",
            "description": "Active ads only (TikTok's default), all ads shown during the date range, or only the ones that have stopped running.",
            "default": "1"
          },
          "adType": {
            "title": "Ad Type",
            "enum": [
              "0",
              "1",
              "2",
              "3"
            ],
            "type": "string",
            "description": "Only video, image or text ads.",
            "default": "0"
          },
          "ages": {
            "title": "Audience Age",
            "type": "array",
            "description": "Only ads shown to these age groups. Leave empty for all ages.",
            "items": {
              "type": "string",
              "enum": [
                "18,24",
                "25,34",
                "35,44",
                "45,54",
                "55,100"
              ],
              "enumTitles": [
                "18-24",
                "25-34",
                "35-44",
                "45-54",
                "55+"
              ]
            },
            "default": []
          },
          "gender": {
            "title": "Audience Gender",
            "enum": [
              "ALL",
              "FEMALE",
              "MALE"
            ],
            "type": "string",
            "description": "Only ads shown to women or to men.",
            "default": "ALL"
          },
          "adReach": {
            "title": "Unique Reach",
            "type": "array",
            "description": "Only ads within these unique reach ranges. Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "0-10K",
                "10K-100K",
                "100K+"
              ],
              "enumTitles": [
                "Under 10K",
                "10K - 100K",
                "Over 100K"
              ]
            },
            "default": []
          },
          "maxAds": {
            "title": "Maximum Number of Ads",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of ads to scrape",
            "default": 20
          },
          "fetchDetails": {
            "title": "Fetch Ad Details",
            "type": "boolean",
            "description": "Enable to fetch detailed information for each ad (targeting, reach by country, advertiser profile, etc.). Disable for faster scraping with basic info only.",
            "default": false
          },
          "downloadMedia": {
            "title": "Download media files",
            "type": "boolean",
            "description": "Also download the videos and images of each ad and save them in the run's storage. Each file saved is charged as a separate event, see the Pricing tab. Off by default.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}