{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok Scraper: Videos, Profiles, Comments, Sounds & Places",
    "description": "Scrape TikTok videos, profiles, hashtag feeds, keyword searches, sounds, places, followers, Shop products and comments. Full metadata: description, author, plays, likes, comments, shares, saves, music, video URLs, covers. No browser and no login; 256 MB.",
    "version": "0.1",
    "x-build-id": "9alit6gmBglji8Rai"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nextgensda~tiktok-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nextgensda-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/nextgensda~tiktok-scraper/runs": {
      "post": {
        "operationId": "runs-sync-nextgensda-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/nextgensda~tiktok-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-nextgensda-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",
        "properties": {
          "videos": {
            "title": "Video URLs or IDs",
            "type": "array",
            "description": "TikTok video URLs (<code>https://www.tiktok.com/@user/video/123…</code>) or numeric video IDs. Full metadata, including the playable video URL. <code>vm.tiktok.com</code> short links are not supported: open the link and copy the redirected URL.",
            "items": {
              "type": "string"
            }
          },
          "profiles": {
            "title": "Profiles",
            "type": "array",
            "description": "Profile URLs, <code>@handles</code> or <code>sec_uid</code>s. A row per profile (followers, following, hearts, videos, bio), plus its recent videos up to <b>Max videos per profile</b>.",
            "items": {
              "type": "string"
            }
          },
          "searches": {
            "title": "Search keywords",
            "type": "array",
            "description": "Video results for each keyword, in TikTok's order. TikTok returns about 80 distinct videos per query; use more specific queries for more.",
            "items": {
              "type": "string"
            }
          },
          "hashtags": {
            "title": "Hashtags",
            "type": "array",
            "description": "Videos in each hashtag's feed (<code>cats</code>, <code>#cats</code> or a <code>tiktok.com/tag/…</code> URL).",
            "items": {
              "type": "string"
            }
          },
          "sounds": {
            "title": "Sounds",
            "type": "array",
            "description": "Sound URLs (<code>tiktok.com/music/…-123</code>) or numeric sound ids. One <code>sound</code> row (title, author, duration, cover, play URL, video count) plus the videos that use it, up to <b>Max videos per sound</b>.",
            "items": {
              "type": "string"
            }
          },
          "locations": {
            "title": "Locations",
            "type": "array",
            "description": "Place URLs (<code>tiktok.com/place/…-123</code>) or numeric place ids. One <code>location</code> row (name, address, city, category, coordinates, video count, cover) plus the videos posted there, up to <b>Max videos per location</b>.",
            "items": {
              "type": "string"
            }
          },
          "userSearches": {
            "title": "User searches",
            "type": "array",
            "description": "Keywords to find users by (name or handle): a profile row per match, up to <b>Max users per search</b>.",
            "items": {
              "type": "string"
            }
          },
          "followersOf": {
            "title": "Followers of",
            "type": "array",
            "description": "Profiles whose <b>followers</b> to list (URL, <code>@handle</code> or sec_uid): one <code>profile</code> row per follower, up to <b>Max followers per profile</b>. Works without a TikTok login.",
            "items": {
              "type": "string"
            }
          },
          "followingOf": {
            "title": "Following of",
            "type": "array",
            "description": "Profiles whose <b>following</b> list to read: one <code>profile</code> row per account they follow.",
            "items": {
              "type": "string"
            }
          },
          "feedItems": {
            "title": "For You feed items",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Videos from the For You feed, in TikTok's algorithmic order for the selected region (US by default). 0 disables it; the feed is not reproducible between runs.",
            "default": 0
          },
          "maxVideosPerProfile": {
            "title": "Max videos per profile",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Recent videos to read for each profile above. 0 = profile rows only.",
            "default": 20
          },
          "region": {
            "title": "Region",
            "pattern": "^[A-Za-z]{2}$",
            "type": "string",
            "description": "Two-letter country code (US, GB, DE, JP…) whose catalogue to read. Empty = US. This is a data filter, not a proxy setting: results differ (two runs in one region share ~90% of their videos, two regions ~55%)."
          },
          "postedWithinDays": {
            "title": "Only videos posted within (days)",
            "minimum": 0,
            "maximum": 3650,
            "type": "integer",
            "description": "0 = any date. Otherwise TikTok's own search filter is used (1, 7, 30, 90 or 180 days). It filters the same candidate pool the search would return, so a short window returns far fewer videos (measured: 1–4 for a generic keyword in 1–30 days). Hashtags are filtered on our side because their stream ignores the filter.",
            "default": 0
          },
          "sortBy": {
            "title": "Sort order",
            "enum": [
              "relevance",
              "likes",
              "latest"
            ],
            "type": "string",
            "description": "TikTok's search ordering. Applies to keyword searches only.",
            "default": "relevance"
          },
          "searchVariants": {
            "title": "Search variants",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Extra requests per keyword, one per hashtag that two or more results carry (for example <code>cat #catsoftiktok</code>), which returns a different slice of the topic. One request answers ~50–110 videos and does not paginate, so this is the depth lever: each variant adds ~10–15 videos. 0 = the single stream only.",
            "default": 2
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "native",
              "clockworks",
              "apidojo"
            ],
            "type": "string",
            "description": "Field layout of each row. <b>Native</b> is this actor's own flat schema. <b>Clockworks</b> emits <code>authorMeta</code>, <code>musicMeta</code>, <code>videoMeta</code>, <code>diggCount</code>, <code>webVideoUrl</code>, <code>createTimeISO</code>. <b>apidojo</b> emits <code>views</code>/<code>likes</code>, <code>channel</code>, <code>video</code>, <code>song</code>, <code>postPage</code>. Values TikTok does not publish (a video's author follower counts, song album, hashtag ids) are null, not invented.",
            "default": "native"
          },
          "maxItemsPerSearch": {
            "title": "Max videos per search",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Videos kept per keyword or hashtag. One search stream answers ~50–110 videos; <b>Search variants</b> adds more.",
            "default": 120
          },
          "maxUsersPerSearch": {
            "title": "Max users per user search",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Profile rows kept per keyword in <b>User searches</b>.",
            "default": 20
          },
          "maxItemsPerSound": {
            "title": "Max videos per sound",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Videos read for each sound above. 0 = the sound row only.",
            "default": 100
          },
          "maxItemsPerLocation": {
            "title": "Max videos per location",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Videos read for each place above (9 per API request). 0 = the location row only.",
            "default": 100
          },
          "maxFollowersPerProfile": {
            "title": "Max followers/following per profile",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Accounts listed per input in <b>Followers of</b> / <b>Following of</b> (20 per API request).",
            "default": 200
          },
          "maxItems": {
            "title": "Max rows in total",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "The run stops after this many rows (videos, profiles and comments together).",
            "default": 1000
          },
          "requestDelayMs": {
            "title": "Delay between requests",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Milliseconds between API requests. Raising it is gentler on TikTok; lowering it makes runs faster.",
            "default": 250
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Read each video's comments and save one row per comment. Applies to every video this run delivers.",
            "default": false
          },
          "maxCommentsPerVideo": {
            "title": "Max comments per video",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Comments read per video, in TikTok's order. 0 reads video rows without comments.",
            "default": 50
          },
          "includeReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "Also read replies to each comment (one extra request per comment with replies). Needs <b>Include comments</b>.",
            "default": false
          },
          "maxRepliesPerComment": {
            "title": "Max replies per comment",
            "minimum": 0,
            "maximum": 200,
            "type": "integer",
            "description": "Replies saved per comment; 0 disables reply reads even when <b>Include replies</b> is on.",
            "default": 0
          },
          "includeProducts": {
            "title": "Include TikTok Shop products",
            "type": "boolean",
            "description": "Emit one <code>product</code> row per product a delivered video sells (product id, title, seller, image), read from the video's own Shop anchor. TikTok does not serve a product catalogue to a logged-out app, so products come from videos.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "The default is Apify Proxy (datacenter): TikTok answers from it directly. If TikTok starts refusing the exits, switch to the RESIDENTIAL group — a new session is used automatically when a request is refused.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}