# TikTok Scraper - Profiles, Hashtags, Search, Videos at Scale (`convertfleetdotonline/tiktok-scraper`) Actor

TikTok scraper - bulk-extract by hashtag, profile, search or URL. Get videos, view counts, likes, comments, shares, hashtags, music info and author details at scale. To JSON, CSV or Excel. No login.

- **URL**: https://apify.com/convertfleetdotonline/tiktok-scraper.md
- **Developed by:** [Hasnain Nisar](https://apify.com/convertfleetdotonline) (community)
- **Categories:** Social media, Videos
- **Stats:** 2 total users, 0 monthly users, 87.8% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.50 / 1,000 video scrapeds

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 Scraper - Scrape TikTok Videos by Profile, Hashtag, Search & URL at Scale

**Bulk-scrape TikTok by hashtag, profile, search query, or direct URL with this TikTok video scraper.** Get videos with view counts, likes, comments, shares, hashtags, music info, and author data — all without an API key, login, or third-party token. Use it as a TikTok profile scraper or a general TikTok data scraper across four modes.

### What this TikTok Scraper does

Choose one of four modes and the actor returns a clean stream of TikTok data:

- **Hashtag mode** — pass `#fyp`, `#smallbusiness`, `#crypto` and get the top videos for each
- **Profile mode** — pass usernames and get the latest videos from each, with profile metadata
- **Search mode** — pass free-form queries (e.g. "iphone unboxing") and get search results
- **URLs mode** — pass any mix of TikTok URLs (videos, profiles, hashtag pages) and let the actor route automatically

For profiles you can filter by date range, sort by latest or popular, and exclude pinned videos.

### Why use this TikTok Scraper?

- **No TikTok API key** — works on the public web pages
- **Four scrape modes in one actor** — hashtag, profile, search, URLs
- **Date filtering** — scrape only videos from a specific window
- **Rich metrics** — views, likes, comments, shares, follower counts
- **Bulk-friendly** — pass arrays of hashtags / usernames / queries
- **Author + music metadata** — perfect for influencer marketing & creator discovery

### Use cases

- **Influencer discovery** — find rising creators in any niche
- **Hashtag research** — see what's trending on `#fyp` right now
- **Competitor analysis** — track competitor profile output and engagement
- **Trend monitoring** — capture viral content as it's happening
- **Brand mentions** — search for your brand and pull every mention
- **Music / audio research** — see which sounds are powering top videos
- **Affiliate marketing** — find product-review videos in your niche

### Input

```json
{
    "mode": "hashtag",
    "hashtags": ["fyp", "smallbusiness"],
    "maxVideos": 50
}
```

Profile-mode example:

```json
{
    "mode": "profiles",
    "usernames": ["khaby.lame", "charlidamelio"],
    "profileSort": "latest",
    "excludePinned": true,
    "dateAfter": "2024-01-01",
    "maxVideos": 100
}
```

Search-mode example:

```json
{
    "mode": "search",
    "queries": ["iphone 15 unboxing", "best running shoes 2024"],
    "maxVideos": 30
}
```

URLs-mode example:

```json
{
    "mode": "urls",
    "urls": [
        "https://www.tiktok.com/@khaby.lame",
        "https://www.tiktok.com/@user/video/7000000000000000000",
        "https://www.tiktok.com/tag/fyp"
    ],
    "maxVideos": 50
}
```

### Output

Each video record:

```json
{
    "type": "video",
    "id": "7000000000000000000",
    "description": "Caption with #hashtags",
    "author": "username",
    "author_name": "Display Name",
    "author_followers": 12000000,
    "likes": 1500000,
    "views": 25000000,
    "comments": 8500,
    "shares": 42000,
    "created_at": 1735689600,
    "url": "https://www.tiktok.com/@username/video/7000000000000000000",
    "hashtags": ["fyp", "viral"],
    "music": "Original Sound - username",
    "cover": "https://p16-…tiktokcdn.com/…"
}
```

Profile records (only in `profiles` mode) have `type: "profile"` and contain follower count, bio, avatar URL, and total likes.

### How it works

The actor uses Playwright (with stealth) to load TikTok pages exactly the way the official TikTok web client does. It extracts the `SIGI_STATE` and `__NEXT_DATA__` JSON blobs embedded in the HTML — TikTok's own internal state — and normalises them to a clean record schema. No reverse-engineered private APIs, no fragile DOM scraping.

### Cost & speed

A 20-video hashtag scrape completes in 8–15 seconds. A 100-video profile scrape completes in 25–45 seconds. Memory usage is ~1 GB due to Chromium.

### Related actors

- **TikTok Video Downloader** — get direct MP4 / MP3 URLs
- **YouTube Channel Scraper** — bulk video metadata for YouTube
- **Twitter / X Scraper** — bulk tweet scraping
- **Reddit Scraper** — bulk Reddit post / comment / community scraping

### FAQ

**Q: How do I scrape TikTok videos by hashtag or profile?**
Pick a mode: **hashtag** mode takes tags like `#fyp` or `#smallbusiness` and returns the top videos for each; **profile** mode takes usernames and returns their latest videos with profile metadata (and optional date filtering, latest/popular sort, and pinned-video exclusion). You can also use **search** and **URLs** modes in the same actor.

**Q: Can I scrape TikTok comments?**
The actor returns each video's comment *count* (the `comments` field) along with views, likes, and shares, but it extracts video and profile metadata — it does not pull individual comment text.

**Q: How much TikTok data can I extract at once?**
Pass arrays of hashtags, usernames, or queries and set `maxVideos` per run. For very large batches, run in smaller chunks (e.g. 100 videos per run) rather than 1,000+ at once to stay ahead of TikTok's anti-bot defenses.

**Q: Do I need a TikTok account?**
No.

**Q: Can I scrape private accounts?**
No. Only public videos and profiles.

**Q: Why are some `views` fields null?**
TikTok occasionally omits the play count in profile-list responses. Pass the video URL through the actor again (URLs mode) to get the full stat block.

**Q: Does this work for live streams?**
Live streams don't appear in the standard SIGI\_STATE; only on-demand videos are returned.

**Q: How do I avoid hitting TikTok's anti-bot defenses?**
The actor already uses stealth mode and a realistic user agent. For very large batches, run in smaller chunks (e.g. 100 videos per run) rather than 1,000+ in one go.

# Actor input Schema

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

What to scrape: by profile, by hashtag, by search query, or by direct URL. <b>profiles</b> is the default because it is the only mode that works without residential proxies or cookies - hashtag/search/urls are gated by TikTok against datacenter IPs.

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

(Used when mode=hashtag) List of hashtags without the # symbol. Requires residential proxies or TikTok cookies.

## `usernames` (type: `array`):

(Used when mode=profiles) List of TikTok usernames without the @ symbol.

## `queries` (type: `array`):

(Used when mode=search) List of free-form search queries.

## `urls` (type: `array`):

(Used when mode=urls) List of TikTok URLs - profiles, videos, or hashtag pages.

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

Maximum total videos to return.

## `profileSort` (type: `string`):

(profiles mode) Sort videos by latest or popular.

## `excludePinned` (type: `boolean`):

(profiles mode) Skip pinned videos.

## `dateAfter` (type: `string`):

(profiles mode) Only include videos uploaded on or after this date.

## `dateBefore` (type: `string`):

(profiles mode) Only include videos uploaded on or before this date.

## `scrapeRelated` (type: `boolean`):

Also fetch related-video lists for each scraped TikTok video.

## `scrapeComments` (type: `boolean`):

Also fetch comments for each scraped TikTok video.

## `maxComments` (type: `integer`):

Maximum number of comments (including replies) to fetch per video.

## `maxToplevelComments` (type: `integer`):

Maximum number of top-level comments per video.

## `maxReplies` (type: `integer`):

Maximum number of replies fetched per top-level comment.

## `cookies` (type: `string`):

TikTok serves its discovery endpoints (hashtag, search, share URLs) only to trusted sessions — from a datacenter IP they come back <b>empty with no error</b>. Pasting the cookies of a signed-in TikTok session makes those modes work without residential proxies. (<code>profiles</code> mode works without cookies.)<br><br><b>How to get them:</b> sign in to tiktok.com → open DevTools (F12) → <b>Network</b> tab → reload → click the first request → copy the whole <code>cookie:</code> request header and paste it here. A JSON array from a cookie-exporter extension also works.

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

Routes Playwright through Apify Proxy. TikTok serves empty pages to datacenter IPs — residential is required.

## Actor input object example

```json
{
  "mode": "profiles",
  "hashtags": [
    "fyp"
  ],
  "usernames": [
    "mrbeast"
  ],
  "queries": [],
  "urls": [],
  "maxVideos": 20,
  "profileSort": "latest",
  "excludePinned": false,
  "scrapeRelated": false,
  "scrapeComments": false,
  "maxComments": 10,
  "maxToplevelComments": 10,
  "maxReplies": 5,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# 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 = {
    "mode": "profiles",
    "hashtags": [
        "fyp"
    ],
    "usernames": [
        "mrbeast"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("convertfleetdotonline/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 = {
    "mode": "profiles",
    "hashtags": ["fyp"],
    "usernames": ["mrbeast"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("convertfleetdotonline/tiktok-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 '{
  "mode": "profiles",
  "hashtags": [
    "fyp"
  ],
  "usernames": [
    "mrbeast"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call convertfleetdotonline/tiktok-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

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