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

Scrape TikTok comments and replies from any video: text, likes, reply counts, authors, mentions, and dates. No login, no browser. Export to JSON, CSV, Excel.

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

## Pricing

$0.30 / 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: comments, replies, likes, and authors from any video

TikTok Comments Scraper collects the public comments of TikTok videos and photo posts. For every comment you get the text, its language, the publish date, likes, the reply count, the author's username, display name, and avatar, users mentioned in it, attached images, and whether the creator liked or pinned it. Turn on replies to get each thread too, with every reply linked to the comment it answers.

You don't need a TikTok account, an API key, or any code. Paste the post links, press **Start**, and download the comments as JSON, CSV, Excel, XML, or HTML. Or pull them straight into your app through the Apify API.

### What can you do with TikTok comments?

- **Measure how people react.** Read what viewers say about your video, a competitor's campaign, or a product launch, and run sentiment analysis on the text.
- **Find questions and complaints.** Comments are where buyers ask about price, sizes, and shipping. Pull them into a spreadsheet and answer in bulk.
- **Spot your most engaged fans.** Sort by likes and replies to find the commenters who drive the conversation, then reach out to them.
- **Check a creator before a deal.** Real comments tell you more about an audience than follower counts do.
- **Run giveaways.** Collect every comment on a giveaway post and pick a winner from the list.
- **Build datasets.** Export thousands of comments in many languages for research or model training.

### What data does TikTok Comments Scraper extract?

| Group | Fields |
|---|---|
| Comment | comment ID, text, detected language, publish time (Unix and ISO 8601), likes, reply count |
| Thread | type (comment or reply), the ID of the comment a reply answers |
| Author | user ID, username, display name, profile URL, avatar |
| Creator signals | liked by the creator, pinned by the creator |
| Mentions | users tagged in the comment, with user ID and secUid |
| Media | images attached to the comment |
| Post | post ID, post URL, and the input that led to it |

### How to scrape TikTok comments

1. Open the actor and go to the **Input** tab.
2. Paste one or more post links. Full links, short links such as `vm.tiktok.com/...`, and bare post IDs all work.
3. Set **Comments per post**, and **Replies per comment** if you want threads.
4. Press **Start**. When the run finishes, open the **Output** tab to preview the table, or press **Export** to download the data.

### Input

| Field | Type | Description |
|---|---|---|
| `postURLs` | array of strings | TikTok video or photo links, short links, or post IDs. Required. |
| `commentsPerPost` | integer | The maximum number of top-level comments per post. Replies don't count toward it. |
| `maxRepliesPerComment` | integer | The maximum number of replies per comment, replies to replies included. `0` skips replies. |
| `proxyCountryCode` | string | A two-letter country code such as `US` or `DE` to use Apify residential proxy in that country. `None` uses Apify datacenter proxy. |

#### Input example

```json
{
  "postURLs": [
    "https://www.tiktok.com/@yycats8/video/7583279464440777998",
    "https://vm.tiktok.com/ZMhabc123/",
    "7693138745406524673"
  ],
  "commentsPerPost": 500,
  "maxRepliesPerComment": 20,
  "proxyCountryCode": "None"
}
```

### Output

Every comment and every reply becomes one row. Replies come right after the comment they belong to, so the table reads like the thread on TikTok. Rebuild the tree with `repliesToId`: it holds the `cid` of the comment or reply each reply answers.

#### Output example

A real comment from a cat video and its reply. The avatar links are shortened.

```json
[
  {
    "type": "comment",
    "cid": "7583326235120616248",
    "postId": "7583279464440777998",
    "postUrl": "https://www.tiktok.com/@yycats8/video/7583279464440777998",
    "text": "donde estaba mi michi",
    "language": "es",
    "createTime": 1765630738,
    "createTimeISO": "2025-12-13T12:58:58.000Z",
    "diggCount": 11,
    "replyCommentTotal": 1,
    "uid": "7433577230121354246",
    "uniqueId": "martha.estrada.ma1",
    "nickname": "Martha Estrada Maturano",
    "profileUrl": "https://www.tiktok.com/@martha.estrada.ma1",
    "avatarThumbnail": "https://p16-common-sign.tiktokcdn-eu.com/tos-maliva-avt-0068/1a02acb...",
    "likedByAuthor": false,
    "pinnedByAuthor": false,
    "mentions": [],
    "detailedMentions": [],
    "input": "https://www.tiktok.com/@yycats8/video/7583279464440777998"
  },
  {
    "type": "reply",
    "cid": "7583405270299902733",
    "postId": "7583279464440777998",
    "postUrl": "https://www.tiktok.com/@yycats8/video/7583279464440777998",
    "text": "😳😳😳😂😂😂😂 ay el michi ahi viene",
    "language": "es",
    "createTime": 1765649172,
    "createTimeISO": "2025-12-13T18:06:12.000Z",
    "diggCount": 0,
    "replyCommentTotal": 0,
    "repliesToId": "7583326235120616248",
    "uid": "7422052881577362478",
    "uniqueId": "gas3242",
    "nickname": "gas",
    "profileUrl": "https://www.tiktok.com/@gas3242",
    "avatarThumbnail": "https://p16-common-sign.tiktokcdn-eu.com/musically-maliva-obj/159480...",
    "likedByAuthor": false,
    "pinnedByAuthor": false,
    "mentions": [],
    "detailedMentions": [],
    "input": "https://www.tiktok.com/@yycats8/video/7583279464440777998"
  }
]
```

#### Output fields

| Field | Description |
|---|---|
| `type` | `comment` for a top-level comment, `reply` for a reply. |
| `cid` | TikTok comment ID. |
| `postId`, `postUrl` | The post the comment belongs to. When the input is a bare post ID, the URL has no username in it (`https://www.tiktok.com/@/video/...`) and still opens the post. |
| `text` | The comment text. TikTok's emoji stickers show as their names in brackets, for example `[Laugh approved]`. |
| `language` | The language TikTok detected. `un` means TikTok couldn't tell. |
| `createTime`, `createTimeISO` | Publish time as a Unix timestamp and as an ISO 8601 string in UTC. |
| `diggCount` | Likes. |
| `replyCommentTotal` | How many replies TikTok counts under the comment. `0` for replies. |
| `repliesToId` | For replies, the `cid` of the comment or reply this one answers. |
| `uid`, `uniqueId`, `nickname`, `profileUrl`, `avatarThumbnail` | The author: user ID, username, display name, profile link, and avatar. |
| `likedByAuthor` | `true` when the creator of the post liked the comment. |
| `pinnedByAuthor` | `true` when the creator pinned the comment. |
| `mentions`, `detailedMentions` | Users tagged in the comment, as the comment shows them, with user ID and secUid. |
| `images` | Images attached to the comment. |
| `input` | The link or ID from your input. |

### How many comments can I get?

In our tests, the actor collected 4,796 of the 5,600 comments on a busy video in 37 seconds, and 40 comments with 1,509 replies in 18 seconds. TikTok's comment feed has gaps: a page can come back empty while later pages are full again. The actor skips over these gaps, which is how it gets far past the first few hundred comments. It stops after several empty pages in a row, so expect most, but not always all, of a post's comments.

Replies to replies count toward **Replies per comment**, and TikTok's reply count doesn't always match the replies it serves.

### How much does it cost?

You pay $0.30 per 1,000 rows, where each comment and each reply is one row. 1,000 comments without replies cost $0.30.

The actor reads TikTok's comment data directly, with no browser, so it runs on 128 MB of memory and finishes fast.

### Export and integrations

The results go into an Apify dataset. From there you can:

- download them as JSON, CSV, Excel, XML, HTML, or RSS from the **Output** tab;
- send them to Google Sheets, Slack, Zapier, Make, and other tools through Apify integrations;
- schedule runs to watch new comments on your posts;
- start runs and read the results from your own code through the Apify API.

#### Run it through the API

```bash
curl -X POST "https://api.apify.com/v2/acts/<username>~tiktok-comments-scraper/run-sync-get-dataset-items?token=<YOUR_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"postURLs": ["https://www.tiktok.com/@yycats8/video/7583279464440777998"], "commentsPerPost": 100}'
```

The call waits for the run to finish and returns the comments as a JSON array.

### FAQ

#### Do I need a TikTok account?

No. The actor reads the comments TikTok shows to anyone who opens the video without logging in.

#### Can I scrape the videos themselves?

Not with this actor. Use a TikTok video scraper to collect posts by hashtag or profile, then paste their links here.

#### Why did I get fewer comments than the post shows?

TikTok's count includes comments it hides, deletes, or filters, and its feed has gaps the actor can't fill. On busy posts expect most of the comments rather than every single one.

#### Why do avatar and image links stop working?

TikTok signs these links for a few hours. Download the files soon after the run if you need to keep them.

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

The actor collects only public data that anyone can see without logging in. Comments still contain personal data such as usernames, so make sure you have a legitimate reason to collect it and follow the GDPR and other laws that apply to you. If you're not sure, ask a lawyer.

### Disclaimer

This actor is provided as is, without warranty. You're responsible for how you use it and for following TikTok's terms of service and the laws that apply to you. TikTok isn't affiliated with this actor.

# Actor input Schema

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

TikTok video or photo post links (https://www.tiktok.com/@user/video/...), short links (vm.tiktok.com/..., tiktok.com/t/...), or bare post IDs.

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

The maximum number of top-level comments to scrape from each post. Replies don't count toward this limit.

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

The maximum number of replies to scrape under each comment, replies to replies included. 0 skips replies.

## `proxyCountryCode` (type: `string`):

Two-letter country code (US, DE, ...) to use Apify residential proxy in that country. "None" uses Apify datacenter proxy.

## Actor input object example

```json
{
  "postURLs": [
    "https://www.tiktok.com/@ruslan1654xa/video/7693138745406524673"
  ],
  "commentsPerPost": 100,
  "maxRepliesPerComment": 0,
  "proxyCountryCode": "None"
}
```

# Actor output Schema

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

One item per comment or reply, in the order TikTok lists them, each reply right after its thread.

# 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/@ruslan1654xa/video/7693138745406524673"
    ],
    "commentsPerPost": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("donjuan_mime/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/@ruslan1654xa/video/7693138745406524673"],
    "commentsPerPost": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("donjuan_mime/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/@ruslan1654xa/video/7693138745406524673"
  ],
  "commentsPerPost": 100
}' |
apify call donjuan_mime/tiktok-comments-scraper --silent --output-dataset

```

## MCP server setup

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