# TikTok Comments & Replies Scraper (`a.actors/tiktok-comments-scraper`) Actor

Scrape comments and full reply threads from public TikTok videos and photo posts, with no API key or extra subscription: $0.01 per video plus $0.20 per 1,000 comments. Each reply links to its comment; videos that cannot be read are reported free.

- **URL**: https://apify.com/a.actors/tiktok-comments-scraper.md
- **Developed by:** [ApifyActors](https://apify.com/a.actors) (community)
- **Categories:** Social media
- **Features:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.20 / 1,000 comments

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/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 & Replies Scraper (No API Key)

Export top-level comments on public TikTok videos, and optionally the replies under them, to an Apify dataset. You don't need an API key, a TikTok account or a separate subscription: you pay per result on Apify, and that's all. Give the Actor a list of video URLs or decimal video IDs. It writes one row per unique comment or reply, in TikTok's default order, with every reply linked to its comment. Download the dataset as CSV or JSON from the run's **Storage** tab.

### Run a first check

Open the input form, add one full video link and set **Maximum comments per video** to 2. That costs $0.0104. To verify the result, open **Output → Comments and replies** and compare the IDs and text with the video. **Per-video summary** shows what happened to each video.

```json
{
  "videos": ["https://www.tiktok.com/@bbcnews/video/7690902917741726979"],
  "maxCommentsPerVideo": 2
}
```

Supply 1–100 IDs or full video links. Photo posts (`/photo/` links) are accepted too. URL variants of the same video are collected once. Short share links (`vm.tiktok.com`) and profile links are not accepted: open the video and copy its full link. A link the Actor cannot read stops the run before anything is requested or charged, and the run's status names that link. The default limit is 50 unique comments per video, configurable from 1 to 450. Reply counts are included where available.

#### Replies

Replies are off by default. Turn on **Include replies** to also export each comment's thread. The Actor then reads the replies of every comment whose reply count is above zero, up to **Maximum replies per comment** (default 50, up to 1000). The cap, not the comment's reply count, sets how far the Actor reads, because TikTok's count can be lower than the thread. Comments without replies cost nothing extra. Each reply is its own row, linked to its comment by `parentCommentId`.

```json
{
  "videos": ["https://www.tiktok.com/@bbcnews/video/7690902917741726979"],
  "maxCommentsPerVideo": 50,
  "includeReplies": true,
  "maxRepliesPerComment": 50
}
```

### Pricing

| Event | Price | When |
|---|---|---|
| `video` | $0.01 | Each video the data source answered for, **including a video with no comments** (see `empty` below) |
| `comment` | $0.0002 ($0.20 per 1,000) | Each top-level comment exported |
| `reply-thread` | $0.01 | With replies on: each comment whose reply thread the data source answered for |
| `reply` | $0.0002 ($0.20 per 1,000) | Each reply exported |

On top of these, Apify's standard $0.00005 is charged per run start. Status rows are free. Nothing is charged for a video or thread that fails, is unavailable, or for which the data source reported comments but returned none.

Examples:

| Video | Cost |
|---|---|
| No comments | $0.01 |
| 50 comments, replies off | $0.02 ($0.40 per 1,000 comments) |
| 450 comments, replies off | $0.10 |
| 89 comments and 21 replies in 7 threads | $0.102 |
| 450 comments and 600 replies in 150 threads | $1.72 |

Replies are the expensive part, because every thread is read on its own. Before each video or thread, the run checks that your maximum charge still covers the fee and at least one row. When it no longer does, the run stops requesting. If you already have an API Direct key, [TikTok Comments & Replies Scraper (API Direct)](https://apify.com/a.actors/tiktok-comments-replies-scraper) uses your key and has no per-video or per-thread fee.

### Output

A comment, and a reply to it:

```json
{
  "videoId": "7690902917741726979",
  "commentId": "7516998696283505430",
  "parentCommentId": null,
  "text": "Example comment",
  "author": "example_user",
  "likes": 12,
  "replyCount": 2,
  "createdAtUnix": 1750187654,
  "images": []
}
```

```json
{
  "videoId": "7690902917741726979",
  "commentId": "7517173688660394774",
  "parentCommentId": "7516998696283505430",
  "text": "Example reply",
  "author": "another_user",
  "likes": 3,
  "replyCount": null,
  "createdAtUnix": 1750228407,
  "images": []
}
```

IDs are decimal strings. Timestamps are Unix seconds. Unavailable metrics remain null. `parentCommentId` is null on a top-level comment. On a reply, it holds the ID of the comment the reply belongs to, and the reply's own `replyCount` is null.

#### When something cannot be collected

A video or a reply thread that cannot be collected still gets a row, so a problem never looks like silence. These status rows are free. They have `commentId: null` and a `status` with a `message`. `parentCommentId` is set when the row is about one comment's replies.

| `status` | Meaning | Charged |
|---|---|---|
| `empty` | No comments returned and none reported. Either the video has no comments, or it is deleted, private or a wrong ID: the data source answers these the same way, so check the link if you expected comments. For a reply thread: no replies. | The `video` / `reply-thread` fee, $0.01 |
| `unavailable` | The data source answered "not found". Collection continues. | No |
| `no_rows_returned` | Comments (or replies) were reported but none returned. Worth a retry later. | No |
| `service_unavailable` | The data source could not be reached for the rest of the run. Run what is left again later. | No |
| `failed` | The data source kept failing after several retries. The Actor stops sending requests and the run ends as failed. | No |
| `not_attempted` | Not requested because an earlier request failed. | No |
| `charge_limit_reached` | Not requested because the run reached your maximum charge. | No |

Comment rows filter out cleanly: keep the rows whose `commentId` is not null. The SUMMARY record in the default key-value store (**Per-video summary**) lists every input video after deduplication. Each video shows its status, the number of comments exported, and the source's reported page and comment totals. It also shows the fees charged (`feesCharged`). With replies on, each video gets a `replies` block:

- threads requested,
- replies reported vs exported,
- a count per status,
- threads cut by the cap,
- the reason for every thread that was not collected.

If Apify restarts a run on another server, the Actor reuses every answer and fee it already saved, so nothing is charged twice.

### Limits

- The data source reaches up to roughly 450 top-level comments per video, in TikTok's default order, and can return fewer. On a video showing 1,503 comments (replies included), a run at the 450 limit returned 375 unique top-level comments.
- A comment's `replyCount` comes from TikTok and can differ slightly from the replies returned (hidden or deleted replies, replies added since). SUMMARY shows both numbers per video.
- Threads are read three at a time. When the data source is busy, the Actor waits and retries, for up to about two minutes per request, before reporting the video or thread as failed.
- Comment authors are returned as usernames only; profile data is outside this Actor's scope.
- Data comes from API Direct, a TikTok data API this Actor pays for.

# Actor input Schema

## `videos` (type: `array`):

Enter 1–100 full TikTok video or photo-post links, or decimal video IDs, one per line. Repeated video IDs are collected once. Short share links (vm.tiktok.com) are not accepted: open them and copy the full link.

## `maxCommentsPerVideo` (type: `integer`):

Export up to this many top-level comments per video. Each video costs $0.01, plus $0.0002 per comment exported.

## `includeReplies` (type: `boolean`):

Also export the replies under each comment. Each comment that has replies costs $0.01 for its thread, plus $0.0002 per reply; comments without replies cost nothing extra.

## `maxRepliesPerComment` (type: `integer`):

Used only when Include replies is on: export up to this many replies per comment.

## Actor input object example

```json
{
  "videos": [
    "https://www.tiktok.com/@bbcnews/video/7690902917741726979"
  ],
  "maxCommentsPerVideo": 50,
  "includeReplies": false,
  "maxRepliesPerComment": 50
}
```

# Actor output Schema

## `comments` (type: `string`):

No description

## `summary` (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 = {
    "videos": [
        "https://www.tiktok.com/@bbcnews/video/7690902917741726979"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("a.actors/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 = { "videos": ["https://www.tiktok.com/@bbcnews/video/7690902917741726979"] }

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,a.actors/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/I4OBmMHWK41enT7Mv/builds/ZPVqnBaLMRPmkL9oF/openapi.json
