{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok Scraper — Profiles, Videos, Comments & Search",
    "description": "Stop paying $3.70/1K for TikTok data. 7 modes in 1 actor: profiles, videos, hashtags, comments, search & more. 29 fields, Clockworks-compatible. 30-68% cheaper than Clockworks. HTTP-only, no proxy needed. MCP-ready for AI agents. Integrates w n8n, Make, Zapier, Sheets.",
    "version": "0.1",
    "x-build-id": "hl5SDOSKfiub1yUp3"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/get-leads~all-in-one-tiktok-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-get-leads-all-in-one-tiktok-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/get-leads~all-in-one-tiktok-scraper/runs": {
      "post": {
        "operationId": "runs-sync-get-leads-all-in-one-tiktok-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/get-leads~all-in-one-tiktok-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-get-leads-all-in-one-tiktok-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": [
          "scrapeMode"
        ],
        "properties": {
          "scrapeMode": {
            "title": "Scrape Mode",
            "enum": [
              "tiktok-scraper",
              "tiktok-profile-scraper",
              "tiktok-video-scraper",
              "tiktok-user-search-scraper",
              "tiktok-comments-scraper",
              "tiktok-hashtag-scraper",
              "tiktok-trending-hashtags",
              "tiktok-live-scraper",
              "tiktok-music-scraper",
              "tiktok-dynamic-bundle",
              "tiktok-data-extractor"
            ],
            "type": "string",
            "description": "Choose which TikTok scraper to run.",
            "default": "tiktok-profile-scraper"
          },
          "profiles": {
            "title": "Profiles",
            "type": "array",
            "description": "TikTok usernames, @handles, or full profile URLs (auto-extracted). Duplicates are removed automatically. Used by: tiktok-profile-scraper, tiktok-scraper, tiktok-data-extractor, AND (since 0.1.165) tiktok-comments-scraper as a profile-orchestrator that discovers each creator's recent videos (capped by `maxVideosPerProfile`) and scrapes comments from each. Each profile record includes a `commerceUserInfo` object (e.g. `{ \"commerceUser\": false }`) — a top-level TikTok Shop / commerce flag useful for B2B / influencer-marketing buyer segmentation.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "postURLs": {
            "title": "Post URLs",
            "type": "array",
            "description": "TikTok video URLs or video IDs. Duplicates are removed automatically. Used by: tiktok-video-scraper, tiktok-comments-scraper, tiktok-scraper, tiktok-data-extractor.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "searchQueries": {
            "title": "Search Queries",
            "type": "array",
            "description": "Usernames or keywords to search TikTok. Duplicates are removed automatically. Used by: tiktok-user-search-scraper, tiktok-scraper, tiktok-data-extractor.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "hashtags": {
            "title": "Hashtags",
            "type": "array",
            "description": "TikTok hashtag names (without #). Returns one metadata record per hashtag (challengeId, videoCount, viewCount, description, coverUrl) plus 2–15 individual video records carrying the hashtag. Used by: tiktok-hashtag-scraper, AND (since 0.1.165) tiktok-scraper / tiktok-data-extractor (all-in-one) — when supplied to all-in-one modes, discovered hashtag videos are billed as scraper-result/extractor-result for consistent per-result pricing across the run (no hashtag-meta record emitted). NOTE: Mode 5 is temporarily gated until 2026-05-05 while the hashtag-result pay-per-event completes its Apify pricing-lock window — runs before that date emit a single 'PRICING_PENDING' scrape_error record per input and do not scrape. The gate lifts automatically at 2026-05-05T00:00:00Z; set the ALLOW_HASHTAG_PREBILL=1 actor env var to override.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "resultsPerPage": {
            "title": "Results Per Page",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of results per profile, search query, or hashtag. For all-in-one mode, this caps the number of videos discovered per profile; for hashtag mode, the number of videos returned per hashtag.",
            "default": 100
          },
          "maxProfilesPerQuery": {
            "title": "Max Profiles Per Query",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum number of profiles to return per search query (tiktok-user-search-scraper mode).",
            "default": 10
          },
          "maxVideosPerProfile": {
            "title": "Max Videos Per Profile (Mode 3 orchestrator)",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Optional for tiktok-comments-scraper when `profiles[]` is supplied. Maximum videos to discover per creator before scraping comments on each. Combined with `resultsPerPage`, total comments per run = profiles × maxVideosPerProfile × resultsPerPage. Use to cap revenue-spike risk on heavyweight creators. Range 1-50, default 10.",
            "default": 10
          },
          "excludePinnedPosts": {
            "title": "Exclude Pinned Posts",
            "type": "boolean",
            "description": "Skip pinned posts when scraping profiles.",
            "default": false
          },
          "hashtagNiche": {
            "title": "Hashtag Niche (Bundle)",
            "type": "string",
            "description": "Optional for Mode 5. Expands a niche keyword to a curated list of related hashtags. Merged with any hashtags you list explicitly. Available niches: cooking, fitness, beauty, fashion, tech, travel, finance, education, comedy, gaming, music, pets, diy, business, parenting.",
            "default": ""
          },
          "hashtagSortBy": {
            "title": "Hashtag Video Sort",
            "enum": [
              "relevance",
              "most_viewed",
              "most_recent",
              "most_liked"
            ],
            "type": "string",
            "description": "Optional for Mode 5. How to order videos within each hashtag's result set. `relevance` preserves SERP/chain-walk discovery order; others re-sort post-hydration.",
            "default": "relevance"
          },
          "hashtagPostedAfter": {
            "title": "Hashtag: Posted After (ISO date)",
            "type": "string",
            "description": "Optional for Mode 5. Only return videos posted on or after this date. ISO 8601 format (e.g. `2026-04-01` or `2026-04-01T00:00:00Z`). Leave empty for no lower bound.",
            "default": ""
          },
          "hashtagPostedBefore": {
            "title": "Hashtag: Posted Before (ISO date)",
            "type": "string",
            "description": "Optional for Mode 5. Only return videos posted on or before this date. ISO 8601 format. Leave empty for no upper bound.",
            "default": ""
          },
          "trendingRegion": {
            "title": "Trending Region",
            "type": "string",
            "description": "Optional for Mode 8 (Trending Hashtags). ISO 3166-1 alpha-2 country code. Falls back to a global curated list if the region isn't available. The region is echoed on each output record as `countryCode`, and the scraper persists per-region rank state in a KV store between runs to populate `rankDiff` (rank change vs. the previous run for this same region) and `markedAsNew` (true when a hashtag wasn't in the previous run).",
            "default": "US"
          },
          "trendingLimit": {
            "title": "Trending Limit",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Optional for Mode 8. Max number of trending hashtags to return (1-50).",
            "default": 20
          },
          "includeTranscripts": {
            "title": "Include Video Transcripts",
            "type": "boolean",
            "description": "Optional for Modes 2/5/6/11. When true, for every video with auto-captions, the scraper fetches the WebVTT subtitle file and emits a flattened plain-text transcript in `videoMeta.transcriptText`. Adds one extra HTTP fetch per video with captions. Default off.",
            "default": false
          },
          "commentReplyDepth": {
            "title": "Comment Reply Depth",
            "minimum": 1,
            "maximum": 3,
            "type": "integer",
            "description": "Optional for Mode 3 (Comments). 1 = top-level comments only; 2 = top + direct replies (default); 3 = top + replies + reply-of-reply. Each depth level beyond the first adds fetches only for comments that actually have replies.",
            "default": 2
          },
          "useCache": {
            "title": "Use Cross-Run Dedup Cache",
            "type": "boolean",
            "description": "Optional. When true, profile and video records scraped in the last 24 hours are returned from cache instead of re-fetching. Useful when re-running the same inputs intra-day. Default off.",
            "default": false
          },
          "roomIds": {
            "title": "Live Room IDs",
            "type": "array",
            "description": "Required for Mode 9 (Live Streams). TikTok live-room numeric IDs. Returns one snapshot per room with viewer count, host info, and status.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "musicIds": {
            "title": "Music / Sound IDs",
            "type": "array",
            "description": "Required for Mode 11 (Music). TikTok numeric music IDs — the `music.id` value from any video's musicMeta.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "All modes work without proxy. Leave empty for the cheapest scraping. If you do supply a residential proxy here and it gets flagged by TikTok mid-run, Modes 1-6 automatically fall back to a direct connection so your run doesn't fail.",
            "default": {}
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}