# TikTok Data Scraper (`oneary/tiktok-data-scraper`) Actor

🎵 Scrape TikTok public data at scale — extract profile stats, video metadata, captions, hashtags, and engagement metrics. Search by username, hashtag, or direct URLs. Built on Crawlee + Playwright with proxy rotation to handle TikTok's anti-bot protections. Perfect for influencer analysis,

- **URL**: https://apify.com/oneary/tiktok-data-scraper.md
- **Developed by:** [Luan M.](https://apify.com/oneary) (community)
- **Categories:** Videos
- **Stats:** 2 total users, 1 monthly users, 96.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$10.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## TikTok Data Scraper

> **Extract public TikTok profile and video data at scale.**\
> Fully managed, proxy-resilient, built on Crawlee + Playwright.

***

### 🚀 Overview

**TikTok Data Scraper** is a high-performance Apify actor that extracts public data from TikTok profiles and videos. It navigates TikTok using headless Chromium (Playwright), handles anti-bot protections via Apify's proxy rotation, and outputs clean structured data ready for analysis, archiving, or integration.

Whether you're building a creator database, monitoring brand mentions, analyzing trending hashtags, or backing up content, this scraper gives you the raw data without the hassle.

***

### ✨ Features

- **Profile scraping** – username, display name, bio, follower count, following count, likes
- **Video scraping** – video URL, caption, hashtags, poster image
- **Hashtag exploration** – discover videos by hashtag
- **Custom start URLs** – seed with any TikTok URL
- **Proxy rotation** – built-in Apify proxy support to avoid IP blocks
- **Configurable limits** – set max videos to scrape
- **Structured output** – JSON dataset ready for export, API, or webhook delivery
- **Resumable** – built on Crawlee; can resume interrupted runs

***

### 📋 Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `startUrls` | Array | No | List of TikTok URLs to start scraping from |
| `user` | String | No | TikTok username to scrape (without @) |
| `hashtag` | String | No | Hashtag to scrape videos from (without #) |
| `maxVideos` | Integer | Yes (default: 50) | Maximum number of videos to scrape (1–10,000) |
| `proxyConfiguration` | Object | Yes | Apify proxy configuration |

You can provide `startUrls`, `user`, `hashtag`, or any combination. If all are provided, they are merged into the crawl queue.

***

### 📤 Output Fields

Each dataset entry contains:

| Field | Type | Description |
|-------|------|-------------|
| `url` | String | TikTok URL |
| `username` | String | TikTok username |
| `displayName` | String | Profile display name (profile pages) |
| `bio` | String | Profile bio text (profile pages) |
| `followers` | String | Follower count (profile pages) |
| `following` | String | Following count (profile pages) |
| `likes` | String | Like count |
| `caption` | String | Video caption / description |
| `hashtags` | Array | Extracted hashtags from caption |
| `videoUrl` | String | Direct video file URL |
| `posterUrl` | String | Video thumbnail URL |
| `comments` | Null | Placeholder for future comment scraping |

***

### 🧰 Use Cases

- **Influencer marketing** – build creator databases with follower counts and engagement
- **Trend analysis** – monitor hashtag performance over time
- **Brand monitoring** – track mentions and branded content
- **Content archiving** – backup TikTok videos and metadata
- **Competitive research** – analyze competitor content strategies
- **Academic research** – study social media trends and virality patterns

***

### 💰 Pricing

**Suggested price range: $20 – $99 per month** depending on platform plan tier.

- **Starter** (~500 videos/month): $20
- **Pro** (~5,000 videos/month): $49
- **Enterprise** (unlimited, custom): $99

Pricing covers compute + proxy usage. Actual Apify platform charges depend on your usage tier.

***

### 🔧 Technical Details

- **Runtime:** Node.js 20 + Playwright Chromium
- **Framework:** Crawlee with `PlaywrightCrawler`
- **Proxy:** Apify proxy (residential rotation recommended for high-volume runs)
- **Output:** Apify dataset (JSON, CSV, XML, XLSX)
- **Docker image:** `apify/actor-node-playwright-chrome:20`

***

### ⚠️ Limitations

- TikTok heavily obfuscates its frontend; numeric metrics (followers, likes, comments) may not be available from static HTML alone
- Rate limiting and CAPTCHAs may reduce yield; use proxy rotation and keep `maxConcurrency` low
- This scraper accesses **public** data only — no login or private content
- TikTok's DOM changes frequently; the scraper may need periodic updates to maintain compatibility

***

### 🚦 Getting Started

#### Run on Apify Cloud

1. Go to [Apify Console](https://console.apify.com)
2. Search for "TikTok Data Scraper"
3. Configure input and run

#### Run locally

```bash
git clone <your-repo-url>
cd tiktok-data-scraper
npm install
npx playwright install chromium
ACTOR_INPUT='{"user":"example","maxVideos":10}' node src/main.js
```

***

### 📄 License

Apache 2.0

# Actor input Schema

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

List of TikTok video or profile URLs to start scraping from.

## `hashtag` (type: `string`):

Scrape videos from a specific hashtag (without the # symbol).

## `user` (type: `string`):

Scrape videos from a specific TikTok username (without the @ symbol).

## `maxVideos` (type: `integer`):

Maximum number of videos to scrape.

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

Select proxies to be used by the scraper.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.tiktok.com/@example"
    }
  ],
  "maxVideos": 50,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "startUrls": [
        {
            "url": "https://www.tiktok.com/@example"
        }
    ],
    "hashtag": "",
    "user": "",
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("oneary/tiktok-data-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 = {
    "startUrls": [{ "url": "https://www.tiktok.com/@example" }],
    "hashtag": "",
    "user": "",
    "proxyConfiguration": { "useApifyProxy": True },
}

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

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

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

```

## CLI example

```bash
echo '{
  "startUrls": [
    {
      "url": "https://www.tiktok.com/@example"
    }
  ],
  "hashtag": "",
  "user": "",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call oneary/tiktok-data-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=oneary/tiktok-data-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/8DD27fS91HI9SSGE6/builds/5krzqgxXvhkQkTija/openapi.json
