{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok Creator Search Insights",
    "description": "Scrape TikTok Creator Search Insights feeds, keyword search, and direct query-ID lookups. Enrich topics with popularity charts, demographics, related topics and videos, and AI video outlines. Returns one structured dataset row per topic.",
    "version": "1.1",
    "x-build-id": "okw27A3naRRjbUGzi"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/cunning_soil~tiktok-creator-search-insights/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-cunning_soil-tiktok-creator-search-insights",
        "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/cunning_soil~tiktok-creator-search-insights/runs": {
      "post": {
        "operationId": "runs-sync-cunning_soil-tiktok-creator-search-insights",
        "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/cunning_soil~tiktok-creator-search-insights/run-sync": {
      "post": {
        "operationId": "run-sync-cunning_soil-tiktok-creator-search-insights",
        "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": {
          "feedChannel": {
            "title": "What to scrape",
            "enum": [
              "suggested_content_gap",
              "suggested_all",
              "search",
              "trending_topics",
              "trending_sounds",
              "trending_hashtags",
              "trending_challenges",
              "trending_events",
              "trending_effects",
              "trending_templates",
              "trending_subscribed",
              "featured",
              "fashion",
              "food",
              "sports",
              "hobbies",
              "science",
              "dance",
              "travel",
              "home_living",
              "education",
              "careers",
              "vehicles",
              "local_life",
              "photo_posts",
              "query_ids",
              "suggested",
              "trending"
            ],
            "type": "string",
            "description": "One complete destination — you do not need to combine a section and a filter.",
            "default": "suggested"
          },
          "searchKeyword": {
            "title": "Search keyword",
            "type": "string",
            "description": "Used only when What to scrape is Search by keyword (e.g. iphone, skincare). Ignored for every other destination — leftover text will not change the run."
          },
          "maxItems": {
            "title": "How many results",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many topics. Prefill is 20 so a first run with details stays predictable. 0 means no cap (uses Max pages instead).",
            "default": 0
          },
          "includeTopicDetail": {
            "title": "Include topic details (recommended)",
            "type": "boolean",
            "description": "On by default. Adds popularity charts, audience demographics, related topics, related videos, and AI video outlines. About 4–6 extra API requests per topic. Turn off for a cheaper list-only scrape.",
            "default": true
          },
          "includePopularityChart": {
            "title": "Popularity chart",
            "type": "boolean",
            "description": "Search trend chart. Used when topic details are on.",
            "default": true
          },
          "includeDemographics": {
            "title": "Audience demographics",
            "type": "boolean",
            "description": "Gender, age, and country breakdown. Used when topic details are on.",
            "default": true
          },
          "includeRelatedTopics": {
            "title": "Related topics",
            "type": "boolean",
            "description": "Explore-more topics. Used when topic details are on.",
            "default": true
          },
          "includeRelatedVideos": {
            "title": "Related videos",
            "type": "boolean",
            "description": "May be empty if TikTok anti-bot blocks the request.",
            "default": true
          },
          "includeAiOutline": {
            "title": "AI video outline",
            "type": "boolean",
            "description": "Titles, hashtags, and script sections. Used when topic details are on.",
            "default": true
          },
          "queryIds": {
            "title": "Query IDs",
            "type": "array",
            "description": "TikTok query_id values (e.g. 7452903671676796934).",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "Category filter",
            "uniqueItems": true,
            "type": "array",
            "description": "Extra filter for Suggested or Trending → Topics.",
            "items": {
              "type": "string",
              "enum": [
                "Fashion",
                "Food",
                "Gaming",
                "Tourism",
                "Science",
                "Sports"
              ]
            }
          },
          "language": {
            "title": "Language",
            "enum": [
              "en",
              "es",
              "fr",
              "de",
              "pt",
              "ja",
              "ko",
              "id",
              "vi",
              "th",
              "tr",
              "ar"
            ],
            "type": "string",
            "description": "Language used to filter results.",
            "default": "en"
          },
          "location": {
            "title": "Location",
            "type": "string",
            "description": "For Trending tabs: local, global, or a country code (US, GB, …)."
          },
          "timeWindow": {
            "title": "Time window",
            "enum": [
              "4H",
              "24H",
              "48H",
              "7D"
            ],
            "type": "string",
            "description": "For Trending → Hot trends or Events only."
          },
          "feedTab": {
            "title": "Filter pill",
            "type": "string",
            "description": "Legacy API field. New runs should pick a complete destination in What to scrape.",
            "default": "all"
          },
          "maxPages": {
            "title": "Max pages",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum feed pages to request.",
            "default": 10
          },
          "resultsPerPage": {
            "title": "Results per page",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Items requested per page (max 20).",
            "default": 20
          },
          "delaySeconds": {
            "title": "Delay between pages (seconds)",
            "minimum": 0,
            "type": "number",
            "description": "Pause between feed page requests.",
            "default": 0.5
          },
          "includeViewerInsights": {
            "title": "Viewer insights",
            "type": "boolean",
            "description": "Optional; often empty.",
            "default": false
          },
          "detailDateRange": {
            "title": "Chart date range",
            "enum": [
              "7day",
              "30day",
              "60day",
              "6month"
            ],
            "type": "string",
            "description": "Window for popularity chart and demographics.",
            "default": "7day"
          },
          "detailCountryCodes": {
            "title": "Chart countries",
            "type": "array",
            "description": "ISO country codes (global is always included).",
            "items": {
              "type": "string"
            },
            "default": [
              "US"
            ]
          },
          "relatedTopicsLimit": {
            "title": "Max related topics",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Maximum related topics per enriched item.",
            "default": 10
          },
          "detailDelaySeconds": {
            "title": "Delay between detail calls (seconds)",
            "minimum": 0,
            "type": "number",
            "description": "Pause after enriching each topic.",
            "default": 0.3
          },
          "requestTimeout": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "HTTP timeout per API request.",
            "default": 30
          },
          "maxRetries": {
            "title": "Max retries per request",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Retries for network errors and transient TikTok blocks.",
            "default": 3
          },
          "retryBackoffSeconds": {
            "title": "Retry backoff (seconds)",
            "minimum": 0,
            "type": "number",
            "description": "Base delay between retries (multiplied by attempt number).",
            "default": 1
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}