# Tiktok Data Scraper ($0.4/1000 results) (`api-ninja/tiktok-data-scraper`) Actor

🔥 Extract public TikTok data at scale: profiles, videos, followers, comments/replies, hashtags, music, playlists, and video details. Get structured metrics, creator info, engagement stats, and discovery signals via one standalone Apify API Actor.

- **URL**: https://apify.com/api-ninja/tiktok-data-scraper.md
- **Developed by:** [API ninja](https://apify.com/api-ninja) (community)
- **Categories:** Social media, Videos, Automation
- **Features:** Limited permissions
- **Stats:** 739 total users, 42 monthly users, 100.0% runs succeeded, 31 bookmarks
- **User rating**: 4.96 out of 5 stars

## Pricing

from $0.40 / 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.
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

### TikTok Data Scraper API: Scrape TikTok profiles, videos, comments, hashtags, and music

**TikTok Data Scraper** is a standalone **TikTok scraping API Actor** on Apify for teams that need to **scrape TikTok data** reliably and at scale. You can use it as a practical **TikTok API alternative** to extract public TikTok profiles, follower/following data, video metadata, comments/replies, hashtag posts, music-based posts, playlist posts, and detailed video objects in one workflow.

Target platform: [TikTok](https://www.tiktok.com/).

If you also need direct media download pipelines, use the companion Actor: **[TikTok Video Downloader](https://apify.com/api-ninja/tiktok-video-downloader)**.

### How to scrape TikTok data in 6 steps

1. Open **TikTok Data Scraper** on Apify and go to the **Input** tab.
2. Add at least one source list: `userUrls`, `videoUrlsComments`, `hashtags`, `musicUrls`, `playlistIDs`, or `videoDetailsList`.
3. Choose limits (`maxUserResults`, `commentsPerUrl`, `videosPerHashtag`, etc.) or enable `scrapeAll...` flags.
4. Start the run.
5. Open the run dataset and review results by section (`users`, `comments`, `hashtags`, `music`, `playlists`, `video_details`).
6. Export data as JSON/CSV/Excel or consume it through the Apify API.

Hashtag names must be a single token without spaces, for example `personalfinancejourney` or `#personalfinancejourney`. Search phrases such as `personal finance journey` are not supported. TikTok hashtag URLs and numeric challenge IDs are also accepted. Leading and trailing whitespace is trimmed. Invalid hashtag entries stop the run before scraping starts; words are never automatically joined.

Unavailable hashtags are skipped after up to three lookup attempts (two retries). Enable **If not available, parse similar hashtag** (`parseSimilarHashtag`, default `false`) to search for similar hashtags and scrape videos using the first result's ID. If the search returns no results, the hashtag is skipped. Numeric challenge IDs bypass this fallback. Dataset items keep the original input and include the resolved `challenge_id`.

### Why use this TikTok scraper on Apify?

- Multi-source extraction in one run: users, videos, hashtags, music, playlists, and video details
- Flexible input formats: TikTok URLs, usernames, `@handles`, numeric IDs, hashtag names
- Good cost control: per-source limits + optional full pagination with `scrapeAll...`
- Structured output that is easy to map into BI pipelines and automations
- Production-ready platform features: scheduling, logs, webhooks, API-first access, export formats, and integrations

#### Apify platform advantages

With Apify, this Actor is not just a script. You get:

- Scheduled recurring runs: [Schedules](https://docs.apify.com/platform/schedules)
- Programmatic execution and retrieval: [Apify API](https://docs.apify.com/api/v2)
- Event-driven orchestration: [Webhooks](https://docs.apify.com/platform/integrations/webhooks)
- Easy downstream delivery: [Integrations](https://apify.com/integrations)
- Run observability and debugging: [Logs](https://docs.apify.com/platform/actors/runs#logs)
- Dataset export in multiple formats: [Dataset API](https://docs.apify.com/api/v2/dataset-items-get)

### What can this Actor extract from TikTok?

The Actor writes structured records with context fields such as `section`, `category`, and `input`, plus source payloads under `data`.

| Data group | Example fields |
| --- | --- |
| Video metadata | `video_id`, `title`, `content_desc`, `cover`, `duration`, `create_time` |
| Video performance | `play_count`, `digg_count`, `comment_count`, `share_count`, `download_count`, `collect_count` |
| Creator/profile data | `author.nickname`, `author.unique_id`, `user.id`, `user.verified`, profile stats |
| Comments and replies | `text`, `reply_count`, commenter profile info, parent comment linkage |
| Discovery entities | hashtag/challenge IDs, music IDs, playlist IDs, search results |
| Workflow context | `section`, `category`, `input`, and source-specific IDs |

### Real-world use cases

- Influencer discovery and creator benchmarking by niche, region, and engagement
- Trend tracking by hashtags, sounds/music IDs, and playlist clusters
- Competitor monitoring of posting activity, format mix, and engagement velocity
- Comment mining for sentiment analysis and product feedback loops
- Content intelligence pipelines for agencies, media teams, and growth teams

### Input example

```json
{
  "userUrls": ["https://www.tiktok.com/@taylorswift", "@billieeilish"],
  "categories": ["videos", "followers", "user_info"],
  "maxUserResults": 100,
  "scrapeAllUserResults": false,

  "videoUrlsComments": ["https://www.tiktok.com/@username/video/7488888888888888888"],
  "commentsPerUrl": 150,
  "scrapeAllComments": false,
  "repliesPerComment": 20,
  "scrapeAllReplies": false,

  "hashtags": ["dance", "https://www.tiktok.com/hashtag/viral"],
  "videosPerHashtag": 120,
  "scrapeAllHashtagVideos": false,
  "hashtagRegion": "US",

  "musicUrls": ["https://www.tiktok.com/music/original-sound-7488888888888888888"],
  "videosPerMusic": 100,
  "scrapeAllMusicVideos": false,

  "playlistIDs": ["7488888888888888888"],
  "videosPerPlaylist": 100,
  "scrapeAllPlaylistVideos": false,

  "videoDetailsList": ["https://www.tiktok.com/@username/video/7488888888888888888"]
}
```

### Output example

You can download the dataset extracted by TikTok Data Scraper in various formats such as **JSON, CSV, Excel, XML, or HTML**.

```json
[
  {
    "section": "users",
    "category": "videos",
    "input": "https://www.tiktok.com/@taylorswift",
    "user": "taylorswift",
    "userType": "unique_id",
    "data": {
      "video_id": "7488888888888888888",
      "title": "Sample video",
      "play_count": 123456,
      "comment_count": 321,
      "author": {
        "nickname": "Taylor Swift",
        "unique_id": "taylorswift"
      }
    }
  },
  {
    "section": "comments",
    "itemType": "reply",
    "input": "https://www.tiktok.com/@username/video/7488888888888888888",
    "parentCommentId": "7344444444444444444",
    "videoId": "7488888888888888888",
    "data": {
      "text": "Great clip!",
      "reply_count": 0
    }
  }
]
```

### Video walkthrough

For a quick overview of working with Apify Actors and API-based data extraction, you can watch:
https://www.youtube.com/watch?v=ViYYDHSBAKM

### How much does TikTok scraping cost?

This Actor uses **pay-per-event pricing** with a **$0.10 minimum total charge per run**.

| Charge | Free plan | Bronze–Diamond plans |
| --- | ---: | ---: |
| Actor start | $0.01 | $0.01 |
| Result saved to the default dataset | $0.0025 per result | $0.00025 per result |

The Actor start event is charged once per GB of memory, with at least one event per run. Your total depends mainly on the number of dataset results produced across users, videos, hashtags, music, playlists, comments, and replies. Start with smaller limits, validate the output, and then scale. Check the Actor's **Pricing** tab for the latest rates before starting a large run.

### Other TikTok Scraping Tools

If you like this Actor, you might also find these TikTok tools useful:

- 📥 **[TikTok Video Downloader](https://apify.com/api-ninja/tiktok-video-downloader)**: Download TikTok video assets and build media pipelines.
- 👤 **[TikTok Profile Scraper](https://apify.com/api-ninja/tiktok-profile-scraper)**: Collect public profile information and profile-related content.
- 👥 **[TikTok Followers Scraper](https://apify.com/api-ninja/tiktok-followers-scraper)**: Extract public followers or following lists.
- 💬 **[TikTok Comments Scraper](https://apify.com/api-ninja/tiktok-comments-scraper)**: Collect comments and optional reply threads from videos.
- \#️⃣ **[TikTok Hashtag Scraper](https://apify.com/api-ninja/tiktok-hashtag-scraper)**: Discover public videos associated with hashtags.

### FAQ, legal, and support

#### Is it legal to scrape TikTok data?

This Actor is intended for **publicly available TikTok data** and legitimate analytics, research, and automation use cases. You are responsible for compliance with TikTok terms and applicable law.

Important compliance note: scraped output may include personal data. Personal data can be regulated by GDPR (EU), CCPA/CPRA (California), and other privacy laws. You should only process data when you have a lawful basis and a legitimate business purpose. If unsure, consult legal counsel before running production workflows.

#### I got fewer results than expected. What should I change?

- Increase source-specific limits (`maxUserResults`, `commentsPerUrl`, `videosPerHashtag`, etc.)
- Enable relevant `scrapeAll...` flags when you need full pagination
- Verify source inputs are valid and public (URLs, usernames, IDs)
- Try narrower batches first, then scale out

#### Can I run this as an API and automate exports?

Yes. Run via the [Apify API](https://docs.apify.com/api/v2), then fetch items from the run dataset endpoint. You can also schedule jobs and push downstream events via [webhooks](https://docs.apify.com/platform/integrations/webhooks).

#### Where do I get help or request improvements?

Use the Actor’s **Issues** tab in Apify Store for bug reports, feature requests, and custom workflow requests.

# Actor input Schema

## `userUrls` (type: `array`):

Provide URLs, usernames or IDs for profiles. Example: https://www.tiktok.com/@billieeilish, billieeilish, @billieeilish, 107955

## `categories` (type: `array`):

Select which types of content to scrape for the query. Multiple categories are supported.

## `maxUserResults` (type: `integer`):

The maximum number of items to fetch for each individual URL or section. This is ignored if 'Scrape all available results' is enabled.

## `scrapeAllUserResults` (type: `boolean`):

If enabled, the scraper will ignore the result limit and attempt to fetch all available content for each provided source.

## `videoUrlsComments` (type: `array`):

List of TikTok video URLs or video IDs to scrape comments from. Supports both full URLs (https://www.tiktok.com/@username/video/1234567890) and just the video ID (1234567890).

## `commentsPerUrl` (type: `integer`):

Maximum number of comments to scrape for each video. This limit is ignored when 'Scrape All Comments' is enabled.

## `scrapeAllComments` (type: `boolean`):

When enabled, scrapes all available comments from each video, ignoring the 'Maximum Comments per Video' limit. This may significantly increase scraping time and resource usage.

## `repliesPerComment` (type: `integer`):

Maximum number of replies to scrape for each comment. Set to 0 to skip replies entirely. This limit is ignored when 'Parse All Replies' is enabled.

## `scrapeAllReplies` (type: `boolean`):

When enabled, scrapes all available replies for each comment, ignoring the 'Maximum Replies per Comment' limit. This may significantly increase scraping time and resource usage.

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

List of hashtag names (dance or #dance), TikTok hashtag URLs (https://www.tiktok.com/hashtag/dance), or numeric challenge IDs. Each hashtag must be a single token without spaces, tabs, or line breaks. Use personalfinancejourney instead of personal finance journey. Leading and trailing whitespace is trimmed. Invalid entries stop the run before scraping starts; words are never automatically joined.

## `parseSimilarHashtag` (type: `boolean`):

If a hashtag name cannot be resolved, search for similar hashtags and scrape videos using the first result. If no result is found, skip the hashtag. Does not apply to numeric challenge IDs.

## `videosPerHashtag` (type: `integer`):

Maximum number of videos to scrape for each hashtag. This limit is ignored when 'Scrape All Hashtag Videos' is enabled.

## `scrapeAllHashtagVideos` (type: `boolean`):

When enabled, scrapes all available videos from each hashtag, ignoring the 'Maximum Videos per Hashtag' limit. This may significantly increase scraping time and resource usage.

## `hashtagRegion` (type: `string`):

Select a region for hashtag video results. The region feature may not always return results from the selected region. For the United Kingdom, select GB.

## `musicUrls` (type: `array`):

List of TikTok music URLs or music IDs to scrape videos from. Supports both full URLs (https://www.tiktok.com/music/1234567890) and just the music ID (1234567890).

## `videosPerMusic` (type: `integer`):

Maximum number of videos to scrape for each music. This limit is ignored when 'Scrape All Music Videos' is enabled.

## `scrapeAllMusicVideos` (type: `boolean`):

When enabled, scrapes all available videos from each music track, ignoring the 'Maximum Videos per Music' limit. This may significantly increase scraping time and resource usage.

## `playlistIDs` (type: `array`):

List of TikTok playlist IDs to scrape videos from. Supports just the playlist ID (1234567890).

## `videosPerPlaylist` (type: `integer`):

Maximum number of videos to scrape for each playlist. This limit is ignored when 'Scrape All Playlist Videos' is enabled.

## `scrapeAllPlaylistVideos` (type: `boolean`):

When enabled, scrapes all available videos from each playlist, ignoring the 'Maximum Videos per Playlist' limit. This may significantly increase scraping time and resource usage.

## `videoDetailsList` (type: `array`):

List of TikTok video IDs or URLs to retrieve video details. Supports just the video ID (1234567890) or full URL (https://www.tiktok.com/@username/video/1234567890).

## Actor input object example

```json
{
  "userUrls": [
    "https://www.tiktok.com/@taylorswift"
  ],
  "categories": [
    "videos"
  ],
  "maxUserResults": 100,
  "scrapeAllUserResults": false,
  "commentsPerUrl": 100,
  "scrapeAllComments": false,
  "repliesPerComment": 0,
  "scrapeAllReplies": false,
  "parseSimilarHashtag": false,
  "videosPerHashtag": 100,
  "scrapeAllHashtagVideos": false,
  "hashtagRegion": "US",
  "videosPerMusic": 100,
  "scrapeAllMusicVideos": false,
  "videosPerPlaylist": 100,
  "scrapeAllPlaylistVideos": false
}
```

# Actor output Schema

## `results` (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 = {
    "userUrls": [
        "https://www.tiktok.com/@taylorswift"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("api-ninja/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 = { "userUrls": ["https://www.tiktok.com/@taylorswift"] }

# Run the Actor and wait for it to finish
run = client.actor("api-ninja/tiktok-data-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 '{
  "userUrls": [
    "https://www.tiktok.com/@taylorswift"
  ]
}' |
apify call api-ninja/tiktok-data-scraper --silent --output-dataset

```

## MCP server setup

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