{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok Ads Library Scraper: EU Ad Transparency & Reach",
    "description": "Search TikTok's Commercial Content Library across 34 supported countries. Export ad captions, dates and available creatives. Request optional payer, reach and targeting disclosures and track newly found ads on a schedule.",
    "version": "0.1",
    "x-build-id": "2aI4erj6BXC6mymeY"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automatic~tiktok-ads-library-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automatic-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/automatic~tiktok-ads-library-scraper/runs": {
      "post": {
        "operationId": "runs-sync-automatic-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/automatic~tiktok-ads-library-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-automatic-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": {
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Words or phrases to search across ad captions and advertiser names (one search per entry). Wrap a phrase in double quotes (for example \"black friday\") for an exact-phrase match. Leave the whole form empty for a quick 10-ad sample.",
            "items": {
              "type": "string"
            }
          },
          "advertisers": {
            "title": "Advertiser names or IDs",
            "type": "array",
            "description": "Registered advertiser names (for example \"NIKE Retail B.V.\" or \"L'Oréal\") or numeric TikTok business IDs (for example \"6876453864464188162\"). Each entry runs its own advertiser search.",
            "items": {
              "type": "string"
            }
          },
          "countries": {
            "title": "Target countries",
            "type": "array",
            "description": "Only rows from ads shown in these countries. Use two-letter codes (DE, FR, GB, IT, ES, NL, PL) or English country names, or \"all\". Empty means all 34 countries covered by the TikTok Ads Library (30 EEA countries plus the UK, Switzerland, Turkey and Brazil).",
            "items": {
              "type": "string"
            }
          },
          "dateRange": {
            "title": "Date range",
            "enum": [
              "last-7-days",
              "last-30-days",
              "last-90-days",
              "last-180-days",
              "last-365-days",
              "custom"
            ],
            "type": "string",
            "description": "Published/shown window within the Ads Library's rolling 1-year archive. Setting From date or To date below automatically switches to a custom range.",
            "default": "last-30-days"
          },
          "startDate": {
            "title": "From date",
            "type": "string",
            "description": "Custom start date as YYYY-MM-DD (up to 366 days back). Leave empty to use the Date range preset above."
          },
          "endDate": {
            "title": "To date",
            "type": "string",
            "description": "Custom end date as YYYY-MM-DD. Leave empty for today."
          },
          "sortBy": {
            "title": "Sort order",
            "enum": [
              "last_shown_date,desc",
              "last_shown_date,asc",
              "create_time,desc",
              "create_time,asc",
              "impression,desc",
              "impression,asc"
            ],
            "type": "string",
            "description": "Order in which TikTok returns matching ads.",
            "default": "last_shown_date,desc"
          },
          "adMediaType": {
            "title": "Ad format",
            "enum": [
              "all",
              "video",
              "image",
              "text"
            ],
            "type": "string",
            "description": "Filter by creative format.",
            "default": "all"
          },
          "adStatus": {
            "title": "Ad status",
            "enum": [
              "all",
              "active",
              "inactive"
            ],
            "type": "string",
            "description": "Filter by delivery status in the library.",
            "default": "active"
          },
          "targetGender": {
            "title": "Targeted gender",
            "enum": [
              "ALL",
              "FEMALE",
              "MALE"
            ],
            "type": "string",
            "description": "Filter ads by targeted audience gender.",
            "default": "ALL"
          },
          "targetAges": {
            "title": "Targeted age groups",
            "type": "array",
            "description": "Only ads targeting these age ranges. Leave empty for all ages.",
            "items": {
              "type": "string",
              "enum": [
                "13-17",
                "18-24",
                "25-34",
                "35-44",
                "45-54",
                "55+"
              ],
              "enumTitles": [
                "13–17",
                "18–24",
                "25–34",
                "35–44",
                "45–54",
                "55+"
              ]
            }
          },
          "reachRanges": {
            "title": "Unique users seen",
            "type": "array",
            "description": "Only ads within these unique-viewer reach tiers. Leave empty for all tiers.",
            "items": {
              "type": "string",
              "enum": [
                "0-10K",
                "10K-100K",
                "100K+"
              ],
              "enumTitles": [
                "Under 10K",
                "10K – 100K",
                "100K+"
              ]
            }
          },
          "includeDetails": {
            "title": "Include full ad details",
            "type": "boolean",
            "description": "Request available creative, advertiser, payer, landing page, reach and targeting disclosures. Turn off for faster card previews. Image and cover URLs may only be available in a detail record. Eligible cards are kept when optional details cannot be fetched.",
            "default": true
          },
          "onlyNewAds": {
            "title": "Only new ads since the last run",
            "type": "boolean",
            "description": "For scheduled runs: skip ads this monitor already delivered on earlier runs so you receive only newly found ads.",
            "default": false
          },
          "monitorName": {
            "title": "Monitor name",
            "type": "string",
            "description": "Optional name for the history kept by \"Only new ads\" (for example \"competitors-eu\"). Leave empty to scope the history automatically to your search inputs."
          },
          "startUrls": {
            "title": "Ad Library links or ad IDs",
            "type": "array",
            "description": "Paste links copied from library.tiktok.com — either search result URLs (preserving their filters) or single ad detail URLs (https://library.tiktok.com/ads/detail/?ad_id=...) — or bare numeric ad IDs.",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Maximum ads per search",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum number of ads saved for each keyword, advertiser or search URL (and across pasted single-ad links).",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}