# 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, 72.2% 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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "TikTok Data Scraper",
        "description": "🎵 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,",
        "version": "0.1",
        "x-build-id": "5krzqgxXvhkQkTija"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/oneary~tiktok-data-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-oneary-tiktok-data-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/oneary~tiktok-data-scraper/runs": {
            "post": {
                "operationId": "runs-sync-oneary-tiktok-data-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/oneary~tiktok-data-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-oneary-tiktok-data-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": {
                    "startUrls": {
                        "title": "Start URLs",
                        "type": "array",
                        "description": "List of TikTok video or profile URLs to start scraping from.",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "hashtag": {
                        "title": "Hashtag to scrape",
                        "type": "string",
                        "description": "Scrape videos from a specific hashtag (without the # symbol)."
                    },
                    "user": {
                        "title": "Username to scrape",
                        "type": "string",
                        "description": "Scrape videos from a specific TikTok username (without the @ symbol)."
                    },
                    "maxVideos": {
                        "title": "Max videos",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Maximum number of videos to scrape.",
                        "default": 50
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Select proxies to be used by the scraper.",
                        "default": {
                            "useApifyProxy": true
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            },
                            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
