# Tiktok Comments Scraper ($0.25/1000 results) (`api-ninja/tiktok-comments-scraper`) Actor

💬 Extract comments and reply threads from TikTok videos with structured author and engagement data.

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

## Pricing

from $0.25 / 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 Comments Scraper

### What does TikTok Comments Scraper do?

**TikTok Comments Scraper** extracts **public comments and reply threads** from [TikTok](https://www.tiktok.com/) videos. Give it one or more TikTok video URLs or video IDs, choose how many comments and replies you want, and it will return a structured dataset with comment text, engagement metrics, author details, and thread relationships.

This Actor is built for people who need **TikTok comment data** without building their own scraper or maintaining pagination logic. It is suitable for no-code users, analysts, agencies, researchers, and developers who want a ready-to-use **TikTok comments API-style workflow** inside Apify.

### Why use this TikTok comment scraper?

Use this Actor when you want to:

- 💬 collect **top-level TikTok comments** from one video or many videos
- 🧵 extract **comment replies** and keep parent-child thread relationships
- 📊 analyze audience sentiment, engagement, and recurring discussion themes
- 🔎 monitor reactions to creators, brands, campaigns, or viral posts
- ⚙️ run scrapes on a schedule, via API, or as part of automations and integrations

Because it runs on **Apify**, you also get platform advantages:

- run from the Apify Console or API
- schedule recurring runs
- export results as **JSON, CSV, Excel, XML, or HTML**
- connect to webhooks, Make, Zapier, n8n, Google Sheets, and more
- monitor runs, logs, and history in one place

### What can this Actor extract from TikTok comments?

The dataset includes both **comments** and **replies** in one unified output table.

| Data group           | Example fields                                                                                            |
| -------------------- | --------------------------------------------------------------------------------------------------------- |
| Comment details      | `id`, `text`, `createdAt`, `status`, `images`                                                             |
| Engagement           | `diggCount`, `replyTotal`                                                                                 |
| Thread structure     | `itemType`, `parentCommentId`                                                                             |
| Video reference      | `videoId`, `sourceUrl`, `inputUrlOrId`                                                                    |
| Author details       | `user.id`, `user.nickname`, `user.uniqueId`, `user.region`, `user.avatar`, `user.verified`, `user.secret` |
| Raw provider payload | Original nested response in `data.raw`                                                                    |

### How to scrape TikTok comments

1. Open the **Input** tab.
2. Paste one or more TikTok video URLs or raw video IDs into `searchUrls`.
3. Set `commentsPerUrl` if you want a limited number of top-level comments.
4. Turn on `scrapeAll` if you want all available top-level comments.
5. Set `repliesPerComment` if you want replies for each fetched comment.
6. Turn on `parseAllReplies` if you want all available replies for each fetched comment.
7. Run the Actor and download the dataset in your preferred format.

This Actor automatically handles:

- comment pagination
- reply pagination
- retrying failed API calls
- preserving comment-to-reply relationships

### How much does it cost to scrape TikTok comments?

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.005 per result | $0.00025 per result |

The Actor start event is charged once per GB of memory, with at least one event per run. The final cost depends mainly on how many comment and reply records are saved. Start with one or two videos, a limited `commentsPerUrl`, and few or no replies. Check the Actor's **Pricing** tab for the latest rates before starting a large run.

### Input example

TikTok Comments Scraper has the following input options. Open the **Input** tab for field descriptions and tooltips.

```json
{
    "searchUrls": ["https://www.tiktok.com/@tiktok/video/7093219391759764782", "7093219391759764782"],
    "commentsPerUrl": 120,
    "scrapeAll": false,
    "repliesPerComment": 10,
    "parseAllReplies": false
}
```

#### Input tips

- Use full video URLs when possible for easier run tracking.
- Use raw video IDs if that is what your upstream system already stores.
- Set `repliesPerComment` to `0` if you only need top-level comments.
- Use `scrapeAll` or `parseAllReplies` only when you really need full depth.

### Output example

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

Each item contains a lightweight top-level envelope plus a nested `data` object. That keeps the dataset easier to work with while still preserving the original provider response in `data.raw`.

```json
{
    "sourceUrl": "https://www.tiktok.com/@tiktok/video/7093219391759764782",
    "inputUrlOrId": "https://www.tiktok.com/@tiktok/video/7093219391759764782",
    "videoId": "7093219391759764782",
    "itemType": "comment",
    "parentCommentId": null,
    "data": {
        "id": "7093507464444461850",
        "text": "pliss verification in my account🥺",
        "images": [],
        "createTime": 1651585926,
        "createdAt": "2022-05-03T12:32:06.000Z",
        "diggCount": 11,
        "replyTotal": 16,
        "status": 1,
        "user": {
            "id": "6941564768987071490",
            "uniqueId": "junn_kaa",
            "nickname": "j⚡",
            "region": "ID",
            "avatar": "https://p16-common-sign.tiktokcdn-us.com/...",
            "verified": false,
            "secret": true
        },
        "raw": {
            "id": "7093507464444461850",
            "video_id": "7093219391759764782",
            "text": "pliss verification in my account🥺"
        }
    }
}
```

### FAQ

#### Does this Actor scrape TikTok replies too?

Yes. Set `repliesPerComment` to a value greater than `0`, or enable `parseAllReplies` to collect full reply threads.

#### Does `commentsPerUrl` include replies?

No. `commentsPerUrl` limits **top-level comments per video**. Replies are controlled separately by `repliesPerComment` or `parseAllReplies`.

#### Can I use TikTok video IDs instead of URLs?

Yes. The Actor accepts both:

- full TikTok video URLs
- raw TikTok video IDs

#### Is this an official TikTok API?

No. This Actor is an independent scraping solution for collecting **public TikTok comment data**. It is useful when you need TikTok comment extraction without building and maintaining your own infrastructure.

#### Is it legal to scrape TikTok?

Our scrapers are designed to collect **publicly available data only**. However, your output may still contain personal data, and your use of that data may be subject to GDPR and other privacy laws. You are responsible for making sure your use case is lawful and compliant with applicable regulations. If you are unsure, consult legal counsel.

### Tips for better results

- 🚀 Start with a small run before switching on full-depth scraping.
- 🧠 If you only need sentiment or keyword analysis, top-level comments are often enough.
- 💡 Use full reply scraping only for community, moderation, or conversation analysis.
- 🔁 Schedule recurring runs if you want to monitor new comments on the same videos over time.
- 📥 Use the Apify API or integrations if you want to send results directly into your pipeline.

### 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 Data Scraper](https://apify.com/api-ninja/tiktok-data-scraper)**: Extract profiles, videos, comments, hashtags, music, and playlists.
- 👤 **[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 Hashtag Scraper](https://apify.com/api-ninja/tiktok-hashtag-scraper)**: Discover public videos associated with hashtags.

### Support

If you run into issues or want improvements:

- check the **Input** and **Output** tabs first
- review the run **Logs** for request and pagination details
- use the **API** tab if you want to automate runs programmatically
- open an issue or reach out through the Actor page if you want to suggest a feature or a custom variant

This README is intended to be the first place to check when something is unclear, especially around limits, reply scraping, and output structure.

# Actor input Schema

## `searchUrls` (type: `array`):

Provide one or more TikTok video URLs or raw video IDs. Each entry is processed independently.

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

Maximum number of top-level comments to collect from each video when full crawl mode is disabled.

## `scrapeAll` (type: `boolean`):

When enabled, collects all available top-level comments for each video and ignores the comment limit above.

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

Maximum number of replies to collect for each comment. Set to 0 to skip replies entirely unless full reply crawl mode is enabled.

## `parseAllReplies` (type: `boolean`):

When enabled, collects every available reply for each fetched comment and ignores the reply limit above.

## Actor input object example

```json
{
  "searchUrls": [
    "https://www.tiktok.com/@billieeilish/video/7050551461734042926"
  ],
  "commentsPerUrl": 100,
  "scrapeAll": false,
  "repliesPerComment": 0,
  "parseAllReplies": false
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `raw_dataset` (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 = {
    "searchUrls": [
        "https://www.tiktok.com/@billieeilish/video/7050551461734042926"
    ]
};

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

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

```

## MCP server setup

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