# TikTok Comment Scraper - Comments & Replies (`s-r/tiktok-comment-scraper`) Actor

Read the comments on any TikTok video. Text, author, likes, reply counts and timestamps, with full reply threads on request.

- **URL**: https://apify.com/s-r/tiktok-comment-scraper.md
- **Developed by:** [SR](https://apify.com/s-r) (community)
- **Categories:** E-commerce
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## TikTok Comment Scraper

Read the comments on any TikTok video as data. Paste video links, get one row
per comment with the text, who wrote it, when, how many likes it drew and how
many replies it has.

Turn on **Include replies** and the threads come back too. Every reply carries
the id of the comment it answers, so a flat table reconstructs into threads
without guessing.

### What you get per comment

- `text`, `created_at`, `like_count`, `reply_count`
- `handle`, `nickname`, `user_id`, `user_url`, `avatar_url`, `user_signature`
- `liked_by_author`, whether the video's creator liked the comment
- `is_author`, whether the creator pinned it
- `language`, the language TikTok detected
- `is_reply` and `parent_comment_id` on replies
- `video_comment_total`, how many comments the video has in total

`liked_by_author` is more useful than it looks. A creator's like is the closest
thing TikTok has to an endorsement, and it is the fastest way to find the
comments that a brand or creator has actually engaged with.

`video_comment_total` next to the rows you received tells you what share of a
conversation you are holding, which matters on a video with tens of thousands
of comments.

### How many comments you can get

Comments arrive fifty at a time and paging follows TikTok's own cursor, so a
long thread walks cleanly. **Maximum comments per video** caps it; 200 is the
default and finishes in a few seconds per video.

Replies cost one extra request per thread, so a video with many replied-to
comments takes noticeably longer with the option on. Leave it off when you only
want the top-level conversation.

### Errors

A video that cannot be read becomes an entry in the `errors` record rather than
a missing set of rows:

| Code | Meaning |
|---|---|
| `bad_input` | Not a TikTok video link or id |
| `no_comments` | The video was read and has no comments |
| `refused` | TikTok declined to serve that page |
| `signer_unavailable` | The run could not prepare itself; rerun |

`no_comments` and `refused` are deliberately different. A video nobody has
commented on and a request TikTok declined look identical if you only count
rows, and only one of them is worth rerunning.

### Run settings

The default memory of 2 GB is what this needs; it is not padding. Lower it and
runs may fail to start.

### Related actors

For finding videos by keyword rather than reading one, use **TikTok Search
Scraper**. For an account's whole catalogue, use **TikTok Scraper - Profiles,
Videos & Hashtags**. For the video files, use **TikTok Video Downloader**.

# Actor input Schema

## `videos` (type: `array`):

Video links or ids, one per line. A full link, a link with tracking parameters or a bare video id all work.

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

Comments arrive fifty at a time.

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

Also fetch the reply thread under every comment that has one. One extra request per thread.

## `country` (type: `string`):

Two-letter country code to read from.

## `language` (type: `string`):

Two-letter language code.

## Actor input object example

```json
{
  "videos": [
    "https://www.tiktok.com/@tiktok/video/7106594312292453675"
  ],
  "maxCommentsPerVideo": 200,
  "includeReplies": false,
  "country": "us",
  "language": "en"
}
```

# Actor output Schema

## `comments` (type: `string`):

One row per comment.

## `summary` (type: `string`):

Videos read and comments returned.

## `errors` (type: `string`):

Videos that could not be read.

# 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 = {
    "videos": [
        "https://www.tiktok.com/@tiktok/video/7106594312292453675"
    ],
    "country": "us",
    "language": "en"
};

// Run the Actor and wait for it to finish
const run = await client.actor("s-r/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 = {
    "videos": ["https://www.tiktok.com/@tiktok/video/7106594312292453675"],
    "country": "us",
    "language": "en",
}

# Run the Actor and wait for it to finish
run = client.actor("s-r/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 '{
  "videos": [
    "https://www.tiktok.com/@tiktok/video/7106594312292453675"
  ],
  "country": "us",
  "language": "en"
}' |
apify call s-r/tiktok-comment-scraper --silent --output-dataset

```

## MCP server setup

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