{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok Scraper - Videos, Hashtags, Profiles & Transcripts",
    "description": "Scrape TikTok videos by profile, hashtag, search keyword or video URL: caption, plays, likes, comments, shares, saves, engagement rate, publish date, author stats, sound, resolution, download and subtitle links, optional transcript. Date, like, ad and pinned filters, monitor mode.",
    "version": "0.1",
    "x-build-id": "iQGHxB9favg5QRT91"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/topapi~tiktok-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-topapi-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/topapi~tiktok-scraper/runs": {
      "post": {
        "operationId": "runs-sync-topapi-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/topapi~tiktok-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-topapi-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": {
          "profiles": {
            "title": "😎 Profiles",
            "type": "array",
            "description": "TikTok usernames or profile URLs whose videos you want, e.g. \"tiktok\", \"@zachking\", \"https://www.tiktok.com/@khaby.lame\". Newest videos first, 24-30 per feed page.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "hashtags": {
            "title": "#️⃣ Hashtags",
            "type": "array",
            "description": "Hashtags or tag URLs, e.g. \"cooking\", \"#fyp\", \"https://www.tiktok.com/tag/dance\". Returns the videos TikTok shows on the hashtag page, 28-30 per page.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "🔎 Search queries",
            "type": "array",
            "description": "Keywords to search videos for, e.g. \"cooking recipes\", \"ai tools 2026\", or a search URL. TikTok shows keyword search results only after login (\"Log in to search for popular content\", measured 2026-10-03), so each query is served as the public hashtag feed for the same words (#cookingrecipes); every row carries searchQuery and searchHashtag and the run summary says so.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "postURLs": {
            "title": "🔗 Video URLs",
            "type": "array",
            "description": "Direct video or photo-post URLs, short links or bare ids, e.g. \"https://www.tiktok.com/@zachking/video/7095025543627705643\", \"https://vm.tiktok.com/ZMabc123/\", \"7095025543627705643\". One row per URL, no browser needed; this mode works from every IP class tested.",
            "items": {
              "type": "string"
            }
          },
          "profileSection": {
            "title": "📂 Profile section",
            "enum": [
              "videos",
              "reposts"
            ],
            "type": "string",
            "description": "Which tab of the profile to read. Reposts returns other creators' videos that this profile reposted; the row's authorMeta is the original creator.",
            "default": "videos"
          },
          "profileSorting": {
            "title": "↕️ Profile video sorting",
            "enum": [
              "latest",
              "popular",
              "oldest"
            ],
            "type": "string",
            "description": "Latest walks the profile newest-first so the date window and monitor mode can stop early. Popular and Oldest use TikTok's own sort controls; when TikTok serves no sorted feed to a signed-out session (it happens), the run falls back to latest-first and says so in the log. Hashtag and search feeds are always TikTok's ranking.",
            "default": "latest"
          },
          "oldestPostDate": {
            "title": "📅 Only posts published after",
            "type": "string",
            "description": "Absolute date (2026-09-01, 2026-09-01T12:00:00Z), relative to now (7 days, 3 weeks, 2 months, 1 year) or a day count (1 = today's posts, 2 = yesterday and today). Leave empty for no lower bound."
          },
          "newestPostDate": {
            "title": "📅 Only posts published before",
            "type": "string",
            "description": "Absolute date or relative (e.g. 30 days). Combine with the field above for a window such as oldestPostDate \"2026-01-01\" + newestPostDate \"2026-06-30\"."
          },
          "leastDiggs": {
            "title": "❤️ Minimum likes",
            "minimum": 0,
            "maximum": 1000000000,
            "type": "integer",
            "description": "Keep only posts with at least this many likes (diggCount), e.g. 10000 to keep hits only. 0 = no minimum.",
            "default": 0
          },
          "excludePinnedPosts": {
            "title": "📌 Exclude pinned posts",
            "type": "boolean",
            "description": "Skip the posts a creator pinned to the top of the profile (usually old). They are reported in the run summary.",
            "default": false
          },
          "excludeAds": {
            "title": "📢 Exclude ads and paid partnerships",
            "type": "boolean",
            "description": "Skip posts TikTok marks as ads (isAd) or as paid partnership / branded content (isSponsored). On a 210-post test sample 15% of posts from brand accounts carried one of the two flags.",
            "default": false
          },
          "postType": {
            "title": "🎞️ Post type",
            "enum": [
              "all",
              "video",
              "photo"
            ],
            "type": "string",
            "description": "Photo posts (slideshows) come back with isSlideshow true and their image links in slideshowImageLinks; videoMeta.duration is 0 for them.",
            "default": "all"
          },
          "keywordFilter": {
            "title": "🔤 Keyword filter",
            "type": "string",
            "description": "Keep only posts whose caption, hashtags, on-screen text stickers or author name contain this word or phrase, case-insensitive, e.g. \"giveaway\" or \"recipe, meal prep\" (comma = any of them).",
            "default": ""
          },
          "includeTranscript": {
            "title": "📝 Include transcript (TikTok subtitles)",
            "type": "boolean",
            "description": "Adds the spoken text of the video as plain text (transcript, transcriptLanguage, transcriptSource) from TikTok's own caption files - the creator's captions or TikTok's automatic speech recognition, no AI cost. On a 210-post test sample 72% of videos had a caption file. Charged as the transcript event only for posts that receive one.",
            "default": false
          },
          "monitorMode": {
            "title": "🔁 Only new posts since the last run",
            "type": "boolean",
            "description": "Remembers, per profile / hashtag / query, which posts were already delivered (in the named key-value store below) and returns only new ones. On a profile read latest-first the run stops at the last run's newest post, so a daily check of a 2,000-video account costs one page. A target checked with nothing new delivers nothing and is billed only its feed fee (feed-scraped), the check itself.",
            "default": false
          },
          "monitorStoreName": {
            "title": "🗄️ Monitor memory name",
            "pattern": "^[a-zA-Z0-9-]{1,63}$",
            "type": "string",
            "description": "Name of the key-value store that keeps the per-target memory for monitor mode. Give each separate feed (a client, a Slack channel) its own name so they do not hide posts from each other. Letters, digits and hyphens.",
            "default": "tiktok-posts-monitor"
          },
          "resultsPerPage": {
            "title": "💯 Max posts per profile, hashtag or search",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Cap per target after filters (your main cost control; you pay per delivered post plus one feed fee per profile, hashtag or search). 0 = everything TikTok serves (a profile with 1,500 videos takes about 60 feed pages). TikTok serves 24-30 posts per profile or hashtag page and 12 per search page.",
            "default": 30
          },
          "maxItems": {
            "title": "🔢 Max posts in total",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Hard cap for the whole run across all targets. 0 = no total cap (each target is still capped above).",
            "default": 0
          },
          "compact": {
            "title": "🤖 Compact output",
            "type": "boolean",
            "description": "Core fields only (id, text, createTimeISO, webVideoUrl, author, authorFans, plays, likes, comments, shares, saves, engagementRate, duration, hashtags, transcript if requested): about a tenth of the bytes, sized for AI agents and MCP clients.",
            "default": false
          },
          "debugScreenshots": {
            "title": "📸 Save a screenshot when TikTok serves no feed",
            "type": "boolean",
            "description": "When a profile, hashtag or search page serves no posts, save a screenshot of what the browser saw to the run's key-value store (NOFEED-<kind>-<n>). Useful when you report an empty run to us.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "🌍 Proxy",
            "type": "object",
            "description": "Residential proxies are required for profile, hashtag and search feeds: TikTok answers datacenter IPs with empty feed pages (measured). Video URLs and subtitle files are fetched through datacenter proxies automatically because TikTok serves those to any IP. Pick a proxy country to see a market's feed.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "US"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}