{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok Ads Scraper - Ad Library & Top Ads",
    "description": "Extract TikTok ads, targeting, brand-disclosed posts, Top Ads metrics, suggestions and country reports. Search the EU/EEA, UK and Swiss library or selected Top Ads markets. Pay per delivered row plus a start fee.",
    "version": "0.7",
    "x-build-id": "QzAO6z9lfGfeeAIzF"
  },
  "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": {
          "query": {
            "title": "Search keyword",
            "type": "string",
            "description": "Keyword, brand or product for Library ads, or a seed for suggestions. In Top Ads, an optional term filters the ranking rather than searching every TikTok ad; empty default input runs the shopify example in France with at most 3 rows."
          },
          "advertiserName": {
            "title": "Advertiser name",
            "type": "string",
            "description": "Advertiser to search for. The Library has one search box: when both are given, the advertiser name is searched and the keyword is not."
          },
          "adIds": {
            "title": "Ad IDs",
            "type": "array",
            "description": "Enter numeric Library ad IDs or Library detail links; each ID is a separate input. IDs replace text searches and read ads directly, but cannot be used with other commercial content.",
            "items": {
              "type": "string"
            }
          },
          "creatorUsername": {
            "title": "Creator username (commercial posts)",
            "type": "string",
            "description": "For other commercial content, enter the exact creator username, @username or profile link. Clear the ad search terms and leave this empty to request the newest posts in the selected country."
          },
          "country": {
            "title": "Country",
            "enum": [
              "AT",
              "BE",
              "BG",
              "HR",
              "CY",
              "CZ",
              "DK",
              "EE",
              "FI",
              "FR",
              "DE",
              "GR",
              "HU",
              "IS",
              "IE",
              "IT",
              "LV",
              "LI",
              "LT",
              "LU",
              "MT",
              "NL",
              "NO",
              "PL",
              "PT",
              "RO",
              "SK",
              "SI",
              "ES",
              "SE",
              "CH",
              "GB",
              "US",
              "CA",
              "MX",
              "BR",
              "AR",
              "CL",
              "JP",
              "KR",
              "IN",
              "ID",
              "VN",
              "TH",
              "PH",
              "MY",
              "SG",
              "AU",
              "NZ",
              "AE",
              "SA",
              "EG",
              "TR",
              "NG",
              "ZA"
            ],
            "type": "string",
            "description": "Choose a market from the list. Library ads, commercial posts, suggestions and reports cover the EU/EEA, UK and Switzerland; Top Ads also supports the additional listed markets.",
            "default": "FR"
          },
          "contentType": {
            "title": "Content",
            "enum": [
              "ads",
              "other_commercial",
              "both",
              "top_ads",
              "suggestion",
              "reports"
            ],
            "type": "string",
            "description": "Choose ads, brand-disclosed creator posts, both, Top Ads rankings, search suggestions or country reports. Combined searches need an ad keyword or advertiser and a creator username; direct ad IDs select ads.",
            "default": "ads"
          },
          "period": {
            "title": "Top Ads period (days)",
            "enum": [
              "7",
              "30"
            ],
            "type": "string",
            "description": "Top Ads ranking window: 7 or 30 days. This setting does not change Library date filters.",
            "default": "7"
          },
          "industryKey": {
            "title": "Top Ads industry",
            "type": "string",
            "description": "Optional Top Ads industry ID, such as 21101000000 or label_21101000000. Ignored for other content types."
          },
          "objective": {
            "title": "Top Ads campaign objective",
            "type": "string",
            "description": "Optional Top Ads campaign objective ID or label, such as 3 or campaign_objective_conversion. Ignored for other content types."
          },
          "patternLabel": {
            "title": "Top Ads pattern label",
            "type": "string",
            "description": "Optional Top Ads pattern-label ID. Ignored for other content types."
          },
          "startDate": {
            "title": "Shown from",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "Only ads shown on or after this day (YYYY-MM-DD). Empty: the 30 days before the end date."
          },
          "endDate": {
            "title": "Shown until",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "Only ads shown on or before this day (YYYY-MM-DD). Empty: today."
          },
          "includeDetails": {
            "title": "Read ad details",
            "type": "boolean",
            "description": "Add available targeting, advertiser identity and landing-page fields to Library ad rows, or creative metrics to Top Ads rows. Details are enabled by default; failed detail reads retain list fields with detailFetched=false, without an extra row charge.",
            "default": true
          },
          "maxItems": {
            "title": "Max results per input",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum delivered and billed rows per input, from 1 to 500; the default is 70 and the example uses 3. A combined ads-and-posts search shares this allowance; spending limits and any free-plan allowance also limit the whole run.",
            "default": 70
          },
          "cursor": {
            "title": "Continue from",
            "type": "object",
            "description": "To get the next results of the same search, paste RUN_SUMMARY.nextCursor from the earlier run and keep every other field the same."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}