{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok Ad Creative Benchmark — CTR percentiles by industry",
    "description": "Turns the public TikTok Top Ads board into performance benchmarks: CTR distribution, video length, engagement and copy patterns per industry, objective and country. One row per benchmark, not another dump of ads.",
    "version": "0.1",
    "x-build-id": "QCg7MedbejE3qHfdX"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/titan_coder~tiktok-ad-creative-benchmark/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-titan_coder-tiktok-ad-creative-benchmark",
        "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/titan_coder~tiktok-ad-creative-benchmark/runs": {
      "post": {
        "operationId": "runs-sync-titan_coder-tiktok-ad-creative-benchmark",
        "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/titan_coder~tiktok-ad-creative-benchmark/run-sync": {
      "post": {
        "operationId": "run-sync-titan_coder-tiktok-ad-creative-benchmark",
        "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": {
          "cdpUrl": {
            "title": "Your own remote browser CDP URL (optional)",
            "type": "string",
            "description": "Optional. Leave EMPTY to use the built-in stealth anti-detect browser — no third-party account or key needed. Provide your own remote browser endpoint (ws:// or wss://, e.g. a Bright Data Scraping Browser) only if you prefer to route through your own. The backend is never switched automatically and is reported in the run's coverage."
          },
          "countryCodes": {
            "title": "Countries",
            "type": "array",
            "description": "Two-letter country codes to sweep, e.g. US, GB, DE. Each country is a separate slice of the board. Up to 28 (the source's own list).",
            "default": [
              "US"
            ],
            "items": {
              "type": "string"
            }
          },
          "periods": {
            "title": "Periods (days)",
            "type": "array",
            "description": "Which time windows to sweep: 7, 30 and/or 180. Each period is a separate slice, so [7,30] doubles the volume.",
            "default": [
              30
            ]
          },
          "orderBy": {
            "title": "Ranking",
            "enum": [
              "ctr",
              "impression",
              "for_you"
            ],
            "type": "string",
            "description": "How the board ranks ads. CTR and Reach are deterministic and repeatable; For You is personalised and its window rotates between runs.",
            "default": "ctr"
          },
          "maxPagesPerSlice": {
            "title": "Max pages per slice",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "1-5. The source hard-caps each slice at 100 ads (5 pages x 20), so 5 is the maximum useful value.",
            "default": 5
          },
          "webhookUrl": {
            "title": "Webhook URL (HTTPS)",
            "type": "string",
            "description": "Optional. Receives a JSON summary of the run. HTTPS only."
          },
          "groupBy": {
            "title": "Group benchmarks by",
            "enum": [
              "industry",
              "objective",
              "industryAndObjective"
            ],
            "type": "string",
            "description": "Every benchmark is always scoped to one country and one period. This picks what else splits it. 'Industry x objective' gives the sharpest comparison but needs more ads per group to clear the minimum.",
            "default": "industry"
          },
          "minAdsPerGroup": {
            "title": "Minimum ads per benchmark",
            "minimum": 5,
            "maximum": 100,
            "type": "integer",
            "description": "A group is returned only if it holds at least this many distinct ads. Default 10: at n=5 the 90th percentile is nearly the maximum and moves with every single ad. Values of 5-9 are allowed but every row from such a group is flagged isExploratory. Groups under the threshold are dropped before they are returned and before they are billed.",
            "default": 10
          },
          "maxBenchmarks": {
            "title": "Max benchmarks to return",
            "minimum": 1,
            "maximum": 3000,
            "type": "integer",
            "description": "Hard stop for the run, applied after ranking by ad count. This is the number of rows you actually receive and pay for.",
            "default": 300
          },
          "industryLevel": {
            "title": "Industry granularity",
            "enum": [
              "top",
              "detailed"
            ],
            "type": "string",
            "description": "TikTok's taxonomy has 258 detailed industries, which splits a run into groups too small to be meaningful. 'Top-level' rolls them up into the 21 parent categories and is the default. Use 'detailed' only when you sweep many countries and periods.",
            "default": "top"
          },
          "allowTruncatedSlices": {
            "title": "Include truncated slices",
            "type": "boolean",
            "description": "A slice that hit the page cap while the source still reported more results is a limited sample, not a full window. By default such a slice is excluded from the benchmarks. Turn this on to include it anyway: every row built from it is then flagged isTruncatedSample.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}