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

Scrape TikTok comments for one video: text, likes, reply counts, timestamps and commenter profiles. Optional replies.

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

## Pricing

from $0.30 / 1,000 results

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 (Apify Actor)

Scrape the comments of one or many TikTok videos — text, likes, reply counts,
timestamps and commenter profiles — with optional replies.

### Input

```json
{
  "startUrls": [
    "https://www.tiktok.com/@billieeilish/video/7050551461734042926",
    "https://www.tiktok.com/@gordonramsayofficial/video/7229884545150061851"
  ],
  "maxCommentsPerVideo": 100,
  "maxComments": 200,
  "includeReplies": false
}
```

| Field | Type | Default | Description |
|---|---|---|---|
| `startUrls` | array of strings, **required** | — | 1–50 video URLs. The list uses Apify's **Bulk edit** button, so you can paste one URL per line instead of adding them one at a time. Also accepts `photo` URLs, `vm.tiktok.com` short links, `tiktok.com/t/...` share links and bare numeric ids. |
| `maxCommentsPerVideo` | integer | `100` | Items each URL may contribute, `1`–`10000`. Replies count towards it. This is what stops a 190,000-comment video from swallowing the whole run. |
| `maxComments` | integer | `1000` | Items to collect **across every URL**, `1`–`100000`. Replies count towards it too. |
| `includeReplies` | boolean | `false` | Also scrape replies. They arrive as their own items with `parentId` and `isReply: true`. |

Two caps, and whichever is reached first wins. With

```json
{"startUrls": [A, B], "maxCommentsPerVideo": 100, "maxComments": 150}
```

the run takes 100 from A, then 50 from B and stops: no single video can hog the
budget, and the total can never overshoot what you asked for. A URL with a huge
comment section no longer starves the next one — it is cut at its own cap and
the run moves on.

URLs are scraped in the order given. A URL that fails mid-way — a deleted video,
a transient 5xx — is logged and skipped, and the comments already collected are
kept. A URL that cannot be parsed at all fails the run before the first request,
so a typo costs nothing. Two URLs pointing at the same video (a short link plus
the canonical one) are scraped once.

### Output

One dataset item per comment or reply. Field names follow the leading TikTok
comment scraper so the two datasets line up column for column:

```json
{
  "inputSource": "https://www.tiktok.com/@tiktok/video/7698318115607825672",
  "type": "comment",
  "id": "7698455070791303967",
  "parentId": null,
  "isReply": false,
  "replyToCommentId": null,
  "text": "I'm in the wrong servers 😭✌️",
  "createdAt": "2026-10-19T18:58:11.000Z",
  "likeCount": 75,
  "replyCount": 3,
  "commentLanguage": "en",
  "awemeId": "7698318115607825672",
  "isAuthorLiked": false,
  "isPinned": false,
  "user": {
    "id": "7327046934728148010",
    "secUid": "MS4wLjABAAAA...",
    "username": "gotthis87",
    "displayName": "Marcus",
    "url": "https://www.tiktok.com/@gotthis87",
    "avatarUrl": "https://p16-common-sign.tiktokcdn.com/...",
    "verified": false
  }
}
```

| Field | Notes |
|---|---|
| `inputSource` | the URL from `startUrls` that produced this item |
| `type` | `comment` or `reply` |
| `id`, `parentId` | comment id; `parentId` is the thread a reply belongs to |
| `replyToCommentId` | for a reply inside a thread, the specific comment answered |
| `createdAt` | ISO-8601 UTC with milliseconds |
| `likeCount`, `replyCount` | `replyCount` is `0` on replies |
| `awemeId` | video id |
| `isPinned` | the creator pinned this comment |
| `user.secUid` | stable profile id, for joining to profile data |
| `user.avatarUrl` | TikTok CDN URL, expiring |
| `user.verified` | derived from the profile's verification label |

**Not included:** `user.bio`, `user.region`, `user.language`, `hasEmail`,
`hasPhone`, `coverImage`, follower counts. `user.secUid` is emitted instead, so
you can join to that data from another source if you need it.

**Ordering** is whatever TikTok returns, which is neither newest-first nor
like-sorted. If you need the top comments by likes, sort the dataset after
collection.

# Actor input Schema

## `startUrls` (type: `array`):

TikTok video URLs, up to 50 per run. Use the Bulk edit button on the list to paste many URLs at once, one per line. Photo posts, vm.tiktok.com short links, tiktok.com/t/... share links and bare numeric ids are accepted too.

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

How many items each URL may contribute. Use this so a video with hundreds of thousands of comments cannot consume the whole budget before the next URL is reached. Replies count towards it when they are enabled. Whichever of this and the total limit is reached first wins.

## `maxComments` (type: `integer`):

How many items to collect across all the URLs listed above. Replies count towards this number when they are enabled, exactly like the leading TikTok comment scrapers, so the size of the dataset is never a surprise. Two URLs of 100 each with a total of 150 stop after 150.

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

Also scrape the replies under each comment. Replies are written as their own items with parentId set and isReply true.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.tiktok.com/@billieeilish/video/7050551461734042926",
    "https://www.tiktok.com/@gordonramsayofficial/video/7229884545150061851"
  ],
  "maxCommentsPerVideo": 100,
  "maxComments": 500,
  "includeReplies": false
}
```

# Actor output Schema

## `results` (type: `string`):

Every comment and reply from the run, with author profiles, engagement counts, timestamps and parent links. Open the URL to get the dataset as JSON; the Console shows it as a table.

# 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 = {
    "startUrls": [
        "https://www.tiktok.com/@billieeilish/video/7050551461734042926"
    ],
    "maxCommentsPerVideo": 100,
    "maxComments": 1000
};

// Run the Actor and wait for it to finish
const run = await client.actor("grow_media/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 = {
    "startUrls": ["https://www.tiktok.com/@billieeilish/video/7050551461734042926"],
    "maxCommentsPerVideo": 100,
    "maxComments": 1000,
}

# Run the Actor and wait for it to finish
run = client.actor("grow_media/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 '{
  "startUrls": [
    "https://www.tiktok.com/@billieeilish/video/7050551461734042926"
  ],
  "maxCommentsPerVideo": 100,
  "maxComments": 1000
}' |
apify call grow_media/tiktok-comments-scraper --silent --output-dataset

```

## MCP server setup

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