# TikTok Comments Scraper – Export Comments & Replies (`harshmaur/tiktok-comments-scraper`) Actor

Export TikTok comments and replies from video URLs. Collect comment text, usernames, likes, timestamps, mentions and parent comment IDs in CSV, Excel or JSON. Set limits for each video and reply thread. No TikTok login required.

- **URL**: https://apify.com/harshmaur/tiktok-comments-scraper.md
- **Developed by:** [Harsh Maur](https://apify.com/harshmaur) (community)
- **Categories:** Social media, Videos
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 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 Scraper

Turn TikTok video links into a table of comments and replies. Use it to review audience questions, track reactions to a campaign, or prepare comment text for your own analysis. You do not need a TikTok account or session cookies.

### TikTok comments scraper for video URLs

Paste links into `postURLs` and choose `commentsPerPost`. Each successful row contains one comment or reply with `dataType: "comment"`. The dataset does not include video, profile or follower rows. If a post cannot be read, a free `failed` row explains the reason.

The scraper accepts full video links, photo-post links, short TikTok share links and video IDs. It reads comments that TikTok makes available to logged-out visitors. Private, removed or restricted posts may not return comments.

```json
{
  "postURLs": [
    "https://www.tiktok.com/@looooooooch/video/7332342275151760642"
  ],
  "commentsPerPost": 100,
  "topLevelCommentsPerPost": 20,
  "maxRepliesPerComment": 5
}
```

| Input | Effect |
| --- | --- |
| `postURLs` | Video links to inspect. At least one is required. |
| `commentsPerPost` | Total comments and replies per video, from 1 to 100,000. Omitted: 100. |
| `topLevelCommentsPerPost` | Optional cap on parent comments, at least 1. |
| `maxRepliesPerComment` | Replies under each parent, from 0 to 100,000. Omitted: 0. |

### TikTok comment replies with parent IDs

Set `maxRepliesPerComment` above zero to collect reply threads. Both parent comments and replies use the same row format. A reply's `repliesToId` points to its parent comment's `cid`; a top-level comment has `repliesToId: null`.

Replies share the per-video allowance with parent comments. For example, a total limit of 10 can contain two parent comments and eight replies. The scraper follows TikTok's comment order, so a busy thread can use the allowance before later parent comments are reached.

`replyCommentTotal` is TikTok's reported reply count, not the number of replies downloaded. Deleted comments, visibility restrictions and TikTok's available pages can make the returned count lower than the limit.

### Export TikTok comments to CSV, Excel or JSON

Open the run's dataset and choose an export format. CSV and Excel suit review in a spreadsheet; JSON preserves arrays such as `mentions`, `detailedMentions` and `imageUrls`.

This illustrative row shows the comment fields:

```json
{
  "dataType": "comment",
  "videoWebUrl": "https://www.tiktok.com/@looooooooch/video/7332342275151760642",
  "submittedVideoUrl": null,
  "input": "https://www.tiktok.com/@looooooooch/video/7332342275151760642",
  "cid": "7332342275151760643",
  "text": "This made my day!",
  "createTime": 1707408000,
  "createTimeISO": "2024-02-08T16:00:00.000Z",
  "diggCount": 12,
  "likedByAuthor": false,
  "pinnedByAuthor": false,
  "repliesToId": null,
  "replyCommentTotal": 3,
  "uid": "123456789",
  "uniqueId": "example.viewer",
  "nickname": "Example viewer",
  "avatarThumbnail": null,
  "commentLanguage": "en",
  "mentions": [],
  "detailedMentions": [],
  "imageUrls": []
}
```

### TikTok comments scraper pricing

The automatic start charge is **$0.0005 per comments run**. Comment prices stay fixed for all plans; discount tiers do not apply.

Comments and replies cost **$0.0002 per delivered row** ($0.20 per 1,000). Each reply is one row.

A failed target adds no comment charge, although the run start fee remains. This listing only bills delivered comments and replies after startup. Its Store pricing panel contains the configured prices.

### FAQ: scrape and export TikTok comments

#### Can I collect comments without replies?

Yes. Keep `maxRepliesPerComment` at 0. Raise it only when you need conversation threads.

#### Why do I get fewer comments than requested?

Limits are ceilings. TikTok can hide comments from logged-out visitors or stop serving pages before the displayed total. A post with comments disabled can return an empty dataset.

#### Does this collect comments from every video on a profile?

This form takes individual video links. Use the [all-in-one TikTok Scraper](https://apify.com/harshmaur/tiktok-scraper) to discover videos from profiles, hashtags or searches and collect their comments.

#### Are comment sentiment labels or video downloads included?

The output contains comment data only. Export the text for analysis in your own tools. Video downloads and video AI options are available in the other listings below.

### More TikTok scrapers

- [TikTok Scraper](https://apify.com/harshmaur/tiktok-scraper): combine discovery, comments and video enrichment in one run.
- [TikTok Comments Scraper](https://apify.com/harshmaur/tiktok-comments-scraper): return to this video-comment export form.
- [TikTok Profile Scraper](https://apify.com/harshmaur/tiktok-profile-scraper): collect creator information.
- [TikTok Video Scraper](https://apify.com/harshmaur/tiktok-video-scraper): extract data from selected posts.
- [TikTok Hashtag Scraper](https://apify.com/harshmaur/tiktok-hashtag-scraper): find posts associated with hashtags.
- [TikTok Transcript Scraper](https://apify.com/harshmaur/tiktok-transcript-scraper): retrieve video captions and transcripts.

# Actor input Schema

## `postURLs` (type: `array`):

Paste video or photo-post links to collect their comments. Short vm.tiktok.com and vt.tiktok.com links and video IDs also work. Unavailable posts produce a free failure row.

## `commentsPerPost` (type: `integer`):

Maximum comment rows per video, including replies. If omitted, collect up to 100. TikTok may expose fewer comments than requested.

## `topLevelCommentsPerPost` (type: `integer`):

Optional maximum of top-level comments per video. Leave empty to use only the total comment limit. Each selected comment can also supply replies.

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

Maximum replies under each top-level comment. Replies count toward Comments per video. Keep 0 to collect only top-level comments.

## Actor input object example

```json
{
  "postURLs": [
    "https://www.tiktok.com/@looooooooch/video/7332342275151760642"
  ],
  "commentsPerPost": 100,
  "maxRepliesPerComment": 0
}
```

# Actor output Schema

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

Comment and reply rows.

## `failed` (type: `string`):

Inputs that could not be scraped, with the reason. Not charged.

# 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 = {
    "postURLs": [
        "https://www.tiktok.com/@looooooooch/video/7332342275151760642"
    ],
    "commentsPerPost": 100,
    "maxRepliesPerComment": 0
};

// Run the Actor and wait for it to finish
const run = await client.actor("harshmaur/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 = {
    "postURLs": ["https://www.tiktok.com/@looooooooch/video/7332342275151760642"],
    "commentsPerPost": 100,
    "maxRepliesPerComment": 0,
}

# Run the Actor and wait for it to finish
run = client.actor("harshmaur/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 '{
  "postURLs": [
    "https://www.tiktok.com/@looooooooch/video/7332342275151760642"
  ],
  "commentsPerPost": 100,
  "maxRepliesPerComment": 0
}' |
apify call harshmaur/tiktok-comments-scraper --silent --output-dataset

```

## MCP server setup

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