{
  "openapi": "3.0.1",
  "info": {
    "title": "Tiktok Scraper 2.0",
    "description": "Scrape TikTok profiles, user videos, keyword results, video metrics, media links, hashtags, account metadata, and transcript or caption text into clean Apify datasets. Built for monitoring accounts, tracking TikTok trends, and feeding structured TikTok data into analytics workflows.",
    "version": "0.1",
    "x-build-id": "f4YjQG6kYZPZNyaXQ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/thescrapelab~tiktok-scraper-2-0/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-thescrapelab-tiktok-scraper-2-0",
        "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/thescrapelab~tiktok-scraper-2-0/runs": {
      "post": {
        "operationId": "runs-sync-thescrapelab-tiktok-scraper-2-0",
        "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/thescrapelab~tiktok-scraper-2-0/run-sync": {
      "post": {
        "operationId": "run-sync-thescrapelab-tiktok-scraper-2-0",
        "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": [
          "workflow"
        ],
        "properties": {
          "workflow": {
            "title": "Workflow",
            "enum": [
              "users",
              "keywords"
            ],
            "type": "string",
            "description": "Choose what to scrape.",
            "default": "users"
          },
          "users": {
            "title": "Users",
            "minItems": 1,
            "maxItems": 100,
            "type": "array",
            "description": "TikTok usernames (for users workflow). Max 100 per run.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords",
            "minItems": 1,
            "maxItems": 100,
            "type": "array",
            "description": "Keyword queries (for keywords workflow). Max 100 per run.",
            "items": {
              "type": "string"
            }
          },
          "maxVideosPerUser": {
            "title": "Max Videos Per User",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum videos to collect per user.",
            "default": 10
          },
          "maxVideosPerKeyword": {
            "title": "Max Videos Per Keyword",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum videos to collect per keyword.",
            "default": 10
          },
          "engine": {
            "title": "Browser Engine",
            "enum": [
              "auto",
              "playwright",
              "pydoll"
            ],
            "type": "string",
            "description": "Primary browser extraction engine. Auto uses the best available engine in the runtime.",
            "default": "auto"
          },
          "outputMode": {
            "title": "Output Mode",
            "enum": [
              "compact",
              "full"
            ],
            "type": "string",
            "description": "Compact keeps smaller pipeline-friendly records. Full keeps more technical fields.",
            "default": "compact"
          },
          "maxDatasetItems": {
            "title": "Max Dataset Items",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum rows to push to the dataset. Use 0 for no additional dataset cap.",
            "default": 5000
          },
          "skipProfileScrape": {
            "title": "Skip Profile Scrape",
            "type": "boolean",
            "description": "Skip browser profile scraping in users workflow. Faster, with sparser account metadata.",
            "default": true
          },
          "includePlaybackUrl": {
            "title": "Include Playback URL",
            "type": "boolean",
            "description": "Include signed direct playback URLs. These can be large and short-lived.",
            "default": true
          },
          "includeTranscriptText": {
            "title": "Include Transcript Text",
            "type": "boolean",
            "description": "Include transcript or fallback text in dataset rows.",
            "default": true
          },
          "includeMediaLinksMeta": {
            "title": "Include Media Link Metadata",
            "type": "boolean",
            "description": "Include expiry/signature metadata for media links.",
            "default": true
          },
          "enableApifyContinuation": {
            "title": "Enable Continuation",
            "type": "boolean",
            "description": "Use the key-value store checkpoint to skip videos already seen in previous runs.",
            "default": true
          },
          "resetApifyContinuation": {
            "title": "Reset Continuation",
            "type": "boolean",
            "description": "Ignore the existing checkpoint for this run and replace it with the new run state.",
            "default": false
          },
          "continuationStateKey": {
            "title": "Continuation State Key",
            "type": "string",
            "description": "Record key used inside the continuation key-value store.",
            "default": "CONTINUATION_STATE"
          },
          "continuationStoreName": {
            "title": "Continuation Store Name",
            "pattern": "^[A-Za-z0-9_-]+$",
            "type": "string",
            "description": "Named Apify key-value store used to persist continuation checkpoints across runs. Values are normalized to lowercase letters, digits, and hyphens.",
            "default": "tiktok-scraper-2-0-continuation"
          },
          "minDelaySec": {
            "title": "Minimum Delay Seconds",
            "minimum": 0,
            "type": "number",
            "description": "Minimum randomized delay between browser page actions.",
            "default": 1.1
          },
          "maxDelaySec": {
            "title": "Maximum Delay Seconds",
            "minimum": 0,
            "type": "number",
            "description": "Maximum randomized delay between browser page actions.",
            "default": 2.4
          },
          "ytdlpTimeoutSec": {
            "title": "yt-dlp Timeout Seconds",
            "minimum": 30,
            "type": "integer",
            "description": "Timeout for yt-dlp profile/video metadata fallback calls.",
            "default": 240
          },
          "ytdlpChunkSize": {
            "title": "yt-dlp Chunk Size",
            "minimum": 10,
            "type": "integer",
            "description": "Number of profile playlist items requested per yt-dlp chunk. Larger chunks can improve high-volume user runs.",
            "default": 40
          },
          "ytdlpMaxRawScan": {
            "title": "yt-dlp Max Raw Scan",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum raw playlist entries scanned per user before stopping. Use 0 for no additional scan cap.",
            "default": 200
          },
          "ytdlpMaxVideosPerUser": {
            "title": "yt-dlp Max Videos Per User",
            "minimum": 0,
            "type": "integer",
            "description": "Optional yt-dlp-specific cap per user. Use 0 to follow Max Videos Per User.",
            "default": 0
          },
          "ytdlpDetailEnrichLimit": {
            "title": "yt-dlp Detail Enrich Limit",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum per-video detail enrichments per user. Lower values are faster and cheaper but may reduce metadata completeness.",
            "default": 10
          },
          "ytdlpTranscriptDetailEnrichLimit": {
            "title": "yt-dlp Transcript Detail Enrich Limit",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum per-video detail enrichments used for transcript discovery.",
            "default": 80
          },
          "ytdlpTranscriptSubtitleDownloadLimit": {
            "title": "yt-dlp Transcript Subtitle Download Limit",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum subtitle-download transcript fallback attempts per user.",
            "default": 8
          },
          "disableScraplingFallback": {
            "title": "Disable Scrapling Fallback",
            "type": "boolean",
            "description": "Disable the HTTP/browser fallback used when primary browser scraping fails or is challenged.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}