{
  "openapi": "3.0.1",
  "info": {
    "title": "Tiktok Scraper",
    "description": "TikTok scraper API for videos, profiles, hashtags, search & comments. Export views, likes, captions, music, bio links & download MP4s. Best TikTok data extractor for AI agents, ChatGPT, Claude & lead gen—JSON dataset, region cookies, proxies, transcripts & AI video summary.",
    "version": "0.0",
    "x-build-id": "aZmKb3I0lx9lDPZRb"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/market_flow~tiktok-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-market_flow-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/market_flow~tiktok-scraper/runs": {
      "post": {
        "operationId": "runs-sync-market_flow-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/market_flow~tiktok-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-market_flow-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": {
          "resultsPerPage": {
            "title": "Number of videos per hashtag, profile or search",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Caps how many video dataset rows you get per hashtag, per profile, or per search query.",
            "default": 100
          },
          "hashtags": {
            "title": "Hashtags",
            "type": "array",
            "description": "Hashtags to collect videos for (without #). Each hashtag adds matching video rows to the dataset.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "profiles": {
            "title": "Usernames",
            "type": "array",
            "description": "Profiles to collect. Accepts username, @user, or a profile URL. Adds author and video rows to the dataset.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "profileScrapeSections": {
            "title": "Profile sections to scrape",
            "enum": [
              "videos",
              "reposts",
              "stories"
            ],
            "type": "string",
            "description": "Which profile content to include. Videos returns the profile’s posts as video rows. Reposts and Stories are not returned yet.",
            "default": "videos"
          },
          "profileSorting": {
            "title": "Profile video sorting",
            "enum": [
              "latest",
              "oldest",
              "popular"
            ],
            "type": "string",
            "description": "Sort order of that profile’s video rows in the dataset: latest, oldest, or popular.",
            "default": "latest"
          },
          "excludePinnedPosts": {
            "title": "Exclude pinned posts",
            "type": "boolean",
            "description": "When on, pinned posts are omitted from the profile’s video rows.",
            "default": false
          },
          "oldestPostDateUnified": {
            "title": "Date filter — videos published after",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$|^(\\d+)\\s*(day|week|month|year)s?$",
            "type": "string",
            "description": "Only keep video rows newer than this. Use Absolute (YYYY-MM-DD) or Relative (e.g. <code>7 days</code>, <code>2 weeks</code>). Empty = no filter."
          },
          "newestPostDate": {
            "title": "Date filter — videos published before",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$",
            "type": "string",
            "description": "Only keep video rows older than this date (YYYY-MM-DD). Empty = no filter."
          },
          "mostDiggs": {
            "title": "Popularity filter — hearts <",
            "minimum": 0,
            "type": "integer",
            "description": "Only keep video rows with fewer hearts (likes) than this number."
          },
          "leastDiggs": {
            "title": "Popularity filter — hearts ≥",
            "minimum": 0,
            "type": "integer",
            "description": "Only keep video rows with at least this many hearts (likes)."
          },
          "maxFollowersPerProfile": {
            "title": "Maximum number of followers profiles",
            "minimum": 0,
            "type": "integer",
            "description": "Optional cap for follower-list rows per profile. 0 = do not return follower lists.",
            "default": 0
          },
          "maxFollowingPerProfile": {
            "title": "Maximum number of following profiles",
            "minimum": 0,
            "type": "integer",
            "description": "Optional cap for following-list rows per profile. 0 = do not return following lists.",
            "default": 0
          },
          "searchQueries": {
            "title": "Search queries",
            "type": "array",
            "description": "Keywords to search. Each query adds matching video and/or author rows to the dataset.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "searchSection": {
            "title": "Top/Video/Profile section",
            "enum": [
              "top",
              "video",
              "profile"
            ],
            "type": "string",
            "description": "What the search returns: Top = mixed video/author rows, Video = videos only, Profile = authors only.",
            "default": "top"
          },
          "maxProfilesPerQuery": {
            "title": "Number of profiles per query",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "When section is Profile: how many author rows to return per search query.",
            "default": 10
          },
          "videoSearchSorting": {
            "title": "Video search sorting",
            "enum": [
              "MOST_RELEVANT",
              "MOST_LIKED",
              "DATE_POSTED"
            ],
            "type": "string",
            "description": "Order of video rows from Video search: most relevant, most liked, or date posted.",
            "default": "MOST_RELEVANT"
          },
          "videoSearchDateFilter": {
            "title": "Video search date filter",
            "enum": [
              "ALL_TIME",
              "YESTERDAY",
              "THIS_WEEK",
              "THIS_MONTH",
              "LAST_THREE_MONTHS",
              "LAST_SIX_MONTHS"
            ],
            "type": "string",
            "description": "Only keep Video-search video rows from this time window (all time, yesterday, this week, …).",
            "default": "ALL_TIME"
          },
          "scrapeRelatedSearchWords": {
            "title": "Scrape related search words",
            "type": "boolean",
            "description": "When on, the search result also includes <code>related_words</code>: a list of related keyword strings.",
            "default": false
          },
          "pageURLs": {
            "title": "Page URLs",
            "type": "array",
            "description": "TikTok links to collect. Supports video, profile, hashtag, explore, music, and short links. Adds matching rows to the dataset.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "scrapeRelatedVideos": {
            "title": "Scrape related videos",
            "type": "boolean",
            "description": "For video page URLs only: also return related video rows (same video fields) with <code>related_to</code> (parent video id) and <code>isRelated: true</code>.",
            "default": false
          },
          "scrapeAdditionalAuthorMetadata": {
            "title": "Scrape additional author profile metadata",
            "type": "boolean",
            "description": "Also return fuller author rows for creators found on the pages: author, author_followers, signature, profile_url, bio_link, and related author fields.",
            "default": false
          },
          "downloadVideos": {
            "title": "Download videos",
            "type": "boolean",
            "description": "When on, video rows get <code>video_file</code> / <code>videoFileURL</code>. Output also includes <code>videosStorageURL</code> (folder of saved files). If that video id was already saved, it is skipped and <code>video_download_skipped</code> is true.",
            "default": false
          },
          "downloadMusics": {
            "title": "Download music",
            "type": "boolean",
            "description": "When on, video rows get <code>music_file</code> / <code>musicFileURL</code> from TikTok <code>music.playUrl</code> (audio only, not the video). Output also includes <code>musicStorageURL</code>. Same <code>music_id</code> is downloaded once and reused; already-saved files set <code>music_download_skipped</code>.",
            "default": false
          },
          "downloadSubtitles": {
            "title": "Download subtitles",
            "type": "boolean",
            "description": "When on, video rows get <code>subtitles</code>, <code>subtitle_files</code>, and <code>subtitle_text</code> when TikTok provides captions. Not every video has them.",
            "default": false
          },
          "subtitleLanguage": {
            "title": "Preferred subtitle language",
            "type": "string",
            "description": "Language code preferred for subtitle_text when several tracks exist (e.g. en, ur). Empty = first available track.",
            "default": ""
          },
          "commentsPerPost": {
            "title": "Maximum comments per post",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Max comment rows (top-level + replies) returned per video. 0 = no comments.",
            "default": 0
          },
          "topLevelCommentsPerPost": {
            "title": "Maximum top-level comments per post",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Max root comment rows per video (not replies). 0 = use the total comments limit above.",
            "default": 0
          },
          "maxRepliesPerComment": {
            "title": "Maximum replies per comment",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Max reply comment rows under each root comment. 0 = no replies.",
            "default": 0
          },
          "readLinkInBioPages": {
            "title": "Read link-in-bio pages",
            "type": "boolean",
            "description": "When on, rows may include bio_link, bio_link_platform, bio_link_status, bio_link_title, bio_link_description, bio_link_emails, bio_link_phones, bio_link_socials, bio_link_child_links.",
            "default": false
          },
          "aiVideoDescription": {
            "title": "AI video description",
            "type": "boolean",
            "description": "When on, video rows get an <code>ai_description</code> string describing the video.",
            "default": false
          },
          "aiVideoSummary": {
            "title": "AI video summary",
            "type": "boolean",
            "description": "When on, video rows get an <code>ai_summary</code> string summarizing the video.",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}