{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok Search Scraper",
    "description": "Search TikTok for videos and users by keyword, or get all videos under a hashtag. Built for marketing teams tracking brand mentions and campaign performance.",
    "version": "0.1",
    "x-build-id": "aYEAVjkOnFcLAgy04"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rastriq~tiktok-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rastriq-tiktok-search-scraper",
        "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/rastriq~tiktok-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-rastriq-tiktok-search-scraper",
        "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/rastriq~tiktok-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-rastriq-tiktok-search-scraper",
        "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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Extraction mode",
            "enum": [
              "search_videos",
              "search_users",
              "hashtag_videos"
            ],
            "type": "string",
            "description": "What to extract.<br><br><b>🔍 Search Videos</b> — find videos matching a keyword, with views, likes, comments, shares, and author info.<br><b>👥 Search Users</b> — find accounts matching a keyword, with follower counts and bios.<br><b>#️⃣ Hashtag Videos</b> — get all videos posted under a specific hashtag or challenge, with full engagement metrics.",
            "default": "search_videos"
          },
          "searchQueries": {
            "title": "🔍 Search keywords",
            "type": "array",
            "description": "Keywords to search for. Used in <b>Search Videos</b> and <b>Search Users</b> modes.<br><br>Examples:<br>• <code>nike campaign</code><br>• <code>sustainable fashion</code><br>• <code>iphone review</code><br><br>Add one keyword per line. Each keyword runs as a separate search.",
            "items": {
              "type": "string"
            }
          },
          "hashtags": {
            "title": "#️⃣ Hashtags",
            "type": "array",
            "description": "Hashtags to extract. Used in <b>Hashtag Videos</b> mode.<br><br>Accepts multiple formats:<br>• With #: <code>#madrid</code><br>• Without #: <code>madrid</code><br>• Full URL: <code>https://www.tiktok.com/tag/madrid</code><br><br>Add one per line.",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Max results per keyword/hashtag",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum items to extract <b>per keyword or hashtag</b>. Each keyword gets its own independent budget — e.g. 3 keywords × 100 = up to 300 items total, billed accordingly.<br><br>💡 <b>Tip:</b> Start with 10–20 for a quick test, then scale up once you're happy with the results.",
            "default": 100
          },
          "includeSubtitles": {
            "title": "Include subtitles/captions",
            "type": "boolean",
            "description": "Include video subtitle/caption text when available. Useful for analyzing what creators are <b>saying</b> about your brand, not just what they write in captions.<br><br>⚠️ May increase run time for large extractions.",
            "default": false
          },
          "maxRunSeconds": {
            "title": "Max run time (seconds)",
            "minimum": 60,
            "maximum": 36000,
            "type": "integer",
            "description": "Maximum total run time in seconds. The extraction stops gracefully when this limit is reached.",
            "default": 3600
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Connection settings. The default (datacenter proxy) works well and keeps costs low. Switch to residential only if you experience persistent blocks.",
            "default": {
              "useApifyProxy": true
            }
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many searches to run in parallel. Keep at 1–3 for best reliability.",
            "default": 1
          },
          "proxyProvider": {
            "title": "Proxy provider",
            "enum": [
              "auto",
              "decodo"
            ],
            "type": "string",
            "description": "Which proxy provider to use.<br><br><b>auto</b> — use the Proxy configuration above (default).<br><b>decodo</b> — use Decodo residential proxy (requires <code>DECODO_USER</code> and <code>DECODO_PASS</code> environment variables set in Actor settings).",
            "default": "auto"
          },
          "blockResources": {
            "title": "Block images/media/fonts",
            "type": "boolean",
            "description": "Abort image, media, and font requests to reduce bandwidth. Recommended when using residential proxies. Has no effect on scraped data.",
            "default": true
          },
          "debugMode": {
            "title": "Debug mode",
            "type": "boolean",
            "description": "Enable detailed logging for troubleshooting. Recommended only when diagnosing issues with Apify support.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}