# TikTok Comments Scraper (`coregent/tiktok-comment-scraper`) Actor

Scrape comments and replies from public TikTok videos: text, author details, likes, reply counts, mentions, hashtags and timestamps. For audience research, moderation and trend tracking. No login or cookies. $1 per 1,000 comments.

- **URL**: https://apify.com/coregent/tiktok-comment-scraper.md
- **Developed by:** [Delowar Munna](https://apify.com/coregent) (community)
- **Categories:** Social media, Videos, Developer tools
- **Features:** Limited permissions
- **Stats:** 135 total users, 20 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 result scrapeds

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 Comment Scraper — Comments, Replies & Analytics

> **Not just comments — comment intelligence.**

Most TikTok comment scrapers hand you raw API fields to clean up yourself. This one gives you **comments, replies, author profiles, video context, and built-in text analytics** (language, emoji, hashtags, mentions) in **clean, flat, spreadsheet-ready rows** — with separate **Unified, Overview, Authors, and Replies** views. **~41 structured fields per record.** Export in JSON, CSV, or Excel.

![TikTok Comment Scraper](https://raw.githubusercontent.com/coregentdevspace/tiktok-comment-scraper-assets/main/thumbnail-tiktok-comment-scraper.jpg "TikTok Comment Scraper — extract comments, replies, and author metadata at scale")

***

### Key Features

- **~41 Structured Fields** per record — comments, replies, authors, analytics
- **Reply Threads** — full reply chains linked to parent comments via `parentCommentId`
- **Replies After Parent** — each comment's replies appear right after it, numbered via `threadPosition` (`comment`, `reply #1`, `reply #2`, …)
- **Author Metadata** — username, nickname, verified status, private account flag, avatar (always included)
- **Comment Analytics** — language detection, word/emoji counts, hashtag/mention extraction
- **Video Context** — video caption, views, likes, shares, duration, music info on every record (always included)
- **Sorting** — top comments or newest first
- **Filters** — minimum likes, date range, exclude pinned, scrape-all
- **Profile Input** — scrape comments across a creator's recent videos from just their @handle
- **Unified Fields** — shared `id` / `parentId` / `text` / `likes` / `createdAt` / `author*` columns on **both** comments and replies, so a single table has no empty cells
- **4 Dataset Views** — Unified, Overview, Authors, Replies on Apify
- **Bare IDs, URLs, or Profiles** — accepts full video URLs, bare numeric video IDs, or creator handles
- **Error Rows** — failed/blocked videos emit a visible error row instead of vanishing silently
- **No Proxy Needed** — data is fetched through TikHub's hosted API (signing + routing handled server-side)
- **Pay-Per-Event** — only pay for results you get

> **Best for**: Sentiment analysis, brand monitoring, content research, AI training data, moderation analysis

***

### At a Glance

| Feature | Details |
|---------|---------|
| **Output Fields** | ~41 structured fields per record |
| **Dataset Views** | 4 tabs (Unified, Overview, Authors, Replies) |
| **Input** | TikTok video URLs, bare video IDs, or creator profiles |
| **Max Comments** | Up to 10,000 per video |
| **Reply Threads** | Enabled by default, linked via parentCommentId / replyId |
| **Data source** | TikHub hosted API (no proxy setup required) |

***

### How It Works

1. **Provide inputs** — one or more TikTok video URLs, bare numeric video IDs, or creator profiles (`@handle`)
2. **Fetch browserlessly via TikHub** — comments, reply threads, and video metadata are pulled through TikHub's hosted API with cursor-based pagination (no browser, no proxy). Creator profiles are expanded to their recent videos first.
3. **Normalize** — each comment and reply becomes a flat row with unified + type-specific fields, plus built-in text analytics
4. **Filter & cap** — apply `minLikes`, date range, and `excludePinned`; stop at `maxComments` per video / `maxItems` overall
5. **Export** — push to the dataset (4 views) — each comment followed by its replies

> If TikHub can't serve a particular video, the actor automatically falls back to a headful browser path for that video, so a single hard-to-reach video doesn't fail the run.

***

### Output

#### Comment Record

A single dataset row for a comment \u2014 every field an actual record contains (unified + comment + analytics + author + video):

```json
{
  "recordType": "comment",
  "id": "7482114472766325535",
  "parentId": null,
  "threadPosition": "comment",
  "text": "\u201cShe DIED\u201d \ud83e\udd19\ud83c\udffc\ud83e\udd19\ud83c\udffc\ud83e\udd19\ud83c\udffc\ud83d\ude02\ud83d\ude2d",
  "likes": 1507,
  "createdAt": "2025-03-15T19:05:59.000Z",
  "commentId": "7482114472766325535",
  "videoId": "7481695035033980190",
  "videoUrl": "https://www.tiktok.com/@aaron.vankampen/video/7481695035033980190",
  "inputUrl": "https://www.tiktok.com/@aaron.vankampen/video/7481695035033980190",
  "commentText": "\u201cShe DIED\u201d \ud83e\udd19\ud83c\udffc\ud83e\udd19\ud83c\udffc\ud83e\udd19\ud83c\udffc\ud83d\ude02\ud83d\ude2d",
  "createTime": "2025-03-15T19:05:59.000Z",
  "likeCount": 1507,
  "replyCount": 4,
  "isPinned": false,
  "commentPermalink": "https://www.tiktok.com/@aaron.vankampen/video/7481695035033980190?comment=7482114472766325535",
  "scrapedAt": "2026-03-14T13:29:33.073Z",
  "commentLanguage": "en",
  "wordCount": 3,
  "charCount": 27,
  "emojiCount": 8,
  "hashtags": [],
  "mentions": [],
  "authorId": "2904724",
  "authorUsername": "nellyyybaby",
  "authorNickname": "baby J\ud83d\udc8b",
  "authorVerified": false,
  "authorPrivateAccount": false,
  "authorProfileUrl": "https://www.tiktok.com/@nellyyybaby",
  "authorAvatar": "https://p16-common-sign.tiktokcdn-us.com/...",
  "videoDescription": "when the cat picked the crib \ud83d\ude02\ud83d\udc31",
  "videoCreateTime": "2025-03-14T21:40:12.000Z",
  "videoLikeCount": 2100000,
  "videoCommentCount": 8452,
  "videoShareCount": 15300,
  "videoViewCount": 18500000,
  "videoDuration": 32,
  "videoRegion": "US",
  "musicTitle": "original sound",
  "musicAuthor": "aaron.vankampen"
}
```

#### Reply Record (appears right after its parent comment)

Replies carry the same unified, analytics, and always-on `video*` fields as comments (omitted below for brevity), plus reply-specific fields:

```json
{
  "recordType": "reply",
  "id": "7482124949542011655",
  "parentId": "7482114472766325535",
  "threadPosition": "reply #1",
  "text": "\"So now aiiii got da crib!!\" \ud83d\ude03",
  "likes": 32,
  "createdAt": "2025-03-15T19:46:40.000Z",
  "parentCommentId": "7482114472766325535",
  "replyId": "7482124949542011655",
  "videoId": "7481695035033980190",
  "videoUrl": "https://www.tiktok.com/@aaron.vankampen/video/7481695035033980190",
  "inputUrl": "https://www.tiktok.com/@aaron.vankampen/video/7481695035033980190",
  "replyText": "\"So now aiiii got da crib!!\" \ud83d\ude03",
  "replyLikeCount": 32,
  "replyCreateTime": "2025-03-15T19:46:40.000Z",
  "replyAuthorId": "6812290091522016262",
  "replyAuthorUsername": "tony6ixx",
  "replyAuthorVerified": false,
  "replyAuthorNickname": "Tony \ud83c\udde6\ud83c\uddf1",
  "replyAuthorAvatar": "https://p19-common-sign.tiktokcdn-us.com/...",
  "authorProfileUrl": "https://www.tiktok.com/@tony6ixx",
  "commentLanguage": "en",
  "wordCount": 7,
  "charCount": 31,
  "emojiCount": 1,
  "hashtags": [],
  "mentions": [],
  "scrapedAt": "2026-03-14T13:29:33.329Z"
}
```

![Output — All Fields with Replies (Table View)](https://raw.githubusercontent.com/coregentdevspace/tiktok-comment-scraper-assets/main/tiktok-comment-scraper-output-all-fields-no-replies-table-view.png "Output table view showing all comment fields")

***

### Output Schema

#### Unified Fields (8) — present on every comment **and** reply row

Comments and replies use different field names (`commentId`/`replyId`, `commentText`/`replyText`, …), so in a single flat table the "other" type's columns show as blank. These **unified fields** solve that — they're populated on **both** row types (in addition to the type-specific fields), so you can build a clean, empty-free table from just these columns. The **Unified** dataset view uses exactly these.

| Field | Type | Description |
|-------|------|-------------|
| recordType | String | `comment`, `reply`, or `error` |
| id | String | The row's own ID — `commentId` for comments, `replyId` for replies |
| parentId | String | Parent comment's ID for replies; `null` for top-level comments |
| threadPosition | String | `comment` for a top-level comment; `reply #1`, `reply #2`, … for its replies in order |
| text | String | Comment or reply text |
| likes | Integer | Like count (comment or reply) |
| createdAt | String | ISO 8601 creation timestamp |
| author\* | — | Shared `authorId`, `authorUsername`, `authorNickname`, `authorVerified`, `authorProfileUrl` on both types |

Rows are pushed in reading order — each comment, then its replies (`reply #1`, `reply #2`, …), then the next comment — so `threadPosition` lets you see the thread structure at a glance.

> **To join replies to comments:** `reply.parentId` (= `reply.parentCommentId`) equals the parent's `id` (= `commentId`).

#### Core Comment (12 fields)

| Field | Type | Description |
|-------|------|-------------|
| recordType | String | Row type: `comment`, `reply`, or `error` |
| commentId | String | Unique comment ID |
| videoId | String | Video identifier |
| videoUrl | String | Canonical TikTok video URL |
| inputUrl | String | The original URL or ID you supplied for this row |
| commentText | String | Full comment text |
| createTime | String | ISO 8601 timestamp |
| likeCount | Integer | Number of likes |
| replyCount | Integer | Number of replies |
| isPinned | Boolean | Pinned by creator |
| commentPermalink | String | Direct link to comment |
| scrapedAt | String | Scraping timestamp |

#### Comment Analytics (6 fields)

| Field | Type | Description |
|-------|------|-------------|
| commentLanguage | String | Detected language code (e.g. `en`, `zh`, `ja`) |
| wordCount | Integer | Word count |
| charCount | Integer | Character count |
| emojiCount | Integer | Number of emojis |
| hashtags | Array | Extracted #hashtags |
| mentions | Array | Extracted @mentions |

#### Author Metadata (7 fields)

Always included on every comment/reply record.

| Field | Type | Description |
|-------|------|-------------|
| authorId | String | Author's TikTok user ID |
| authorUsername | String | Author's @username |
| authorNickname | String | Display name |
| authorVerified | Boolean | Verified badge |
| authorPrivateAccount | Boolean | Private account |
| authorProfileUrl | String | Link to the author's TikTok profile |
| authorAvatar | String | Profile image URL |

#### Reply Fields (10 fields)

Included when **Include Replies** is enabled (default: on). Each reply is a separate dataset row linked to its parent via `parentCommentId`.

| Field | Type | Description |
|-------|------|-------------|
| parentCommentId | String | Parent comment's ID |
| replyId | String | Reply's unique ID |
| replyText | String | Reply text |
| replyLikeCount | Integer | Reply likes |
| replyCreateTime | String | ISO 8601 timestamp |
| replyAuthorId | String | Reply author's user ID |
| replyAuthorUsername | String | Reply author's username |
| replyAuthorVerified | Boolean | Reply author verified |
| replyAuthorNickname | String | Reply author's display name |
| replyAuthorAvatar | String | Reply author's avatar URL |

Reply records also include the unified fields (`recordType: "reply"`, `id`, `parentId`, `text`, `likes`, `createdAt`, plus `author*` mirrors), `inputUrl`, `authorProfileUrl` (reply author's profile), the analytics fields (commentLanguage, wordCount, charCount, emojiCount, hashtags, mentions) computed on the reply text, `videoId`, `videoUrl`, `scrapedAt`, and the same always-on **video metadata** (10 fields) as comments.

#### Video Metadata (10 fields)

Always included on every comment/reply record. Fetched browserlessly via TikHub — same fast path as comments, so it adds no browser launch and negligible time.

| Field | Type | Description |
|-------|------|-------------|
| videoDescription | String | Video caption |
| videoCreateTime | String | Publish timestamp |
| videoLikeCount | Integer | Video likes |
| videoCommentCount | Integer | Video comment count |
| videoShareCount | Integer | Video shares |
| videoViewCount | Integer | Video views |
| videoDuration | Integer | Duration in seconds |
| videoRegion | String | Region code |
| musicTitle | String | Background music title |
| musicAuthor | String | Music creator |

#### Error Rows

When a video can't be scraped (comments disabled, private/deleted, soft-blocked IP, or an invalid input), the actor emits a **visible error row** instead of silently returning nothing — so failures are easy to spot and retry. Error rows are **not charged**.

| Field | Type | Description |
|-------|------|-------------|
| recordType | String | Always `error` |
| error | String | Human-readable failure reason |
| errorCode | String | `INVALID_URL`, `NO_COMMENTS`, `EXTRACTION_FAILED`, `REQUEST_FAILED`, `PROFILE_NO_VIDEOS`, `BROWSER_FALLBACK_SKIPPED`, `RUN_BUDGET_REACHED`, or `TIKHUB_402` / `TIKHUB_401` |
| videoUrl | String | The video URL that failed |
| inputUrl | String | The original URL or ID you supplied |
| scrapedAt | String | Timestamp of the failure |

***

### Input Parameters

Provide at least one of **videoUrls** or **profileUrls**.

| Parameter | Type | Default | Required | Description |
|-----------|------|---------|----------|-------------|
| **videoUrls** | Array | — | \* | TikTok video URLs **or bare video IDs** to scrape |
| **profileUrls** | Array | — | \* | Creator profiles (`@handle`, profile URL, or bare handle) — scrapes their recent videos |
| **maxVideosPerProfile** | Integer | `10` | No | Recent videos to scrape per profile (1–500) |
| **maxComments** | Integer | `100` | No | Max comments per video (1–10,000) |
| **maxItems** | Integer | — | No | Global cap on total results (comments + replies) across all videos. Empty = no cap |
| **scrapeAllComments** | Boolean | `false` | No | Ignore `maxComments` and fetch every comment (global `maxItems` still applies) |
| **minLikes** | Integer | — | No | Keep only comments/replies with at least this many likes |
| **commentDateFrom** | String | — | No | Keep only comments/replies created on/after this date (ISO, e.g. `2025-01-01`) |
| **commentDateTo** | String | — | No | Keep only comments/replies created on/before this date |
| **excludePinned** | Boolean | `false` | No | Skip creator-pinned comments (and their replies) |
| **includeReplies** | Boolean | `true` | No | Include reply threads |
| **maxRepliesPerComment** | Integer | `50` | No | Max replies per comment (1–500) |
| **sort** | String | `"top"` | No | Sort order: `top` or `new` |

<sub>\* Provide at least one of `videoUrls` or `profileUrls`.</sub>

<sub>Author metadata (7 fields) and video metadata (10 fields) are always included on every record — no toggle needed.</sub>

***

### Quick Start

#### Example 1: Single video with replies

```json
{
  "videoUrls": [
    "https://www.tiktok.com/@aaron.vankampen/video/7481695035033980190"
  ],
  "maxComments": 100,
  "includeReplies": true,
  "maxRepliesPerComment": 50,
  "sort": "top"
}
```

#### Example 2: Creator profiles + filters

Scrape recent videos from two creators, keep only comments with ≥10 likes from 2025.

```json
{
  "profileUrls": ["@aaron.vankampen", "https://www.tiktok.com/@tiktok"],
  "maxVideosPerProfile": 5,
  "minLikes": 10,
  "commentDateFrom": "2025-01-01"
}
```

#### Example 3: Bare video IDs with a global cap, no pinned comments

```json
{
  "videoUrls": [
    "7481695035033980190",
    "7546661132002413854"
  ],
  "maxItems": 500,
  "excludePinned": true,
  "includeReplies": true,
  "sort": "new"
}
```

#### Example 4: Multiple videos, comments only

```json
{
  "videoUrls": [
    "https://www.tiktok.com/@aaron.vankampen/video/7481695035033980190",
    "https://www.tiktok.com/@aaron.vankampen/video/7546661132002413854"
  ],
  "maxComments": 100,
  "includeReplies": false,
  "sort": "top"
}
```

#### Example 5: Every comment on a video, newest first

```json
{
  "videoUrls": [
    "https://www.tiktok.com/@creator/video/7234567890123456789"
  ],
  "scrapeAllComments": true,
  "includeReplies": true,
  "sort": "new"
}
```

***

### Dataset Views

The output is organized into **4 focused tabs** on the Apify platform:

#### Unified

Comments and replies in one table with **no empty columns** — uses the shared unified fields.

```json
{
  "recordType": "reply",
  "id": "7482124949542011655",
  "parentId": "7481790853061559070",
  "threadPosition": "reply #1",
  "text": "So now aiiii got da crib!!",
  "likes": 32,
  "createdAt": "2025-03-15T19:46:40.000Z",
  "authorUsername": "tony6ixx",
  "authorNickname": "Tony",
  "authorProfileUrl": "https://www.tiktok.com/@tony6ixx"
}
```

#### Overview

Shows comments and replies together with key fields.

```json
{
  "recordType": "comment",
  "commentId": "7481802613793686318",
  "videoId": "7481695035033980190",
  "commentText": "YOU FOUND CODY!!!",
  "authorUsername": "duncanstanko",
  "likeCount": 489,
  "replyCount": 1,
  "isPinned": false,
  "createTime": "2025-03-14T22:55:34.000Z",
  "scrapedAt": "2026-03-14T13:29:31.670Z"
}
```

#### Authors

Focused view on commenter profiles.

```json
{
  "commentId": "7481802613793686318",
  "authorId": "7158470338833777710",
  "authorUsername": "duncanstanko",
  "authorNickname": "Duncan Stanko",
  "authorVerified": false,
  "authorPrivateAccount": false,
  "authorProfileUrl": "https://www.tiktok.com/@duncanstanko",
  "authorAvatar": "https://p16-common-sign.tiktokcdn-us.com/..."
}
```

#### Replies

Focused view on reply threads with parent-child linking.

```json
{
  "parentCommentId": "7482422764545753902",
  "replyId": "7482493179494253342",
  "replyText": "He is a comedian. Calm down lol",
  "replyAuthorUsername": "wizrd.618",
  "replyLikeCount": 107,
  "replyCreateTime": "2025-03-16T19:35:28.000Z"
}
```

***

### Use Cases

#### Sentiment Analysis

Export comments for sentiment scoring and reaction analysis. Use `commentLanguage`, `wordCount`, and `emojiCount` for NLP preprocessing.

#### Brand Monitoring

Track public feedback on brand campaigns. Filter by video URL and analyze comment engagement patterns.

#### Content Research

Study audience reactions to viral content. Compare top comments vs. newest to understand engagement dynamics.

#### AI Training Data

Collect structured comment datasets for training text classification, sentiment, or moderation models.

#### Moderation Analysis

Identify patterns in toxic comments, spam, or abuse. Use author metadata to detect bot-like accounts.

***

### Performance

| Metric | Value |
|--------|-------|
| Concurrency | 1 request at a time |
| Request timeout | 120 seconds |
| Navigation timeout | 60 seconds |
| Retries | Up to 4 per request (exponential backoff) |
| Session pooling | 5 sessions, 20 uses each |

***

### Data Export

Supported formats via Apify platform:

- JSON
- CSV
- Excel
- HTML

***

### Tips

- **No proxy setup needed** — data is fetched through TikHub's hosted API.
- **Replies appear after their parent** in the dataset output — look for `parentCommentId` to match them.
- **Each reply is its own row** with a flat structure, making it easy to filter comments vs. replies.
- **`commentPermalink`** links directly to the comment on TikTok.
- **Language detection** uses Unicode script analysis — returns `null` for ambiguous text.

***

### Pricing

This actor uses Apify's **Pay-Per-Event** model.

| Event | Trigger | What it covers |
|-------|---------|----------------|
| `result-scraped` | Each comment or reply returned | Charged once per record pushed to the dataset |

**There is no start fee and no subscription** — you pay only for results. A run that returns nothing costs nothing.

**What is never charged:** error rows for failed, private, deleted or comment-disabled videos; comments dropped by your `minLikes`, date-range or `excludePinned` filters; and the run summary.

**Live prices are on this actor's Pricing tab in the Apify Console** — that is the only authoritative source. *This README deliberately quotes no figures*: prices change, and a copy here would go stale and mislead. Platform compute is billed separately to your Apify account. **No proxy is required** — data is fetched through TikHub's hosted API.

#### Free plan limitations

**"Include Replies" requires a paid Apify plan.** On the Free plan the option is skipped, and you
are **not charged** for reply rows.

| | Free plan | Any paid plan |
|---|---|---|
| Top-level comments | ✅ Full, unrestricted — no row cap | ✅ Full |
| Author info, video context, like counts | ✅ Included | ✅ Included |
| Filters, sorting, pinned-comment exclusion | ✅ Included | ✅ Included |
| **Reply threads** (`includeReplies`) | ❌ Skipped, and not charged | ✅ Included |

Why: replies cost one upstream API call **per parent comment that has any**, so a comment with a
single reply costs a full call for one row — while comment fetching averages ~14 rows per call.
Restricting that one option keeps the Actor sustainable without capping how many results you get.
If a run is affected you'll see it in the log and in the run's status message, never as a failure.

***

### How data is fetched

This actor uses [TikHub](https://tikhub.io)'s hosted API for fast, reliable, browserless access — **no proxy configuration required**. TikHub handles request signing and routing server-side, which is what makes runs fast and consistent. It powers:

- **Comment & reply extraction** — the primary, browserless data path
- **Video metadata** — the 10 video-context fields on every record, fetched browserlessly (no page load)
- **Profile input** (`profileUrls`) — resolving a creator's recent videos

The TikHub key is configured once by the actor operator (as the Apify secret `tikhub_api_key`, wired in `actor.json` as `@tikhub_api_key`) — **run users never need to provide anything**. TikHub usage is billed to the operator's TikHub account, separate from Apify's `result-scraped` charge.

***

### Compliance

- Collects only **publicly available** TikTok comment data
- Does **not** bypass CAPTCHAs or access gated content
- Does **not** collect private account data
- Intended for legitimate research, analytics, and business intelligence
- Users are responsible for compliance with applicable laws in their jurisdiction

***

### Support

- **Issues**: Report via GitHub or Apify support
- **Feature requests**: Open an issue with your use case

***

**Built by [Coregent Digital Studio](https://coregentdigital.com) — Production-ready TikTok comment extraction**

# Actor input Schema

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

List of TikTok video URLs — or bare numeric video IDs — to scrape comments from. Example URL: https://www.tiktok.com/@creator/video/7234567890123456789 · Example ID: 7234567890123456789

## `profileUrls` (type: `array`):

TikTok creator profiles to scrape comments from their recent videos. Accepts @handle, a full profile URL (https://www.tiktok.com/@handle), or a bare handle.

## `maxVideosPerProfile` (type: `integer`):

How many of each creator's most recent videos to scrape comments from (only applies to Creator Profiles).

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

Maximum number of comments to extract per video.

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

Include reply threads for each comment. Each reply becomes a separate dataset row with parentCommentId set. Paid Apify plans only — on the Free plan this option is ignored, the run returns top-level comments only, and you are not charged for replies.

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

Maximum number of replies to fetch per comment (only applies when Include Replies is enabled).

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

Optional global cap on the total number of results (comments + replies) across ALL videos in this run. Leave empty for no global cap. Useful for controlling cost on large runs.

## `scrapeAllComments` (type: `boolean`):

Ignore the per-video 'Max Comments' limit and fetch every available comment. The global 'Max Total Results' cap (if set) still applies. Large videos can be slow.

## `minLikes` (type: `integer`):

Only keep comments and replies with at least this many likes. Filtered-out rows are not charged.

## `commentDateFrom` (type: `string`):

Only keep comments/replies created on or after this date (ISO date, e.g. 2025-01-01). Rows without a timestamp are dropped when a date filter is set.

## `commentDateTo` (type: `string`):

Only keep comments/replies created on or before this date (ISO date, e.g. 2025-12-31).

## `excludePinned` (type: `boolean`):

Skip creator-pinned comments (and their replies). Pinned comments are not charged when excluded.

## `sort` (type: `string`):

Sort comments by relevance (top) or chronologically (new).

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.tiktok.com/@aaron.vankampen/video/7481695035033980190"
  ],
  "maxVideosPerProfile": 10,
  "maxComments": 5,
  "includeReplies": true,
  "maxRepliesPerComment": 5,
  "scrapeAllComments": false,
  "excludePinned": false,
  "sort": "top"
}
```

# Actor output Schema

## `unified` (type: `string`):

No description

## `overview` (type: `string`):

No description

## `authors` (type: `string`):

No description

## `replies` (type: `string`):

No description

# 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/@aaron.vankampen/video/7481695035033980190"
    ],
    "maxComments": 5,
    "maxRepliesPerComment": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("coregent/tiktok-comment-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/@aaron.vankampen/video/7481695035033980190"],
    "maxComments": 5,
    "maxRepliesPerComment": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("coregent/tiktok-comment-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/@aaron.vankampen/video/7481695035033980190"
  ],
  "maxComments": 5,
  "maxRepliesPerComment": 5
}' |
apify call coregent/tiktok-comment-scraper --silent --output-dataset

```

## MCP server setup

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