# TikTok Video Scraper (`datahamster/tiktok-video-scraper`) Actor

TikTok video scraper for public video links: views, likes, comments, shares, saves, description, hashtags, duration, sound and caption text. No login. Monitor mode reports a video again when a count moves by 5% or more. Only the creator's public handle is kept.

- **URL**: https://apify.com/datahamster/tiktok-video-scraper.md
- **Developed by:** [Viktor Dubnytskiy](https://apify.com/datahamster) (community)
- **Categories:** Social media, Videos
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.68 / 1,000 result items

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## TikTok Video Scraper

TikTok Video Scraper turns a list of TikTok video links into one row per video with its view, like, comment, share and save counts, the description, hashtags, duration, posting date, the sound it uses and, when TikTok has captions, the spoken text. You do not need a TikTok account, cookies or an API key.

**Try it:** the prefilled example returns 2 rows in about 10 seconds and costs about $0.005. Results cost $2.10 per 1,000.

### What you get

Real rows from the example dataset:

| authorHandle | description | playCount | likeCount | commentCount | saveCount | durationSeconds | subtitleLanguages |
|---|---|---|---|---|---|---|---|
| `waitguysidk67` | "#xc #track #running " | `2400000` | `599200` | `326` | `39565` | `6` | `[]` |
| `freesmoke2377` | "Come run 6 miles with me Day 2 🏃 #running #6miles..." | `108600` | `13100` | `94` | `479` | `132` | `eng-US` |

With `includeSubtitles: true`, a video that has captions also carries its text (`transcriptLanguage: eng-US`):

> Alright, good morning Jay. It's 9:00am. We're going on a Six Mile Run today. Don't mind my voice. I don't know how I lost it but we still gonna get to it. ...

Full row: `id`, `videoId`, `url`, `authorHandle`, `description`, `createdAt`, `durationSeconds`, `playCount`, `likeCount`, `commentCount`, `shareCount`, `saveCount`, `hashtags`, `musicTitle`, `musicAuthor`, `musicIsOriginal`, `coverUrl`, `videoPlayUrl`, `language`, `isAd`, `subtitleLanguages`, `transcript`, `transcriptLanguage`, `query`, `scrapedAt`.

The only thing collected about the uploader is the public handle that is already part of the video link. Display name, avatar, bio and follower counts are never read. For an "original sound" TikTok names the uploader as the sound's author, so `musicAuthor` is left empty there and filled only for catalogue tracks.

### Related actors

- [YouTube Transcript Scraper](https://apify.com/datahamster/youtube-transcript-scraper) gets the same kind of spoken text from YouTube videos.
- [YouTube Shorts Scraper](https://apify.com/datahamster/youtube-shorts) lists short videos of a YouTube channel with their view counts.
- [Facebook Reels Scraper](https://apify.com/datahamster/facebook-reels-videos) returns reels of Facebook Pages with views and reactions.
- [YouTube Comments Scraper](https://apify.com/datahamster/youtube-comments) reads the comment text and like counts under a video.

### Use cases

- Track how a campaign video or a competitor's post grows, day by day, without opening the app.
- Build a spreadsheet of views, likes and saves for a list of creator videos you sponsor.
- Pull the caption text of videos for search, summaries or content research.

### Monitor mode

Save the input as a task, set **Mode** to `monitor` and put it on a schedule (for example every 6 hours). Each run returns a video again only when one of its counts moved by at least 5% since the last time it was reported, or when captions appeared. Small changes add up: a video that grows 3% per run is reported on the second run, because the comparison is against the last reported numbers.

### Input

| Field | Meaning | Default |
|---|---|---|
| `videoUrls` | TikTok video links (`https://www.tiktok.com/@handle/video/<id>`) or bare numeric video ids | two example videos |
| `includeSubtitles` | Also download the caption file and return its text when TikTok has captions | `false` |
| `maxItems` | Stop after this many video rows | `20` |
| `mode` | `scrape` or `monitor` | `scrape` |
| `monitorStateId`, `webhookUrl`, `telegramBotToken`, `telegramChatId` | Monitor state key and alert targets | empty |

### Pricing

| Event | Price |
|---|---|
| result | $0.0021 per video ($2.10 per 1,000) |
| monitor-check | $0.005 per monitor run |
| change | $0.0021 per video reported in monitor mode |

Apify Store discounts: SILVER -10%, GOLD and higher -20% on every event. You pay only for rows that are pushed. A removed or private video produces no row and no charge. Proxy traffic is billed by Apify on top when TikTok blocks the free tier and the actor moves to a datacenter or residential proxy.

**Found it useful?** A short review on the Store page helps other people find this actor and tells us what to improve. If something is wrong, open an issue on the actor page.

### How it works

1. Each link is opened as a normal logged-out TikTok video page and the video's data is read from the JSON that TikTok embeds in that page.
2. With `includeSubtitles`, the caption file linked in that JSON is downloaded and turned into plain text. TikTok has captions for roughly one video in four, mostly videos with speech.
3. If TikTok answers with a block or an empty page, the request is retried and then repeated through a datacenter and then a residential proxy. When every video of a run is blocked on every proxy, the run stops with a "blocked" reason instead of returning an empty dataset.

### Limits

- **Large view counts are rounded by TikTok** (for example `324000` or `2400000`). Likes on big videos can be rounded too. The actor returns the numbers TikTok serves.
- **Links only.** The actor reads the videos you list. It does not search TikTok, list a profile's videos or follow short `vm.tiktok.com` links; open a short link once and paste the full address.
- **`coverUrl` and `videoPlayUrl` are signed links that expire** after a few days, and the play link may not open outside TikTok. Download them soon after the run if you need the files.
- **Captions exist only when TikTok made them.** For videos without speech `subtitleLanguages` is empty and `transcript` is `null`. Auto-generated captions can contain recognition errors.

### FAQ

**Do I need a TikTok account?** No. Every request is a logged-out page view.

**What happens with a deleted or private video?** It is skipped without a charge, and the run continues with the other links. The run summary counts it.

**Why is the handle the only creator field?** The handle is already part of the video link. Display names, avatars, bios and follower counts are personal profile data and are not collected.

### Changelog

- 0.1: first release with video counts, description, hashtags, sound, captions and monitor mode with a 5% change threshold.

# Actor input Schema

## `videoUrls` (type: `array`):

TikTok video links such as https://www.tiktok.com/@handle/video/7700972795269827854, or bare numeric video ids, one per line.

## `includeSubtitles` (type: `boolean`):

Also download the caption file and return its text in transcript when TikTok has captions for the video (about one video in four).

## `maxItems` (type: `integer`):

Stop after this many video rows (you are charged only for pushed rows)

## `mode` (type: `string`):

scrape = full results; monitor = only new/changed items since the previous run of this task

## `monitorStateId` (type: `string`):

Optional state id when not running as a saved task (monitor mode)

## `webhookUrl` (type: `string`):

POST a change summary here in monitor mode

## `telegramBotToken` (type: `string`):

Optional: bot token for monitor-mode change summaries

## `telegramChatId` (type: `string`):

Optional: chat id that receives monitor-mode summaries

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.tiktok.com/@waitguysidk67/video/7700972795269827854",
    "https://www.tiktok.com/@freesmoke2377/video/7700720624917925134"
  ],
  "includeSubtitles": true,
  "maxItems": 20,
  "mode": "scrape"
}
```

# Actor output Schema

## `results` (type: `string`):

All pushed rows (dataset, JSON)

## `resultsTable` (type: `string`):

Dataset in the Console viewer

## `runSummary` (type: `string`):

RUN_SUMMARY record

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "videoUrls": [
        "https://www.tiktok.com/@waitguysidk67/video/7700972795269827854",
        "https://www.tiktok.com/@freesmoke2377/video/7700720624917925134"
    ],
    "includeSubtitles": true,
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("datahamster/tiktok-video-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "videoUrls": [
        "https://www.tiktok.com/@waitguysidk67/video/7700972795269827854",
        "https://www.tiktok.com/@freesmoke2377/video/7700720624917925134",
    ],
    "includeSubtitles": True,
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("datahamster/tiktok-video-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "videoUrls": [
    "https://www.tiktok.com/@waitguysidk67/video/7700972795269827854",
    "https://www.tiktok.com/@freesmoke2377/video/7700720624917925134"
  ],
  "includeSubtitles": true,
  "maxItems": 20
}' |
apify call datahamster/tiktok-video-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,datahamster/tiktok-video-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/cSLMzBXc1zPth2z73/builds/GoqE4Ws2ukzZS09rL/openapi.json
