# TikTok Scraper (`rainminer/tiktok-scraper`) Actor

Scrape public TikTok videos, creator profiles, hashtags, and keyword search. Export captions, engagement stats, author and music metadata, thumbnails, and canonical video URLs as JSON or CSV. Paste video links, @profiles, #hashtags, or search queries — no login required.

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

## Pricing

from $0.94 / 1,000 tiktok videos

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
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

The **TikTok Scraper** collects **public TikTok videos** from video URLs, **creator profiles**, **hashtags**, and **keyword search**. Export captions, play counts, likes, shares, author and music metadata, cover images, and canonical video links as JSON or CSV — no login required.

![TikTok](https://upload.wikimedia.org/wikipedia/en/thumb/a/a9/TikTok_logo.svg/320px-TikTok_logo.svg.png)

***

### What does TikTok Scraper do?

Use this Actor when you need structured TikTok video data for research, monitoring, or pipelines — similar to a general-purpose TikTok scraper on Apify Store, built for **public pages only**:

- Scrape **individual video URLs** (`/@user/video/{id}`)
- Scrape **recent public videos** from **@profiles**
- Scrape videos from **#hashtag** pages
- Scrape **video search** results from keywords
- Run on the **Apify platform** with scheduling, API, webhooks, and dataset export

**Residential proxies** (US or your target market) are strongly recommended — TikTok often blocks datacenter IPs.

***

### What data can you extract?

| Field | Description |
| ----- | ----------- |
| `id` | TikTok video id |
| `webVideoUrl` / `videoUrl` | Canonical public video URL |
| `text` | Video caption |
| `createTime` | Publish time (ISO) |
| `authorMeta` | Author id, `@handle`, nickname, verified, avatar, profile URL |
| `musicMeta` | Sound id, title, artist, cover |
| `videoMeta` | Duration, width, height, cover |
| `playCount`, `diggCount`, `shareCount`, `commentCount`, `collectCount` | Engagement stats when exposed |
| `hashtags` | Hashtags from caption and metadata |
| `imageUrl` | Cover / thumbnail URL |
| `inputSource` | Which input produced the row |
| `scrapedAt` | Scrape timestamp |

***

### How to scrape TikTok videos

1. Open the Actor in [Apify Console](https://console.apify.com/)
2. Add **video URLs**, **profiles**, **hashtags**, or **search queries** (or paste mixed URLs in **Start URLs**)
3. Set **Max videos per input** (start small, e.g. 5)
4. Enable **Apify residential proxies** if runs return empty data
5. Click **Start** and download JSON, CSV, or Excel from the **Output** tab

***

### Input

| Field | Description |
| ----- | ----------- |
| `startUrls` | Video, profile, hashtag, or search URLs |
| `postURLs` | Video URLs only |
| `profiles` | `@handle` or profile URL |
| `hashtags` | Hashtag name (with or without `#`) |
| `searchQueries` | Keywords for video search |
| `maxItems` | Max videos **per** input source (default `5`) |
| `proxyConfiguration` | Proxy settings (residential recommended) |

Example:

```json
{
  "postURLs": [
    "https://www.tiktok.com/@khaby.lame/video/7631024397754600735"
  ],
  "profiles": ["khaby.lame"],
  "hashtags": ["fyp"],
  "searchQueries": ["coffee"],
  "maxItems": 5,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"],
    "apifyProxyCountry": "US"
  }
}
```

***

### Output

Each dataset row is one **public TikTok video**. Nested objects (`authorMeta`, `musicMeta`, `videoMeta`) are included for integrations; flat fields like `authorUniqueId` and `imageUrl` power Console table views.

***

### Pricing

This Actor uses **pay-per-event** pricing on Apify: you are charged per **video row** saved to the dataset. Check the **Pricing** tab on the Actor page for current rates.

***

### Differences from clockworks/tiktok-scraper

This Actor targets the same core job — **public videos** from URLs, profiles, hashtags, and search — with a smaller surface area for easier self-hosting and maintenance.

| Reference feature | rainminer/tiktok-scraper |
| --- | --- |
| Video / profile / hashtag / search inputs | Supported (`startUrls`, `postURLs`, `profiles`, `hashtags`, `searchQueries`) |
| Comments, followers/following lists | Not supported |
| Video/cover/subtitle/avatar **downloads** to key-value store | Not supported (metadata + cover **URL** in dataset only) |
| Date / digg filters, pinned-post exclusion, profile sections | Not supported |
| Output | Flat + nested `authorMeta`, `musicMeta`, `videoMeta`; uses `webVideoUrl`, `text`, `createTime`, stats fields |

Extra Clockworks input keys are accepted in JSON but ignored unless listed in the **Input** table above. For parity testing, use `fixtures/PARITY.json` copied to `storage/.../INPUT.json` before local runs.

**Pre-monetization testing:** run every README input mode via `fixtures/input-matrix/` and `./scripts/copycat-run-input-matrix.sh tiktok-scraper` (see repo `.agents/copycat-input-matrix.md`).

***

### Tips

- Prefer full `https://www.tiktok.com/@user/video/{id}` links over short `vm.tiktok.com` links when possible.
- If you see challenge pages or empty datasets, switch to **residential** proxies and lower concurrency.
- `maxItems` applies **per input** (each profile, hashtag, search query, or URL), not globally across the whole run.

***

### Integrations

Export via Apify API, webhooks, or schedule runs in Console. Connect datasets to Google Sheets, BigQuery, or your own pipeline.

***

### Image Credit

Image credit: [TikTok](https://www.tiktok.com/)

# Actor input Schema

## `startUrls` (type: `array`):

Public TikTok URLs: video pages, @profiles, #hashtag pages, or search/video links.

## `postURLs` (type: `array`):

Public TikTok video URLs (/@user/video/{id}).

## `profiles` (type: `array`):

TikTok @handles or profile URLs to scrape recent public videos from.

## `hashtags` (type: `array`):

Hashtag names (with or without #) to scrape trending public videos.

## `searchQueries` (type: `array`):

Keywords for TikTok video search.

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

Maximum number of videos to save per start URL, profile, hashtag, or search query. Same role as clockworks `resultsPerPage` for list inputs.

## `resultsPerPage` (type: `integer`):

Alias for clockworks/tiktok-scraper. When set, applies as max videos per list input if maxItems is omitted.

## `shouldDownloadVideos` (type: `boolean`):

clockworks compatibility flag — not implemented; metadata only.

## `shouldDownloadCovers` (type: `boolean`):

clockworks compatibility flag — not implemented.

## `shouldDownloadSubtitles` (type: `boolean`):

clockworks compatibility flag — not implemented.

## `shouldDownloadSlideshowImages` (type: `boolean`):

clockworks compatibility flag — not implemented.

## `shouldDownloadAvatars` (type: `boolean`):

clockworks compatibility flag — not implemented.

## `proxyConfiguration` (type: `object`):

TikTok often requires residential proxies for reliable video and list access.

## Actor input object example

```json
{
  "postURLs": [
    "https://www.tiktok.com/@khaby.lame/video/7631024397754600735"
  ],
  "maxItems": 5,
  "resultsPerPage": 5,
  "shouldDownloadVideos": false,
  "shouldDownloadCovers": false,
  "shouldDownloadSubtitles": false,
  "shouldDownloadSlideshowImages": false,
  "shouldDownloadAvatars": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# 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 = {
    "postURLs": [
        "https://www.tiktok.com/@khaby.lame/video/7631024397754600735"
    ],
    "maxItems": 5,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "US"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("rainminer/tiktok-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 = {
    "postURLs": ["https://www.tiktok.com/@khaby.lame/video/7631024397754600735"],
    "maxItems": 5,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "US",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("rainminer/tiktok-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 '{
  "postURLs": [
    "https://www.tiktok.com/@khaby.lame/video/7631024397754600735"
  ],
  "maxItems": 5,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}' |
apify call rainminer/tiktok-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,rainminer/tiktok-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/OUxqUQ3XdNvLOqFmm/builds/qVuWphh0Wmoc3Ugap/openapi.json
