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

Scrape TikTok video comments and replies with exact like counts, ISO timestamps, language detection, and 18 fields per comment.

- **URL**: https://apify.com/happy\_b/tiktok-comments-scraper.md
- **Developed by:** [Happy B](https://apify.com/happy_b) (community)
- **Categories:** Social media, Videos
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $0.25 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

### What is TikTok Comments Scraper?

TikTok Comments Scraper extracts comments and replies from TikTok videos with **exact numbers, ISO 8601 timestamps, and 18 fields per comment** — ready for spreadsheets, dashboards, and analysis pipelines.

Every number is an exact integer. Every date is ISO 8601. No "1.2K" guesses, no "2 months ago" approximations.

#### Data points extracted per comment

| Field | Description | Example |
|-------|-------------|---------|
| `commentId` | Comment ID | `7617943801550832402` |
| `content` | Comment text | `This is hilarious 😂` |
| `publishedAt` | ISO 8601 timestamp | `2026-03-16T19:52:57.000Z` |
| `likeCount` | Exact like count | `3998` |
| `replyCount` | Number of replies | `20` |
| `replyLevel` | 0 = comment, 1 = reply | `0` |
| `parentCommentId` | Parent comment (for replies) | `7617943801550832402` |
| `commentLanguage` | Detected language | `en` |
| `isPinned` | Pinned by creator | `true` |
| `isCreatorLiked` | Liked by creator | `true` |
| `authorUniqueId` | TikTok handle | `khaby.lame` |
| `authorNickname` | Display name | `Khabane lame` |
| `authorUid` | Numeric user ID | `6881060737370096641` |
| `authorAvatarUrl` | Profile picture URL | `https://p16-common-sign...` |
| `authorSecUid` | Secure user ID | `MS4wLjABAAAA...` |
| `videoId` | TikTok video ID | `7617913537561693470` |
| `videoUrl` | Full video URL | `https://www.tiktok.com/@/video/...` |
| `scrapeTimestamp` | When data was collected | `2026-04-03T03:35:09.177Z` |

**18 fields per comment. Every number exact. Every date ISO 8601.**

### Why use this scraper?

#### Replies that actually work

Other TikTok comment scrapers have known issues with reply fetching. Our scraper returns complete reply threads with `parentCommentId` linking each reply to its parent — so you can reconstruct the full conversation tree.

#### Fields you won't find elsewhere

- **`commentLanguage`** — filter comments by language without running your own detection
- **`isCreatorLiked`** — identify which comments the creator engaged with
- **`isPinned`** — find creator-highlighted comments instantly
- **`authorSecUid`** — cross-reference commenters with profile data from other scrapers

#### Exact data, not approximations

Every like count is an exact integer (`3998`, not `4K`). Every timestamp is ISO 8601 (`2026-03-16T19:52:57.000Z`, not `2 months ago`). Download to CSV and your data is ready for analysis — no parsing, no guessing.

### Use cases

- **Sentiment analysis** — extract comments with language detection to analyze audience reactions across regions and languages.
- **Influencer analytics** — identify which comments creators engage with via `isCreatorLiked` and `isPinned` fields.
- **Competitive research** — compare comment volumes, engagement rates, and audience sentiment across competing creators.
- **Community management** — monitor reply threads for brand mentions, complaints, or opportunities to engage.
- **ML training data** — structured JSON with 18 fields per comment, ready for classification, sentiment models, or recommendation systems.
- **Trend detection** — track comment volume and sentiment on trending videos to identify emerging topics.

### How much does it cost?

Each comment or reply counts as one item.

| Plan | Price per 1,000 items |
|------|----------------------|
| Free | $0.65 |
| Starter | $0.50 |
| Scale | $0.40 |
| Business | $0.25 |

| Scenario | Items | Cost (Free plan) |
|----------|-------|------|
| 1 video, 100 comments | 100 | $0.07 |
| 1 video, 500 comments + replies | ~1,500 | $0.98 |
| 10 videos, 200 comments each | 2,000 | $1.30 |
| 50 videos, 500 comments + replies | ~75,000 | $48.75 |

Apify also charges a small compute cost (CU) for the actor's runtime — typically under $0.01 for most runs.

### Input

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `videoUrls` | string[] | *required* | TikTok video URLs or video IDs to scrape comments from. |
| `maxCommentsPerVideo` | integer | 500 | Maximum number of top-level comments to fetch per video. |
| `includeReplies` | boolean | false | Fetch replies to comments. Each reply counts as a separate item. |
| `maxRepliesPerComment` | integer | 50 | Maximum replies per comment (only used when Include Replies is on). |

### Output example

Each item in the dataset is a single comment or reply:

```json
{
  "commentId": "7617943801550832402",
  "content": "[Sticker] here's the entire cars movie",
  "publishedAt": "2026-03-16T19:52:57.000Z",
  "likeCount": 3998,
  "replyCount": 20,
  "replyLevel": 0,
  "parentCommentId": "",
  "commentLanguage": "en",
  "isPinned": false,
  "isCreatorLiked": false,
  "authorUniqueId": "nadlaufer22",
  "authorNickname": "TheRealNadav9",
  "authorUid": "7421046488249271301",
  "authorAvatarUrl": "https://p16-common-sign.tiktokcdn-us.com/tos-alisg-avt-0068/...",
  "authorSecUid": "MS4wLjABAAAA0Kx0OPTL_JH4bjSlp1eIRP6IOiJAjtk9KzyMhuknWktSUB1f...",
  "videoId": "7617913537561693470",
  "videoUrl": "https://www.tiktok.com/@/video/7617913537561693470",
  "scrapeTimestamp": "2026-04-03T03:35:09.177Z"
}
````

Replies include `replyLevel: 1` and `parentCommentId` linking back to the parent:

```json
{
  "commentId": "7617975985636524816",
  "content": "i just watched the entire thing. its the whole movie damn",
  "publishedAt": "2026-03-16T23:00:04.000Z",
  "likeCount": 284,
  "replyCount": 0,
  "replyLevel": 1,
  "parentCommentId": "7617943801550832402",
  "commentLanguage": "en",
  "isPinned": false,
  "isCreatorLiked": false,
  "authorUniqueId": "shafi_zz",
  "authorNickname": "SHAFI",
  "authorUid": "6904063862041396225",
  "authorAvatarUrl": "https://p16-common-sign.tiktokcdn-us.com/tos-alisg-avt-0068/...",
  "authorSecUid": "MS4wLjABAAAA...",
  "videoId": "7617913537561693470",
  "videoUrl": "https://www.tiktok.com/@/video/7617913537561693470",
  "scrapeTimestamp": "2026-04-03T03:35:09.177Z"
}
```

Download your results as **JSON**, **CSV**, **Excel**, **XML**, or **HTML** from the dataset tab, or access them via the [Apify API](https://docs.apify.com/api/v2#/reference/datasets).

### Good to know

**Replies are fetched per comment.** When Include Replies is on, the scraper fetches reply threads for each comment that has replies. This makes runs slower but gives you complete conversation data. A video with 500 comments and heavy reply threads may take 2-3 minutes.

**Multiple videos in one run.** Pass an array of video URLs or IDs and get all comments in a single dataset. Each comment includes `videoId` so you can filter by video.

**Video IDs accepted.** You can pass full TikTok URLs (`https://www.tiktok.com/@user/video/123...`) or just the numeric video ID (`7617913537561693470`).

### Integrations

Connect this actor to your workflow with [Apify integrations](https://docs.apify.com/platform/integrations):

- **Make (Integromat)** — trigger workflows when new data is available
- **Zapier** — push comments to Google Sheets, Slack, or databases
- **Google Drive** — export directly to spreadsheets
- **Webhooks** — notify your API when the run completes
- **Apify API** — programmatic access for custom pipelines

### Legal and personal data

This actor extracts publicly available data from TikTok. You should ensure your use of the extracted data complies with TikTok's [Terms of Service](https://www.tiktok.com/legal/terms-of-service), applicable data protection laws (GDPR, CCPA), and your jurisdiction's regulations regarding web scraping and data processing.

Comments and user information are public content visible to anyone on TikTok.

### Support

Found a bug or have a feature request? Open an issue on the [Issues tab](https://apify.com/happy_b/tiktok-comments-scraper/issues/open) or contact us through Apify messaging.

# Actor input Schema

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

TikTok video URLs or video IDs to scrape comments from

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

Maximum number of top-level comments to fetch per video

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

Fetch replies to comments. Each reply counts as a separate item.

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

Maximum number of replies per comment (only used when Include Replies is on)

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.tiktok.com/@khaby.lame/video/7617913537561693470"
  ],
  "maxCommentsPerVideo": 500,
  "includeReplies": false,
  "maxRepliesPerComment": 50
}
```

# 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/7617913537561693470"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("happy_b/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/7617913537561693470"] }

# Run the Actor and wait for it to finish
run = client.actor("happy_b/tiktok-comments-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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/7617913537561693470"
  ]
}' |
apify call happy_b/tiktok-comments-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=happy_b/tiktok-comments-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "TikTok Comments Scraper",
        "description": "Scrape TikTok video comments and replies with exact like counts, ISO timestamps, language detection, and 18 fields per comment.",
        "version": "0.1",
        "x-build-id": "Olsh5Vu38o54qdbba"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/happy_b~tiktok-comments-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-happy_b-tiktok-comments-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/happy_b~tiktok-comments-scraper/runs": {
            "post": {
                "operationId": "runs-sync-happy_b-tiktok-comments-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/happy_b~tiktok-comments-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-happy_b-tiktok-comments-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "videoUrls"
                ],
                "properties": {
                    "videoUrls": {
                        "title": "Video URLs",
                        "type": "array",
                        "description": "TikTok video URLs or video IDs to scrape comments from",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxCommentsPerVideo": {
                        "title": "Max Comments Per Video",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Maximum number of top-level comments to fetch per video",
                        "default": 500
                    },
                    "includeReplies": {
                        "title": "Include Replies",
                        "type": "boolean",
                        "description": "Fetch replies to comments. Each reply counts as a separate item.",
                        "default": false
                    },
                    "maxRepliesPerComment": {
                        "title": "Max Replies Per Comment",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Maximum number of replies per comment (only used when Include Replies is on)",
                        "default": 50
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
