{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok Ads Intelligence (CCL + Creative Center)",
    "description": "Worldwide TikTok ad intelligence in one Actor: Commercial Content Library for EEA/UK/CH (ads + OCC, HTTP-first quick search + detail targeting) and Creative Center Top Ads for US/global markets (residential sticky-session bootstrap, industry/objective filters, rich diagnostics).",
    "version": "0.6",
    "x-build-id": "Fow6xG5c2Yjnz9bzQ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lentic_clockss~tiktok-ads-top-ads-actor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lentic_clockss-tiktok-ads-top-ads-actor",
        "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/lentic_clockss~tiktok-ads-top-ads-actor/runs": {
      "post": {
        "operationId": "runs-sync-lentic_clockss-tiktok-ads-top-ads-actor",
        "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/lentic_clockss~tiktok-ads-top-ads-actor/run-sync": {
      "post": {
        "operationId": "run-sync-lentic_clockss-tiktok-ads-top-ads-actor",
        "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": {
          "runMode": {
            "title": "Run mode",
            "enum": [
              "fixture",
              "real"
            ],
            "type": "string",
            "description": "fixture for smoke tests, real for live capture.",
            "default": "fixture"
          },
          "mode": {
            "title": "Collection mode",
            "enum": [
              "ads_library_search",
              "ads_library_probe",
              "catalog_refresh",
              "top_ads"
            ],
            "type": "string",
            "description": "ads_library_search (primary), ads_library_probe (diagnostics), catalog_refresh (filters catalog), top_ads (deprecated alias for Creative Center).",
            "default": "ads_library_search"
          },
          "source": {
            "title": "Data source",
            "enum": [
              "auto",
              "ads_library",
              "creative_center"
            ],
            "type": "string",
            "description": "auto routes by country. ads_library forces Commercial Content Library. creative_center forces Top Ads.",
            "default": "auto"
          },
          "query": {
            "title": "Search query",
            "type": "string",
            "description": "Keyword for Ads Library / OCC search, or seed query for Creative Center.",
            "default": "shopify"
          },
          "advertiserName": {
            "title": "Advertiser name",
            "type": "string",
            "description": "Search by advertiser name (Ads Library / OCC).",
            "default": ""
          },
          "adIds": {
            "title": "Ad ID list",
            "type": "array",
            "description": "Fetch Ads Library records directly by ad ID (single browser session).",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "country": {
            "title": "Country / region",
            "type": "string",
            "description": "ISO country code. CCL path for EEA/UK/CH; Creative Center for global markets (US, JP, BR, …). Use ALL for Creative Center global view.",
            "default": "FR"
          },
          "contentType": {
            "title": "CCL content type",
            "enum": [
              "ads",
              "other_commercial",
              "both"
            ],
            "type": "string",
            "description": "Ads Library content surface. Only applies on the CCL path.",
            "default": "ads"
          },
          "startDate": {
            "title": "Start date",
            "type": "string",
            "description": "YYYY-MM-DD for Ads Library / OCC.",
            "default": ""
          },
          "endDate": {
            "title": "End date",
            "type": "string",
            "description": "YYYY-MM-DD for Ads Library / OCC.",
            "default": ""
          },
          "timezone": {
            "title": "Timezone",
            "type": "string",
            "description": "Timezone used for Ads Library date bounds and summaries.",
            "default": "UTC"
          },
          "sortBy": {
            "title": "Ads Library sort",
            "type": "string",
            "description": "Ads Library sort expression, e.g. last_shown_date,desc.",
            "default": ""
          },
          "quickSearch": {
            "title": "Quick search",
            "type": "boolean",
            "description": "Skip detail enrichment for higher Ads Library success rate.",
            "default": true
          },
          "maxPages": {
            "title": "Maximum pages",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum number of Ads Library / OCC result pages to fetch.",
            "default": 1
          },
          "sessionReuse": {
            "title": "Reuse browser session",
            "type": "boolean",
            "description": "Fetch search pages and details in one browser context when possible.",
            "default": true
          },
          "industries": {
            "title": "Industries",
            "type": "array",
            "description": "Creative Center industry codes from catalog (e.g. label_16000000000). Empty = no filter.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "objectives": {
            "title": "Objectives",
            "type": "array",
            "description": "Creative Center objective codes (traffic, conversions, …).",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "adLanguages": {
            "title": "Ad languages",
            "type": "array",
            "description": "Creative Center ad language codes. Empty means no language filter.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "patternLabels": {
            "title": "Creative pattern labels",
            "type": "array",
            "description": "Creative Center creative pattern label codes. Empty means no filter.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "adFormats": {
            "title": "Ad formats",
            "type": "array",
            "description": "Creative Center ad format codes (in_feed, topview, …).",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "maxFilterCombinations": {
            "title": "Max filter combinations",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Cap for cartesian expansion of multi-select Creative Center filters.",
            "default": 20
          },
          "period": {
            "title": "Top Ads period",
            "type": "integer",
            "description": "7, 30, or 180 days.",
            "default": 30
          },
          "orderBy": {
            "title": "Top Ads sort",
            "enum": [
              "for_you",
              "impression",
              "ctr",
              "play_2s_rate",
              "play_6s_rate",
              "cvr",
              "like"
            ],
            "type": "string",
            "description": "Creative Center Top Ads sort field.",
            "default": "for_you"
          },
          "maxItems": {
            "title": "Maximum output items (max 500; free users capped at 500/run)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of dataset items to emit (1–500). Free Apify plan users: also limited to 10 total runs of this Actor (Actor developer policy).",
            "default": 20
          },
          "workerBaseUrl": {
            "title": "Worker base URL (optional)",
            "type": "string",
            "description": "Override the Cloud Run worker origin for this run. Defaults to Actor env WORKER_BASE_URL. Production migrations should update WORKER_BASE_URL in Actor settings (no code change).",
            "default": ""
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Timeout in seconds for HTTP and browser capture steps.",
            "default": 30
          },
          "includeDetails": {
            "title": "Include detail enrichment",
            "type": "boolean",
            "description": "Whether to enrich results with detail endpoints when available.",
            "default": true
          },
          "includeDiagnostics": {
            "title": "Write diagnostics",
            "type": "boolean",
            "description": "Write RUN_SUMMARY / LIVE_DIAGNOSTICS and capture dumps (proxy, sessionId, gotoStatus, hasUserSign, failureClass).",
            "default": true
          },
          "includeSourceRaw": {
            "title": "Include sourceRaw",
            "type": "boolean",
            "description": "When true, embed upstream raw payloads on each dataset item. Default false.",
            "default": false
          },
          "locale": {
            "title": "Page locale",
            "type": "string",
            "description": "UI/locale string used for Creative Center and browser context.",
            "default": "en"
          },
          "proxyConfiguration": {
            "title": "Apify proxy configuration",
            "type": "object",
            "description": "Use Apify RESIDENTIAL with a country matching the search market. Required for reliable CCL and Creative Center runs; sticky session IDs are applied automatically for Creative Center bootstrap/replay.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "fixtures": {
            "title": "Fixture configuration",
            "type": "object",
            "description": "Local fixture paths used when runMode=fixture.",
            "properties": {
              "htmlPath": {
                "title": "HTML path",
                "type": "string",
                "description": "Path to Creative Center HTML fixture."
              },
              "resultJsonPath": {
                "title": "Ads Library result JSON path",
                "type": "string",
                "description": "Path to Ads Library fixture results JSON."
              },
              "occResultJsonPath": {
                "title": "OCC result JSON path",
                "type": "string",
                "description": "Path to Other Commercial Content fixture results JSON."
              },
              "scrapedAt": {
                "title": "Scraped-at timestamp",
                "type": "string",
                "description": "ISO timestamp stamped onto fixture outputs."
              }
            }
          },
          "queries": {
            "title": "Legacy query list",
            "type": "array",
            "description": "Used by probe / deprecated top_ads mode.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "countryCode": {
            "title": "Legacy Top Ads country code",
            "type": "string",
            "description": "Deprecated. Prefer country. If country is empty, this value is used. Leave empty unless needed — default ALL previously broke CCL proxy geo when sent with country.",
            "default": ""
          },
          "industry": {
            "title": "Legacy single industry",
            "type": "string",
            "description": "Legacy single industry code. Prefer industries[].",
            "default": ""
          },
          "objective": {
            "title": "Legacy single objective",
            "type": "string",
            "description": "Legacy single objective code. Prefer objectives[].",
            "default": ""
          },
          "adLanguage": {
            "title": "Legacy single ad language",
            "type": "string",
            "description": "Legacy single ad language code. Prefer adLanguages[].",
            "default": ""
          },
          "patternLabel": {
            "title": "Legacy single pattern label",
            "type": "string",
            "description": "Legacy single pattern label. Prefer patternLabels[].",
            "default": ""
          },
          "deviceType": {
            "title": "Device type",
            "enum": [
              "pc"
            ],
            "type": "string",
            "description": "Device type for Creative Center page capture. Currently only pc.",
            "default": "pc"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}