{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok Scraper — Videos, Creators, Hashtags, Comments & Trends",
    "description": "TikTok scraper & real-time data API for videos, creators, hashtags, sounds, comments & search suggestions. Keyword video search, influencer profiles, engagement stats, related videos & webhooks. Structured JSON for marketing, influencer research, trend analysis, brand monitoring & LLM pipelines.",
    "version": "0.0",
    "x-build-id": "9toO2MVUEJwHJs4Xy"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/b2b_leads~TikTok-Real-Time-Data/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-b2b_leads-TikTok-Real-Time-Data",
        "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/b2b_leads~TikTok-Real-Time-Data/runs": {
      "post": {
        "operationId": "runs-sync-b2b_leads-TikTok-Real-Time-Data",
        "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/b2b_leads~TikTok-Real-Time-Data/run-sync": {
      "post": {
        "operationId": "run-sync-b2b_leads-TikTok-Real-Time-Data",
        "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": {
          "enableVideoKeyword": {
            "title": "Keyword videos",
            "type": "boolean",
            "description": "Find videos by topic/keyword. On by default with sample keywords so you can click Start immediately.",
            "default": true
          },
          "videoKeywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Topics to search (e.g. cooking, gym tips, skincare).",
            "default": [
              "cooking",
              "gym tips"
            ],
            "items": {
              "type": "string"
            }
          },
          "videoMaxResults": {
            "title": "Videos per keyword",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum videos to collect per keyword (1–100).",
            "default": 20
          },
          "videoKeywordFetchEngagement": {
            "title": "Full engagement details",
            "type": "boolean",
            "description": "On by default for keyword videos. Adds plays, likes, comments, shares, music, duration, and cover.",
            "default": true
          },
          "videoKeywordFetchAccountDetails": {
            "title": "Author account details",
            "type": "boolean",
            "description": "Optional. Adds author followers, bio, and verified status on each keyword video row.",
            "default": false
          },
          "videoKeywordMinPlays": {
            "title": "Min play count",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only keyword videos at or above this play count (0 = no filter).",
            "default": 0
          },
          "videoKeywordPublishedWithin": {
            "title": "Published within",
            "enum": [
              "any",
              "7d",
              "30d",
              "90d"
            ],
            "type": "string",
            "description": "Only keep keyword videos published in this time window.",
            "default": "any"
          },
          "enableVideoUrl": {
            "title": "Videos by URL",
            "type": "boolean",
            "description": "Open specific TikTok video links or IDs and save one row per video.",
            "default": false
          },
          "videoUrls": {
            "title": "Video URLs",
            "type": "array",
            "description": "Full TikTok video links (https://www.tiktok.com/@user/video/ID).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "videoIds": {
            "title": "Video IDs",
            "type": "array",
            "description": "Numeric video IDs (optional alternative to URLs).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "videoUrlFetchEngagement": {
            "title": "Full engagement details",
            "type": "boolean",
            "description": "On by default. Ensures full stats are present on each URL video row.",
            "default": true
          },
          "videoUrlFetchAccountDetails": {
            "title": "Author account details",
            "type": "boolean",
            "description": "Optional. Adds author followers, bio, and verified status on each URL video row.",
            "default": false
          },
          "enableVideoRelated": {
            "title": "Related videos",
            "type": "boolean",
            "description": "Load related / recommended videos for seed video URLs.",
            "default": false
          },
          "relatedVideoUrls": {
            "title": "Seed video URLs",
            "type": "array",
            "description": "Source videos for related recommendations. Falls back to Videos by URL list if empty.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "relatedMaxResults": {
            "title": "Related videos per seed",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum related videos per seed video.",
            "default": 16
          },
          "videoRelatedFetchEngagement": {
            "title": "Full engagement details",
            "type": "boolean",
            "description": "On by default for related videos.",
            "default": true
          },
          "videoRelatedFetchAccountDetails": {
            "title": "Author account details",
            "type": "boolean",
            "description": "Optional. Adds author profile fields on each related video row.",
            "default": false
          },
          "enableVideoUser": {
            "title": "Creator video grids",
            "type": "boolean",
            "description": "Pull recent videos from specific creator profiles (without loading full creator rows).",
            "default": false
          },
          "videoUsernames": {
            "title": "Creator usernames",
            "type": "array",
            "description": "Usernames without @ (e.g. charlidamelio).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "videoUserMaxResults": {
            "title": "Videos per creator",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum recent videos per creator.",
            "default": 20
          },
          "videoUserFetchEngagement": {
            "title": "Full engagement details",
            "type": "boolean",
            "description": "On by default for creator grid videos.",
            "default": true
          },
          "videoUserFetchAccountDetails": {
            "title": "Author account details",
            "type": "boolean",
            "description": "Optional. Adds author profile fields on each grid video row.",
            "default": false
          },
          "videoUserMinPlays": {
            "title": "Min play count",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only grid videos at or above this play count (0 = no filter).",
            "default": 0
          },
          "videoUserPublishedWithin": {
            "title": "Published within",
            "enum": [
              "any",
              "7d",
              "30d",
              "90d"
            ],
            "type": "string",
            "description": "Only keep grid videos published in this time window.",
            "default": "any"
          },
          "enableAccounts": {
            "title": "Search or discover creators",
            "type": "boolean",
            "description": "Look up known creator profiles by username/URL, or discover creators by keyword. Each profile is one dataset row (followers, hearts, bio, verified, bio link).",
            "default": false
          },
          "accountMode": {
            "title": "How to find creators",
            "enum": [
              "url",
              "keyword"
            ],
            "type": "string",
            "description": "By username/URL, or discover by keyword then load each profile.",
            "default": "url"
          },
          "accountUsernames": {
            "title": "Usernames",
            "type": "array",
            "description": "TikTok usernames without @ (e.g. charlidamelio). Used when looking up specific profiles.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "accountUrls": {
            "title": "Profile URLs",
            "type": "array",
            "description": "Profile links such as https://www.tiktok.com/@username",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "accountKeywords": {
            "title": "Search / discover keywords",
            "type": "array",
            "description": "Discover creators matching these topics, then load full profiles.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "accountsPerKeyword": {
            "title": "Creators per keyword",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum creators to keep from each keyword search (1–50).",
            "default": 15
          },
          "accountFetchRecentVideos": {
            "title": "Also fetch recent videos",
            "type": "boolean",
            "description": "After each profile, also collect recent posts (separate video rows).",
            "default": false
          },
          "accountRecentVideosMax": {
            "title": "Recent videos per creator",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum recent videos per creator when the option above is on.",
            "default": 12
          },
          "enableTrends": {
            "title": "Hashtags & Sounds",
            "type": "boolean",
            "description": "Collect trending hashtags and sounds, and/or specific hashtags with optional videos.",
            "default": false
          },
          "trendsMode": {
            "title": "Trends mode",
            "enum": [
              "discover",
              "hashtag",
              "all"
            ],
            "type": "string",
            "description": "Discover trending content, specific hashtags, or both.",
            "default": "discover"
          },
          "hashtags": {
            "title": "Hashtags",
            "type": "array",
            "description": "Hashtag names without # (e.g. cooking, gymtok). Used in hashtag mode.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "hashtagFetchVideos": {
            "title": "Fetch videos for hashtags",
            "type": "boolean",
            "description": "Also collect videos under each hashtag. Off = hashtag info only.",
            "default": true
          },
          "hashtagMaxVideos": {
            "title": "Videos per hashtag",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum videos per hashtag when video fetch is on.",
            "default": 20
          },
          "discoverMaxHashtags": {
            "title": "Max discover hashtags",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum trending hashtags to save in discover mode.",
            "default": 40
          },
          "discoverMaxSounds": {
            "title": "Max discover sounds",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum trending sounds to save in discover mode.",
            "default": 20
          },
          "discoverHydrateDetails": {
            "title": "Enrich discover hashtag details",
            "type": "boolean",
            "description": "Add fuller hashtag stats (views, video count, description, cover) on discover results. On by default.",
            "default": true
          },
          "enableSuggestions": {
            "title": "Search Suggestions",
            "type": "boolean",
            "description": "Collect related search phrases and demand language for your keywords.",
            "default": false
          },
          "suggestionKeywords": {
            "title": "Suggestion keywords",
            "type": "array",
            "description": "Keywords to expand. Defaults to video keywords when empty.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "suggestionsMaxResults": {
            "title": "Max suggestions per keyword",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "Maximum suggestion phrases per keyword.",
            "default": 15
          },
          "enableComments": {
            "title": "Comments",
            "type": "boolean",
            "description": "Collect comments via keyword video search, specific video URLs, and/or videos found earlier in this run. One comment = one dataset row.",
            "default": false
          },
          "commentKeywords": {
            "title": "Find videos by keyword",
            "type": "array",
            "description": "Search TikTok for videos matching these topics, then load comments on the top results. Leave empty to use only URLs or run-collected videos.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "commentSearchMaxVideos": {
            "title": "Videos per keyword (for comments)",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many videos to take from each comment keyword search (1–50).",
            "default": 5
          },
          "commentsMaxResults": {
            "title": "Max comments per video",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum comments to save per video.",
            "default": 30
          },
          "commentMinDiggs": {
            "title": "Min comment likes",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only comments with at least this many likes (0 = no filter).",
            "default": 0
          },
          "commentVideoUrls": {
            "title": "Video URLs for comments",
            "type": "array",
            "description": "Optional. Full TikTok video URLs to load comments for (in addition to keyword search).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "commentVideoIds": {
            "title": "Video IDs for comments",
            "type": "array",
            "description": "Optional. Numeric video IDs (alternative to URLs).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "commentsFromSearchResults": {
            "title": "Also comment on run-collected videos",
            "type": "boolean",
            "description": "After keyword / URL / hashtag video collection in this run, also load comments for those videos (up to the cap below).",
            "default": false
          },
          "commentsFromSearchMaxVideos": {
            "title": "Max run videos for comments",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many videos collected earlier in this run get comments (1–50).",
            "default": 10
          },
          "enableScrapeByUrl": {
            "title": "Scrape By URL",
            "type": "boolean",
            "description": "Paste any TikTok video, profile, or hashtag URL — the Actor detects the type automatically.",
            "default": false
          },
          "scrapeUrls": {
            "title": "URLs to scrape",
            "type": "array",
            "description": "TikTok video, @profile, or /tag/ hashtag URLs.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Optional. Every record is always saved to the run’s dataset as it is collected — this webhook is an additional real-time push (CRM, Slack, Zapier, Make, custom API).",
            "default": ""
          },
          "webhookFormat": {
            "title": "Webhook format",
            "enum": [
              "json",
              "slack"
            ],
            "type": "string",
            "description": "json = full record object; slack = short Slack-friendly message.",
            "default": "json"
          },
          "includeRaw": {
            "title": "Include raw data",
            "type": "boolean",
            "description": "Attach extended source fragments on each record. Larger output — for advanced users only.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}