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

TikTok comments scraper for public videos: comment text, likes, reply count, language, time, pinned and creator-liked flags. No login. Monitor mode returns only new comments. No commenter names, handles, avatars or ids are collected.

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

## Pricing

from $0.80 / 1,000 result items

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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

TikTok Comments Scraper reads the comments under public TikTok videos and returns one row per comment with its text, like count, reply count, language, posting time and whether the creator pinned or liked it. You do not need a TikTok account, cookies or an API key, and nothing about the people who wrote the comments is collected.

**Try it:** the prefilled example returns 20 rows in about 10 seconds and costs about $0.02. Results cost $1.00 per 1,000.

### What you get

Real rows from the example dataset:

| text | likeCount | replyCount | language | createdAt | isPinned |
|---|---|---|---|---|---|
| "go my love" | `97` | `0` | `en` | `2026-10-30` | `false` |
| "wish i cud run like that again damaged knees" | `31` | `0` | `en` | `2026-10-30` | `false` |
| "Che potenza!" | `8` | `0` | `it` | `2026-10-30` | `false` |

Full row: `id`, `commentId`, `url`, `videoId`, `videoUrl`, `text`, `mentionCount`, `createdAt`, `likeCount`, `replyCount`, `language`, `isPinned`, `isAuthorLiked`, `query`, `scrapedAt`.

**No commenter data, ever.** TikTok sends a profile object with every comment (name, handle, avatar, user id). The actor drops that object entirely before a row is built, so there is no commenter name, handle, avatar or id anywhere in the output. Profiles tagged inside a comment are masked too: every `@name` in the text becomes `@user`. Only the comment itself and its counters are kept.

### Related actors

- [YouTube Comments Scraper](https://apify.com/datahamster/youtube-comments) returns the same text and counters for YouTube videos.
- [Reddit Scraper](https://apify.com/datahamster/reddit-scraper) reads posts and comment threads without author names.
- [Facebook Reels Scraper](https://apify.com/datahamster/facebook-reels-videos) gives view and reaction counts of Facebook reels.

### Use cases

- Read what people say under your own videos or a competitor's, as a spreadsheet.
- Feed comment text into sentiment analysis, topic clustering or a moderation queue.
- Get an alert with every new comment under a campaign video (monitor mode).

### Monitor mode

Save the input as a task, set **Mode** to `monitor` and put it on a schedule (for example every hour). Each run returns only comments whose id was not seen before. Like-count changes on old comments do not count as new. TikTok returns comments in its own ranking, not by date, so give `maxCommentsPerVideo` enough room for the comment section to be read to the end on busy videos.

### Input

| Field | Meaning | Default |
|---|---|---|
| `videoUrls` | TikTok video links (`https://www.tiktok.com/@handle/video/<id>`) or bare numeric video ids | two example videos |
| `maxCommentsPerVideo` | Stop reading one video after this many comments | `100` |
| `maxItems` | Stop the whole run after this many comment rows | `20` |
| `mode` | `scrape` or `monitor` (only new comments) | `scrape` |
| `monitorStateId`, `webhookUrl`, `telegramBotToken`, `telegramChatId` | Monitor state key and alert targets | empty |

### Pricing

| Event | Price |
|---|---|
| result | $0.001 per comment ($1.00 per 1,000) |
| monitor-check | $0.005 per monitor run |
| change | $0.001 per new comment in monitor mode |

Apify Store discounts: SILVER -10%, GOLD and higher -20% on every event.

You pay only for comment rows that are pushed. A removed video, or a video with comments turned off, produces no rows and no charge. Proxy traffic is billed by Apify on top when TikTok blocks the free tier and the actor moves to a datacenter or residential proxy.

**Found it useful?** A short review on the Store page helps other people find this actor and tells us what to improve. If something is wrong, open an issue on the actor page.

### How it works

1. Each link is opened once as a logged-out video page to check that the video exists and to get its address.
2. The comments come from the same comment list TikTok's web player loads, about 20 per request. The actor follows TikTok's cursor until your limit, the end of the list, or a page with no new comments.
3. If TikTok answers with a block or an empty reply, the request is retried and then repeated through a datacenter and then a residential proxy. When every video of a run is blocked on every proxy, the run stops with a "blocked" reason instead of returning an empty dataset.

### Limits

- **Top-level comments only.** Replies are counted in `replyCount` but their text is not read.
- **TikTok's order.** Comments come in the order TikTok ranks them, not newest first, and TikTok can leave out comments it filters.
- **Fewer rows than the comment count on the video.** TikTok's count includes replies and comments it hides, so the list it serves is shorter: a video showing 94 comments served 54 top-level comments in our test.
- **Links only.** The actor reads the videos you list. It does not search TikTok, list a profile's videos or follow short `vm.tiktok.com` links; open a short link once and paste the full address.
- **Mentions are masked.** Every `@name` in a comment is replaced with `@user`, and `mentionCount` says how many there were. Tagged profiles belong to other people, so their handles are not returned.

### FAQ

**Do I need a TikTok account?** No. Every request is made as a logged-out visitor.

**Why is there no commenter name or avatar?** By design. The actor collects comment content and counters only, never the identity of the people who wrote them.

**What happens when comments are off for a video?** No rows are pushed for that video and nothing is charged. The run continues with the other links.

### Changelog

- 0.1: first release with comment text, likes, reply count, language, pinned and creator-liked flags, and a monitor mode for new comments.

# Actor input Schema

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

Stop after this many comment rows (you are charged only for pushed rows)

## `mode` (type: `string`):

scrape = full results; monitor = only new/changed items since the previous run of this task

## `monitorStateId` (type: `string`):

Optional state id when not running as a saved task (monitor mode)

## `webhookUrl` (type: `string`):

POST a change summary here in monitor mode

## `telegramBotToken` (type: `string`):

Optional: bot token for monitor-mode change summaries

## `telegramChatId` (type: `string`):

Optional: chat id that receives monitor-mode summaries

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

TikTok video links such as https://www.tiktok.com/@handle/video/7702417995775102241, or bare numeric video ids, one per line.

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

Stop reading one video after this many comments, e.g. 100.

## Actor input object example

```json
{
  "maxItems": 20,
  "mode": "scrape",
  "videoUrls": [
    "https://www.tiktok.com/@marsha_du_/video/7702417995775102241",
    "https://www.tiktok.com/@waitguysidk67/video/7700972795269827854"
  ],
  "maxCommentsPerVideo": 20
}
```

# Actor output Schema

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

All pushed rows (dataset, JSON)

## `resultsTable` (type: `string`):

Dataset in the Console viewer

## `runSummary` (type: `string`):

RUN_SUMMARY record

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

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

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

```

## MCP server setup

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