# TikTok Comments Scraper (`harpoon/tiktok-comments-scraper`) Actor

Scrape the comments and replies of public TikTok posts - text, authors, likes, and timestamps.

- **URL**: https://apify.com/harpoon/tiktok-comments-scraper.md
- **Developed by:** [Harpoon](https://apify.com/harpoon) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

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

Scrape the comments and replies of any public TikTok post - text, authors, likes, and timestamps - as one clean dataset. Paste post URLs, press **Start**, and export JSON/CSV/Excel.

### What can this Actor do?

- **All comments on a post** - top-level comments paginated up to your `max_comments` cap.
- **Replies included (optional)** - fetch each comment's replies too; they are fetched in parallel and capped per comment so runs stay fast.
- **Author details** - username, nickname, id, and avatar for every commenter.
- **Engagement signal** - likes per comment, plus the comment's own reply count.
- **Reply threading** - replies carry `is_reply: true` and their `parent_comment_id`, so you can rebuild threads.
- **Deduplicated** - a comment never appears twice, even across pages.

### Why use this Actor?

- **No code required** - the input form is prefilled with a working example; press Start and it runs as-is.
- **Fast replies** - replies are fetched concurrently (configurable), not one-by-one.
- **Reliable at scale** - rotating proxy pool, request hedging, and automatic retries handle TikTok's variability.
- **Clean schema** - a single flat row per comment, ready for your warehouse, sheet, or dashboard.
- **Pay per result** - you only pay for the comments that actually land in the dataset.

### How to use it

1. Open the **Input** tab.
2. Paste one or more post URLs into **Posts**.
3. Set **Max comments per post** (default `100`).
4. Leave **Include replies** on to also capture replies, and set **Max replies per comment** (default `20`).
5. Press **Start** and download your data from the **Output** tab.

```json
{
  "posts": ["https://www.tiktok.com/@mahmoudridaabbas/video/7510595766524710149"],
  "max_comments": 100,
  "include_replies": true,
  "max_replies_per_comment": 20
}
```

Accepted post references: `https://www.tiktok.com/@user/video/<id>`, `/photo/<id>`, or a bare numeric post id.

### Output

One dataset row per comment (and per reply):

```json
{
  "id": "7679295720671396616",
  "post_id": "7510595766524710149",
  "post_url": "https://www.tiktok.com/video/7510595766524710149",
  "text": "free palestina❤‍🩹",
  "created_at": 1787975380,
  "like_count": 141,
  "reply_count": 2,
  "is_reply": false,
  "parent_comment_id": "",
  "author_id": "7614149955695461394",
  "author_username": "fladosinagaa331",
  "author_nickname": "tipis tipis 🜲",
  "author_avatar_url": "https://p16-common-sign.tiktokcdn-eu.com/tos-alisg-avt-0068/a66dd4701510d688a34ef0cb5...",
  "language": "en",
  "scraped_at": "2026-09-18T14:07:26Z"
}
```

A reply to that comment looks like:

```json
{
  "id": "7679295720671396620",
  "post_id": "7510595766524710149",
  "post_url": "https://www.tiktok.com/video/7510595766524710149",
  "text": "@fladosinagaa331 ❤‍🩹",
  "created_at": 1787975450,
  "like_count": 3,
  "reply_count": 0,
  "is_reply": true,
  "parent_comment_id": "7679295720671396616",
  "author_id": "7614149955695461394",
  "author_username": "fladosinagaa331",
  "author_nickname": "tipis tipis 🜲",
  "author_avatar_url": "https://p16-common-sign.tiktokcdn-eu.com/tos-alisg-avt-0068/a66dd4701510d688a34ef0cb5...",
  "language": "en",
  "scraped_at": "2026-09-18T14:07:26Z"
}
```

| Field | Description |
| --- | --- |
| `id` | Comment id |
| `post_id` | Numeric id of the post |
| `post_url` | Canonical post URL |
| `text` | Comment text |
| `created_at` | Unix creation timestamp |
| `like_count` | Likes on the comment |
| `reply_count` | Number of replies the comment has |
| `is_reply` | `true` for replies, `false` for top-level comments |
| `parent_comment_id` | The top-level comment a reply belongs to (empty for top-level) |
| `author_id` / `author_username` / `author_nickname` / `author_avatar_url` | Commenter identity |
| `language` | Detected comment language |
| `scraped_at` | When the row was collected (ISO 8601) |

### Pricing

This Actor is billed per **1,000 results** (one result = one comment or reply). See the **Pricing** tab for the current rate. A run that returns no comments is not charged.

### FAQ

**Do I need cookies or a login?** No. Public posts only - no TikTok account required. The Actor uses a managed signature service and rotating residential proxies under the hood.

**Do replies count toward `max_comments`?** No. `max_comments` caps top-level comments; replies are additional rows bounded by `max_replies_per_comment`.

**How do I turn replies off?** Clear **Include replies** in the input. Top-level comments are always fetched.

**Can I run several posts at once?** Yes. Add one post URL per line; they are fetched in parallel.

### Limitations

- Only public posts.
- Comments TikTok hides or filters are not returned.
- Very large threads take longer; raise `max_replies_per_comment` or `TT_REPLY_CONCURRENCY` (`PROXY_*`/secrets) to tune speed versus depth.
- Result order follows TikTok's own comment ranking.

### Integrate with your stack

Export the dataset as JSON, CSV, Excel, or XML, or pull it from the Apify API. You can also run this Actor from the [Apify MCP server](https://apify.com/apify/actors-mcp-server) so AI agents can call it directly.

# Actor input Schema

## `posts` (type: `array`):

<b>Public TikTok post URLs</b>, one per line. Accepts <code>https://www.tiktok.com/@mahmoudridaabbas/video/7510595766524710149</code>, a <code>/photo/</code> URL, or a bare numeric post id. Duplicates are removed automatically.

## `max_comments` (type: `integer`):

How many top-level comments to return per post. Replies are additional rows (see below), so the final row count can be higher.

## `include_replies` (type: `boolean`):

Also fetch the replies under each top-level comment. Replies are fetched in parallel and are added on top of <b>Max comments per post</b>.

## `max_replies_per_comment` (type: `integer`):

Cap on replies fetched for each top-level comment. Ignored when <b>Include replies</b> is off.

## Actor input object example

```json
{
  "posts": [
    "https://www.tiktok.com/@mahmoudridaabbas/video/7510595766524710149"
  ],
  "max_comments": 100,
  "include_replies": true,
  "max_replies_per_comment": 20
}
```

# Actor output Schema

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

One row per scraped comment (and reply). Export as JSON, CSV, Excel, or XML.

# 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 = {
    "posts": [
        "https://www.tiktok.com/@mahmoudridaabbas/video/7510595766524710149"
    ],
    "max_comments": 100,
    "include_replies": true,
    "max_replies_per_comment": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("harpoon/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 = {
    "posts": ["https://www.tiktok.com/@mahmoudridaabbas/video/7510595766524710149"],
    "max_comments": 100,
    "include_replies": True,
    "max_replies_per_comment": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("harpoon/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 '{
  "posts": [
    "https://www.tiktok.com/@mahmoudridaabbas/video/7510595766524710149"
  ],
  "max_comments": 100,
  "include_replies": true,
  "max_replies_per_comment": 20
}' |
apify call harpoon/tiktok-comments-scraper --silent --output-dataset

```

## MCP server setup

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