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

TikTok comments scraper and API: export comments and replies from any TikTok video with text, likes, reply counts, dates and author profile. No login, no cookies.

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

## Pricing

from $0.18 / 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

Export the comments of any TikTok video as clean data: comment text, post time, likes,
reply count, pinned and "liked by creator" flags, @-mentions, attached images and the
commenter's username, nickname, ID and avatar. Optionally get the replies to every comment
too, linked to their parent comment. Paste video links, short links or video IDs. No TikTok
account, no login, no cookies. Export as JSON, CSV or Excel, or use it as a TikTok comments
API.

### What does TikTok Comments Scraper do?

Add TikTok video links such as
**https://www.tiktok.com/@khaby.lame/video/7705603633437527327** and the scraper returns
one record per comment:

- **Comment** — `text`, `createdAt` (ISO, UTC), `likeCount`, `replyCount`, `language`,
  `isPinned`, `likedByCreator` ("Liked by creator" badge), `isByCreator` (written by the
  video's creator), `mentions` and `mentionedUserIds`, `hashtags`, `imageUrls` (photo
  comments).
- **Commenter** — `authorUsername`, `authorNickname`, `authorId`, `authorSecUid`,
  `authorProfileUrl`, `authorAvatarUrl`.
- **Video** — `videoId`, `videoUrl`, `videoCommentCount` (TikTok's total for the video).
- **Replies** (optional) — records with `type: "reply"`, the `parentCommentId` they belong
  to and, for replies to a reply, `repliedToCommentId` and `repliedToUsername`.

Comments come in TikTok's own order (the one you see in the app), page by page, as deep as
you want.

### Use cases

- **Audience research** — read what viewers really say about a product, creator or trend.
- **Sentiment analysis and AI** — feed thousands of comments into a sentiment model, topic
  clustering or an LLM summary.
- **Brand and campaign monitoring** — track reactions to your own or sponsored videos and
  spot complaints early.
- **Influencer vetting** — check whether a creator's comment section is genuine and how the
  creator engages (likes and replies from the creator are flagged).
- **Giveaways and contests** — collect every commenter and @-mention to pick winners.
- **Lead and community research** — find active commenters in your niche with links to
  their profiles.

### How much does it cost?

You pay only for the comments you get (pay-per-event). Duplicates and comments above your
limits are never charged.

| Event | What you pay for | Free plan | Paid plans (from) |
| --- | --- | --- | --- |
| `comment` | One TikTok comment or reply with text, likes, date and commenter | $0.225 per 1,000 | $0.18 per 1,000 |

"Paid plans (from)" is the Gold-and-above price; Bronze ($0.21) and Silver ($0.195) sit in
between. Apify also charges a tiny actor-start fee per run.

Worked examples (Free plan prices):

1. **Quick check** — the prefilled input (20 comments of one video) costs
   20 × $0.225 / 1,000 = **$0.0045**.
2. **Campaign report** — 50 videos with 500 comments each and up to 10 replies per comment
   (say 3,000 replies per video) = 175,000 records: 175,000 × $0.225 / 1,000 = **$39.38**
   ($31.50 on Gold+). Without replies: 25,000 comments = **$5.63**.

Apify Free plan includes $5 monthly credit, enough for about 22,000 comments every month.

### How to use TikTok Comments Scraper

1. Open the actor in Apify Console and click **Try for free**.
2. In **Video URLs**, add TikTok video links, short links (`vm.tiktok.com/…`,
   `tiktok.com/t/…`) or bare video IDs.
3. Set **Max comments per video** and, if you want replies, tick **Include replies** and set
   **Max replies per comment**.
4. Click **Start**. 50 comments take about one second.
5. Open the **Output** tab and export as JSON, CSV, Excel or HTML.

Through the API:

1. Get your API token in Apify Console → Settings → Integrations.
2. Call the actor with your input JSON (see [Integrations and API](#integrations-and-api)).
3. Read the dataset items from the run.

### Input

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `videoUrls` | array | – | Video or photo links (`https://www.tiktok.com/@user/video/<id>`), short links or bare video IDs. Required. |
| `maxCommentsPerVideo` | integer | `100` | Top-level comments per video, in TikTok's order. Replies are not counted here. |
| `includeReplies` | boolean | `false` | Also get the replies to each comment. |
| `maxRepliesPerComment` | integer | `20` | Replies per comment when `includeReplies` is on. |
| `maxItems` | integer | `1000` | Hard cap on records (comments + replies) for the whole run. |
| `proxyConfiguration` | object | Apify Proxy | Proxy settings. The default works; blocked requests are retried on a new IP. |
| `debug` | boolean | `false` | Log retries and every page. |

Example — two videos, 500 comments each, with up to 10 replies per comment:

```json
{
    "videoUrls": [
        "https://www.tiktok.com/@khaby.lame/video/7705603633437527327",
        "https://vm.tiktok.com/ZMAbc123/"
    ],
    "maxCommentsPerVideo": 500,
    "includeReplies": true,
    "maxRepliesPerComment": 10,
    "maxItems": 10000
}
```

### Output

One record per comment or reply. Example (shortened avatar link):

```json
{
    "id": "7706611506250990357",
    "url": "https://m.tiktok.com/v/7706609392841461005.html?comment_id=7706611506250990357",
    "type": "comment",
    "text": "how fast duolingo do the trends",
    "createdAt": "2026-11-10T18:28:53Z",
    "likeCount": 3111,
    "replyCount": 19,
    "parentCommentId": null,
    "repliedToCommentId": null,
    "repliedToUsername": null,
    "isPinned": false,
    "likedByCreator": true,
    "isByCreator": false,
    "language": "en",
    "mentions": [],
    "mentionedUserIds": [],
    "hashtags": [],
    "imageUrls": [],
    "authorId": "6999624294619841542",
    "authorUsername": "yk.m3_lil0",
    "authorNickname": "𝐶🪽",
    "authorSecUid": "MS4wLjABAAAACBbB…",
    "authorProfileUrl": "https://www.tiktok.com/@yk.m3_lil0",
    "authorAvatarUrl": "https://p16-common-sign.tiktokcdn-eu.com/tos-alisg-avt-0068/46def9fb76ecbd6680dae38a3e9da6d2~…",
    "videoId": "7706609392841461005",
    "videoUrl": "https://m.tiktok.com/v/7706609392841461005.html",
    "videoCommentCount": 7538,
    "sourceUrl": "7706609392841461005",
    "scrapedAt": "2026-11-21T10:40:00Z"
}
```

| Field | Description |
| --- | --- |
| `id` | TikTok comment ID (stable). |
| `url` | Link to the video with the comment highlighted. |
| `type` | `comment` (top level) or `reply`. |
| `text`, `language` | Comment text and TikTok's language guess. |
| `createdAt` | Post time, ISO 8601, UTC. |
| `likeCount`, `replyCount` | Likes; number of replies (comments only, `null` on replies). |
| `parentCommentId` | For replies: the comment they belong to. |
| `repliedToCommentId`, `repliedToUsername` | For replies to a reply: whom they answer. |
| `isPinned`, `likedByCreator`, `isByCreator` | Pinned by the creator, liked by the creator, written by the creator. |
| `mentions`, `mentionedUserIds`, `hashtags` | @-mentions as shown in the text, their user IDs, hashtags. |
| `imageUrls` | Photos attached to the comment. |
| `author*` | Commenter's ID, username, nickname, secUid, profile link and avatar. |
| `videoId`, `videoUrl`, `videoCommentCount` | The video and its total comment count. |
| `sourceUrl`, `scrapedAt` | The input the record came from and when it was scraped. |

A video link with an `@user` part gives `www.tiktok.com/@user/video/…` links; a bare video ID
gives TikTok's short form `m.tiktok.com/v/<id>.html`, which opens the same video.

The run's key-value store holds a `SUMMARY` record with counts (videos, comments, requests),
whether the maximum cost per run was reached, and a sample of per-video errors.

### Integrations and API

Run the actor from any language through the Apify API or the official clients, and connect
it to Make, Zapier, n8n, Google Sheets, Slack, webhooks or your own app.

Python:

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("innolabs/tiktok-comments-scraper").call(run_input={
    "videoUrls": ["https://www.tiktok.com/@khaby.lame/video/7705603633437527327"],
    "maxCommentsPerVideo": 200,
    "includeReplies": True,
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["authorUsername"], item["likeCount"], item["text"])
```

cURL (run synchronously and get the items):

```bash
curl -X POST "https://api.apify.com/v2/acts/innolabs~tiktok-comments-scraper/run-sync-get-dataset-items?token=<YOUR_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"videoUrls": ["https://www.tiktok.com/@khaby.lame/video/7705603633437527327"], "maxCommentsPerVideo": 50}'
```

The actor also works as a tool for AI agents through the Apify MCP server.

### FAQ

#### Do I need a TikTok account or cookies?

No. The scraper reads the same public comment data the TikTok website shows to visitors who
are not logged in. You never share a login, cookie or API key.

#### How many comments can I get per video?

As many as TikTok shows: set **Max comments per video** to the number you need. Each page
holds up to 50 comments, so 1,000 comments take about 20 requests and a few seconds.
TikTok's `videoCommentCount` includes replies and removed comments, so the number of
top-level comments you can actually get is usually lower.

#### How do replies work?

Tick **Include replies** and every comment that has replies is followed by up to **Max
replies per comment** reply records (`type: "reply"`, `parentCommentId` set). TikTok's reply
pages sometimes repeat a reply; the scraper skips the repeats, so you are never charged
twice.

#### In what order do comments come?

In TikTok's own order, the same as in the app: popular and relevant comments first, not
strictly by date. Sort by `createdAt` or `likeCount` after the run if you need another order.

#### What happens with wrong, deleted or private videos?

A video that does not exist, is private or has comments turned off returns no records and
is listed in the `SUMMARY` errors; the other videos in the run continue. Text that is not a
TikTok video link stops the run right away with a clear message, before anything is charged.

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

The scraper only collects publicly visible data. Comments contain personal data (usernames,
nicknames); make sure your use complies with GDPR and other applicable laws and with
TikTok's terms, and process only what you need.

### Limits

- Public videos only; private videos and videos with comments turned off return nothing.
- Comments come in TikTok's relevance order; there is no "newest first" option.
- `videoCommentCount` is TikTok's total and can be higher than the comments you can get.
- Avatar and image links are signed by TikTok and expire after a few days; download them
  soon if you need them.
- Video statistics (plays, likes, shares) are not part of comment records.

# Changelog

This Actor's version history is a separate document: https://apify.com/innolabs/tiktok-comments-scraper/changelog.md

# Actor input Schema

## `videoUrls` (type: `array`):

TikTok video or photo links such as https://www.tiktok.com/@nba/video/7710515855678901535, short links (vm.tiktok.com/…, tiktok.com/t/…) or bare video IDs.

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

Top-level comments per video, in TikTok's own order (most relevant first). Replies are not counted here.

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

Also scrape the replies to each comment (one extra request per comment with replies). Replies are records of type "reply" with parentCommentId set.

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

Replies per comment when Include replies is on, oldest first.

## `maxItems` (type: `integer`):

Hard cap on records (comments + replies) for the whole run. The run stops cleanly when reached and you are never charged above it.

## `proxyConfiguration` (type: `object`):

Apify Proxy (datacenter) works for TikTok's comment API. Switch to RESIDENTIAL only if runs get blocked.

## `debug` (type: `boolean`):

Verbose logs for development.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.tiktok.com/@khaby.lame/video/7705603633437527327"
  ],
  "maxCommentsPerVideo": 20,
  "includeReplies": false,
  "maxRepliesPerComment": 20,
  "maxItems": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "debug": false
}
```

# Actor output Schema

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

All records produced by the run: comments (type comment) and, with Include replies, replies (type reply).

# 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 = {
    "videoUrls": [
        "https://www.tiktok.com/@khaby.lame/video/7705603633437527327"
    ],
    "maxCommentsPerVideo": 20,
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("innolabs/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 = {
    "videoUrls": ["https://www.tiktok.com/@khaby.lame/video/7705603633437527327"],
    "maxCommentsPerVideo": 20,
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("innolabs/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 '{
  "videoUrls": [
    "https://www.tiktok.com/@khaby.lame/video/7705603633437527327"
  ],
  "maxCommentsPerVideo": 20,
  "maxItems": 20
}' |
apify call innolabs/tiktok-comments-scraper --silent --output-dataset

```

## MCP server setup

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