{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok Video Scraper - Stats, Transcript & Download by URL",
    "description": "Scrape TikTok videos and photo posts from a list of URLs, short links or ids: plays, likes, comments, shares, saves, engagement rate, publish date, author stats, sound, every video quality, download links, subtitles and transcript. Monitor mode re-checks the same posts, returns only changed counts.",
    "version": "0.1",
    "x-build-id": "AG1c8wimeer7jjwBf"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/topapi~tiktok-video-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-topapi-tiktok-video-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-video-scraper/runs": {
      "post": {
        "operationId": "runs-sync-topapi-tiktok-video-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-video-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-topapi-tiktok-video-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": {
          "postURLs": {
            "title": "🔗 Video URLs or ids",
            "type": "array",
            "description": "TikTok post links or ids, one per line, e.g. \"https://www.tiktok.com/@zachking/video/7095025543627705643\", \"https://vt.tiktok.com/ZSjSKrdXn/\", \"7172183875538488582\". Photo posts (/photo/), m.tiktok.com/v/, embed/v2/ and share links work too. Duplicates are fetched once.",
            "items": {
              "type": "string"
            }
          },
          "postedAfter": {
            "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."
          },
          "postedBefore": {
            "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 postedAfter \"2026-01-01\" + postedBefore \"2026-06-30\"."
          },
          "minPlays": {
            "title": "▶️ Minimum plays",
            "minimum": 0,
            "maximum": 100000000000,
            "type": "integer",
            "description": "Keep only posts with at least this many plays (playCount), e.g. 100000. 0 = no minimum.",
            "default": 0
          },
          "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"
          },
          "onlyWithSubtitles": {
            "title": "🔤 Only posts that have subtitles",
            "type": "boolean",
            "description": "Keep only posts for which TikTok publishes a caption file (videoMeta.subtitleLinks). Useful with the transcript add-on: on the test set every video post had at least one caption file, photo posts never do.",
            "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). Skipped posts are listed in the run summary.",
            "default": false
          },
          "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. Charged as the transcript event only for posts that receive one.",
            "default": false
          },
          "downloadVideos": {
            "title": "⬇️ Download the video files",
            "type": "boolean",
            "description": "Saves each video (MP4) or a photo post's images to a key-value store and puts the stored file's URL on the row (mediaFile, videoMeta.downloadAddr); TikTok's own link stays in originalDownloadAddr. Charged as video-downloaded only for posts whose file was stored; files over ~75 MB are skipped.",
            "default": false
          },
          "mediaStoreName": {
            "title": "🗄️ Store downloaded files in",
            "pattern": "^[a-zA-Z0-9-]{0,63}$",
            "type": "string",
            "description": "Name of a key-value store to keep the downloaded files in, e.g. \"tiktok-videos\". Leave empty to use the run's own store (files then expire with the run's data retention). Letters, digits and hyphens."
          },
          "includeUnavailable": {
            "title": "🚫 Include unavailable posts as rows",
            "type": "boolean",
            "description": "Write a row (status, errorCode, error, input) for posts that are private, removed, restricted or not found, so a bulk list comes back complete. Off: unavailable posts appear only in the run summary.",
            "default": false
          },
          "monitorMode": {
            "title": "🔁 Deliver only new posts and changed counts",
            "type": "boolean",
            "description": "Remembers each post's last plays, likes, comments, shares, saves and reposts in the named key-value store below. A re-run delivers a post only if it is new to the store or any count changed, with previousStats, statsDelta and isNew on the row.",
            "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-post memory for monitor mode. Give each campaign or client its own name so they do not hide changes from each other. Letters, digits and hyphens.",
            "default": "tiktok-video-monitor"
          },
          "maxItems": {
            "title": "🔢 Max posts to deliver",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop after this many delivered posts (your cost cap; you pay per delivered post). 0 = every URL in the list. One run handles thousands of URLs; TikTok has no per-run ceiling here because every post is its own page.",
            "default": 0
          },
          "compact": {
            "title": "🤖 Compact output",
            "type": "boolean",
            "description": "Core fields only (id, status, text, date, URL, author, authorFans, plays, likes, comments, shares, saves, reposts, engagementRate, duration, hashtags, musicName, coverUrl, transcript and statsDelta when requested): about a tenth of the bytes, sized for AI agents and MCP clients.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "🌍 Proxy",
            "type": "object",
            "description": "The fallback egress. Each page is first fetched from Apify's own IPs (served, measured 3x faster); the first wall switches the run to this proxy. Datacenter is enough for TikTok video pages, residential is not needed. Files come straight from TikTok's CDN.",
            "default": {
              "useApifyProxy": true
            }
          },
          "maxConcurrency": {
            "title": "⚡ Parallel requests",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many posts are fetched at the same time. 10 parallel fetches of 400 KB pages ran in under 2 s on the test; the default 5 is safe for lists of thousands.",
            "default": 5
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}