{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok Ads Library Scraper: EU Ads & Changes (No Login)",
    "description": "Track ads in the EU TikTok Ad Library by advertiser or keyword: dates, reach bucket, creatives, and NEW, ACTIVE, SCALING, or STOPPED status. Use Only ads that changed to skip unchanged ads for free. No login; not affiliated with TikTok.",
    "version": "0.0",
    "x-build-id": "Dwx8wI3J51Hfw5cfn"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kizukidata~tiktok-ads-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kizukidata-tiktok-ads-monitor",
        "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/kizukidata~tiktok-ads-monitor/runs": {
      "post": {
        "operationId": "runs-sync-kizukidata-tiktok-ads-monitor",
        "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/kizukidata~tiktok-ads-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-kizukidata-tiktok-ads-monitor",
        "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": {
          "queries": {
            "title": "Advertisers or keywords",
            "type": "array",
            "description": "Up to 20 advertiser names or quoted ad-text phrases (e.g. [\"Nike\", \"\\\"nike air max\\\"\"]). Empty (with no advertiserIds) searches a sample advertiser.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "advertiserIds": {
            "title": "Advertiser ids",
            "type": "array",
            "description": "Up to 20 business IDs from library.tiktok.com URLs. Unknown IDs return no rows; prefer advertiser names in queries unless you have the ID.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "regions": {
            "title": "Countries",
            "type": "array",
            "description": "Up to 20 EU/EEA, CH, or UK 2-letter country codes (default [\"DE\"]; e.g. DE, FR, GB). Unsupported codes (e.g. US) are skipped. Regions share maxItems.",
            "default": [
              "DE"
            ],
            "items": {
              "type": "string"
            }
          },
          "days": {
            "title": "Days back",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "How many days back to search, from 1 to 30 (the library's date window); the default is 30, the widest window the library answers with one search.",
            "default": 30
          },
          "adStatus": {
            "title": "Ad status",
            "enum": [
              "all",
              "active",
              "inactive"
            ],
            "type": "string",
            "description": "\"all\" (default), \"active\", or \"inactive\" filter on the library's side; also affects which ads can appear as STOPPED.",
            "default": "all"
          },
          "inactiveAfterDays": {
            "title": "Treated as stopped after (days)",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "Days since lastShownAt to mark an ad STOPPED (1-60, default 7 for daily monitoring). Missing ads are not marked STOPPED.",
            "default": 7
          },
          "onlyChanges": {
            "title": "Only ads that changed",
            "type": "boolean",
            "description": "true returns only NEW, SCALING, or STOPPED ads and skips unchanged ACTIVE ads for free (memory still tracks all seen ads); false (default) returns all.",
            "default": false
          },
          "includeDetails": {
            "title": "Read each ad's details (ad text, landing page, targeting)",
            "type": "boolean",
            "description": "false (default) returns listing rows only; true fetches ad text, CTA, landing page, and targeting (uses 1+ request/ad, may fail; set 2048 MB memory).",
            "default": false
          },
          "detailProxy": {
            "title": "Connection for the detail reads",
            "enum": [
              "datacenter",
              "residential"
            ],
            "type": "string",
            "description": "Proxy for ad detail reads when includeDetails is true: \"datacenter\" (default) or \"residential\".",
            "default": "datacenter"
          },
          "maxItems": {
            "title": "Maximum ads",
            "minimum": 1,
            "maximum": 120,
            "type": "integer",
            "description": "Max ad rows per run (1-120, default 12). Searches queries x regions sequentially; raise to 60-120 for multiple targets. Unreached searches are free.",
            "default": 12
          },
          "proxySession": {
            "title": "Apify Proxy session (optional)",
            "type": "string",
            "description": "Empty (default) connects direct. Set a session name (letters, digits, _, ., ~) to route listing reads via Apify datacenter proxy with a fixed IP.",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}