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

Just provide the TikTok video link. All video data — views, likes, comments, shares, description, author details — will be collected and stored directly in your Apify dataset.
Fast, accurate, and simple — fully optimized for extracting data from TikTok.

- **URL**: https://apify.com/datapilot/tiktok-scraper.md
- **Developed by:** [Data Pilot](https://apify.com/datapilot) (community)
- **Categories:** Videos, SEO tools, Other
- **Stats:** 10 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$7.00/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period.You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

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

## 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 Scraper

🚀 **TikTok Scraper** is a powerful Apify Actor designed to extract detailed metadata from any **TikTok** video without using the official TikTok API. It leverages **residential proxies** ` to bypass restrictions, delivering clean, structured data – perfect for **TikTok analytics**, market research, influencer tracking, and content strategy.



### 🔥 Features

- **No Official API Required** – scrapes public **TikTok video data** directly, acting as a true **TikTok API alternative**.
- **Smart Proxy Integration** – uses **Apify residential proxies** to avoid IP blocks and **TikTok rate limit bypass**.
- **Cookie Support** – optional cookies help bypass login walls for restricted content.
- **Comprehensive Metadata** – extracts video ID, title, description, author, play count, like count, comment count, share count, duration, music info, upload date, thumbnail, and more.
- **Batch Processing** – accepts multiple **TikTok URLs** in a single run.
- **Automatic Retry** – retries failed requests up to 3 times with exponential backoff.
- **Apify Dataset Ready** – each video's metadata is pushed as a separate dataset item for easy export (JSON, CSV, XML).
- **Async Architecture** – fast, non‑blocking **async Python scraper** built with asyncio.
- **Lightweight & Maintainable** – built on `, the most reliable **TikTok downloader** library.

---

### ⚙️ How It Works

1. **Input** – Provide one or more **TikTok video URLs** and optional cookies.
2. **Proxy** – Actor initialises a **residential proxy** via Apify Proxy (recommended for **TikTok anti-block**).
3. **Scrape** – For each URL,  extracts metadata including **TikTok video stats**, **author info**, **music details**, and timestamps.
4. **Output** – Each video's data is pushed to the Apify Dataset – a perfect **TikTok data export** solution.
5. **Finish** – Logs total scraped videos and exits.

---

### 📥 Input

The Actor accepts a JSON input with the following fields:

| Field                | Type            | Default                                   | Description |
|----------------------|-----------------|-------------------------------------------|-------------|
| `urls`               | string / array  | **required**                              | One or more **TikTok video URLs** (e.g., `"https://www.tiktok.com/@user/video/1234567890"`). |
| `cookies`            | string          | `null`                                    | Optional Netscape format cookies to authenticate (helps with **TikTok login bypass**). |
| `proxyConfiguration` | object          | `{"useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"]}` | Proxy settings – **TikTok residential proxy** recommended. |

**Example input:**

```json
{
  "urls": [
    "https://www.tiktok.com/@tiktok/video/7123456789012345678",
    "https://www.tiktok.com/@user/video/6987654321098765432"
  ],
  "cookies": "# Netscape HTTP Cookie File\n.tiktok.com\tTRUE\t/\tFALSE\t1735689600\tSESSION\tabc123...",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  }
}
````

***

### 📤 Output

Each dataset item corresponds to one TikTok video:

| Field                  | Type   | Description |
|------------------------|--------|-------------|
| `videoId`              | string | Unique TikTok video ID. |
| `status`               | string | "Success" if scraping succeeded. |
| `title`                | string | Video caption / title. |
| `description`          | string | Full video description. |
| `authorMeta.name`      | string | TikTok author username. |
| `playCount`            | int    | Number of views – TikTok view count. |
| `diggCount`            | int    | Number of likes – TikTok like count. |
| `commentCount`         | int    | Number of comments – TikTok comment count. |
| `shareCount`           | int    | Number of shares – TikTok share count. |
| `videoMeta.duration`   | int    | Video duration in seconds. |
| `musicMeta.musicName`  | string | Name of the background music. |
| `musicMeta.musicAuthor`| string | Artist of the background music. |
| `createTimeISO`        | string | Upload date (YYYYMMDD) – TikTok upload date. |
| `webVideoUrl`          | string | Original video URL. |
| `thumbnail`            | string | URL of the video thumbnail. |
| `scrapedAt`            | string | ISO timestamp of when the data was scraped. |

If a video fails after retries, it is simply skipped (no item pushed).

**Example output item:**

```json
{
  "videoId": "7123456789012345678",
  "status": "Success",
  "title": "This is a trending TikTok video",
  "description": "Check out this amazing content!",
  "authorMeta.name": "tiktok",
  "playCount": 1500000,
  "diggCount": 250000,
  "commentCount": 5000,
  "shareCount": 12000,
  "videoMeta.duration": 45,
  "musicMeta.musicName": "Original Sound",
  "musicMeta.musicAuthor": "Creator",
  "createTimeISO": "20250115",
  "webVideoUrl": "https://www.tiktok.com/@tiktok/video/7123456789012345678",
  "thumbnail": "https://p16-sign.tiktokcdn.com/obj/...",
  "scrapedAt": "2025-02-14T12:34:56Z"
}
```

***

### 🧰 Technical Stack

- **Proxy:** Apify Proxy with RESIDENTIAL group – real peer IPs, high anonymity.
- **Platform:** Apify Actor – serverless, scalable, integrated with Dataset and Key‑Value Store.
- **Deployment:** One‑click run on Apify Console or via REST API.

***

### 🎯 Use Cases

- **TikTok Analytics** – track video performance metrics and engagement trends.
- **Influencer Marketing** – monitor creator content and audience engagement.
- **Competitor Research** – analyse competitor videos and trending content strategies.
- **Content Ideation** – discover trending sounds, hashtags, and video formats.
- **Brand Monitoring** – track brand mentions and user-generated content on TikTok.
- **Market Research** – gather insights on audience preferences and trends.
- **Academic Studies** – collect TikTok metadata for research on social media trends.
- **Social Media Dashboard** – integrate TikTok data into analytics platforms.
- **Music Analysis** – track trending audio and music usage on TikTok.
- **Viral Content Tracking** – monitor and analyse viral video trends.

***

### 🚀 Quick Start

1. **Open in Apify Console** – visit the Actor page and click Try for free.
2. **Paste TikTok URL(s)** in the input field (one URL or a batch).
3. **Add cookies** (optional) if accessing restricted content.
4. **Enable residential proxies** (recommended).
5. **Click Start** and wait for results.
6. **Export** – download metadata as JSON, CSV, HTML, or Excel.

You can also call this Actor programmatically via Apify SDK or REST API – ideal for automated pipelines.

***

### 💎 Why Use This Actor?

| Feature | Benefit |
|---------|---------|
| ✅ No TikTok API limits | Extract unlimited video metadata without API quotas. |
| ✅ Residential proxies | Bypass TikTok anti-bot detection – high success rate. |
| ✅ Batch processing | Scrape multiple videos in one run. |
| ✅ Complete metadata | Get video stats, music info, author details, and more. |
| ✅ Clean schema | Ready for immediate analysis or database ingestion. |
| ✅ Apify ecosystem | Seamless integration with other Actors, triggers, and webhooks. |
| ✅ No login required | Works with public TikTok content – optional cookies for restricted access. |

***

### ⚠️ Important Notes

- **TikTok Terms of Service** – Use responsibly and at reasonable speed. This Actor is meant for personal, educational, or research use.
- **Proxy Credits** – Residential proxy usage consumes Apify platform credits. Free tier may have limited availability.
- **Rate Limiting** – TikTok may rate limit requests. Use reasonable intervals between batches.
- **Cookie Format** – Cookies should be in Netscape format for proper authentication.
- **Library Updates** – If TikTok changes its structure, the underlying \` library may need updates. We monitor and maintain regularly.

### 📦 Changelog

#### v1.0.0 (February 2025)

- Initial release with residential proxy support.
- Batch processing for multiple TikTok URLs.
- Extracts comprehensive video metadata (stats, music, author info, timestamps).
- Automatic retry with exponential backoff.
- Cookie support for restricted content.
- Full Apify Actor integration.

***

### 🧑‍💻 Support & Feedback

- **Issues & Ideas:** Open a ticket on the Apify Actor issue tracker.
- **Contributions:** Pull requests are welcome via the GitHub repository.
- **Documentation:** Visit Apify Docs for platform guides.

# Actor input Schema

## `url` (type: `string`):

Paste the TikTok video link you want to scrape.

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

Residential Proxy is highly recommended to avoid TikTok's bot detection.

## Actor input object example

```json
{
  "url": "https://www.tiktok.com/@bazeditz/video/7335408564221070597",
  "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 = {
    "url": "https://www.tiktok.com/@bazeditz/video/7335408564221070597"
};

// Run the Actor and wait for it to finish
const run = await client.actor("datapilot/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 = { "url": "https://www.tiktok.com/@bazeditz/video/7335408564221070597" }

# Run the Actor and wait for it to finish
run = client.actor("datapilot/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 '{
  "url": "https://www.tiktok.com/@bazeditz/video/7335408564221070597"
}' |
apify call datapilot/tiktok-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "TikTok Scraper",
        "description": "Just provide the TikTok video link. All video data — views, likes, comments, shares, description, author details — will be collected and stored directly in your Apify dataset.\nFast, accurate, and simple — fully optimized for extracting data from TikTok.",
        "version": "0.0",
        "x-build-id": "QzVsRGQdWZ624EgE4"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/datapilot~tiktok-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-datapilot-tiktok-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/datapilot~tiktok-scraper/runs": {
            "post": {
                "operationId": "runs-sync-datapilot-tiktok-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/datapilot~tiktok-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-datapilot-tiktok-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",
                "required": [
                    "url"
                ],
                "properties": {
                    "url": {
                        "title": "TikTok Video URL",
                        "type": "string",
                        "description": "Paste the TikTok video link you want to scrape."
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Residential Proxy is highly recommended to avoid TikTok's bot detection.",
                        "default": {
                            "useApifyProxy": true,
                            "apifyProxyGroups": [
                                "RESIDENTIAL"
                            ]
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
