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

Scrape TikTok comments and replies: text, author, likes, reply count and date. $0.50 per 1,000 comments, pay-per-comment, failed items never charged. No login, no API key. Callable from any MCP client (Claude, Cursor, ChatGPT).

- **URL**: https://apify.com/api_harbor/tiktok-comments-scraper.md
- **Developed by:** [Api Harbor](https://apify.com/api_harbor) (community)
- **Categories:** Social media, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 comments

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 API

Scrape TikTok comments and replies: text, author, likes, reply count and date. Built for LLM and AI agent pipelines, and callable from any MCP client (Claude, Cursor, ChatGPT). No TikTok login, no API key, no cookies. Export to JSON, CSV or Excel, or call it as a TikTok API.

**Price promise:** $0.50 per 1,000 comments, pay-per-comment. Failed items and `error` rows are never charged. No proxy fees, no TikTok account needed.

### What does TikTok Comments Scraper do?

Give it a list of TikTok comments (videos). It returns one clean JSON item per comment, with the fields below. An input that cannot be fetched (private, removed or invalid) comes back as an `error` row, free of charge.

### What you get back

| Field | Type | Description |
|---|---|---|
| `id` | string | Comment ID |
| `videoId` | string | Video ID |
| `text` | string | Comment text |
| `createdAt` | string | Date (ISO 8601) |
| `likes` | integer | Like count |
| `replies` | integer | Reply count |
| `author` | string | Author username |
| `authorName` | string | Author display name |
| `authorId` | string | Author user ID |
| `avatar` | string | Author avatar URL |
| `pinnedByAuthor` | boolean | Pinned by the video author |
| `likedByAuthor` | boolean | Liked by the video author |
| `parentId` | string | Parent comment ID (replies only) |
| `language` | string | Detected language |
| `input` | string | Input that failed (error rows only) |
| `error` | string | Error message (error rows only, never charged) |

### Why this TikTok API

- **No login, no API key.** Nothing to configure, no TikTok developer account, no cookies to refresh.
- **Pay only for what you get.** $0.50 per 1,000 comments. Error rows are never charged.
- **Clean, typed data.** Numbers are numbers, dates are ISO 8601.
- **Agent-ready.** Structured errors, usable as an MCP tool.

### Use cases for LLMs, AI agents and marketing

- **LLM sentiment analysis:** let Claude or ChatGPT classify reactions to a product, a brand or a launch.
- **AI agents:** ask an MCP client to read the comments of a video and list questions and complaints.
- **Market research:** collect pain points and feature requests from real users.
- **Influencer vetting:** check whether the comments on a creator's videos are genuine.
- **Datasets:** gather real conversations for classification, embeddings or fine-tuning.

### How much does it cost?

| What | Price |
|---|---|
| Run start | $0.00005 per run |
| Comment | $0.50 per 1,000 comments |
| Failed item (`error` row) | $0 |
| Proxies, API key | $0, included |

The Apify free plan includes $5 of monthly credit, enough for about 10,000 comments. Set a maximum cost per run in Apify Console and the run stops cleanly at that budget.

### How to scrape TikTok comments

1. Click **Try for free**.
2. Paste the video URLs or IDs.
3. Click **Start**, then download your data as JSON, CSV, Excel or HTML.

### Input

```json
{
  "videos": [
    "https://www.tiktok.com/@scout2015/video/6718335390845095173"
  ],
  "maxComments": 100,
  "maxReplies": 5
}
```

### Output example

Real items from a test run (signed image URLs shortened):

```json
[
  {
    "id": "6718336105873702917",
    "videoId": "6718335390845095173",
    "text": "Well it’s pretty easy...and obvious 😂 hlysa",
    "createdAt": "2019-07-27T13:35:22Z",
    "likes": 340,
    "replies": 49,
    "author": "pretzelsticks0",
    "authorName": "Quit",
    "authorId": "6627564337508761605",
    "avatar": "https://p16-common-sign.tiktokcdn-eu.com/tos-maliva-avt-0068/7328085019259748357~tplv-tiktokx-cropcenter:100:100.jpg?…",
    "pinnedByAuthor": false,
    "likedByAuthor": true
  },
  {
    "id": "6718345696363233285",
    "videoId": "6718335390845095173",
    "parentId": "6718336105873702917",
    "text": "Ashly by any chance?😂",
    "createdAt": "2019-07-27T14:12:34Z",
    "likes": 1,
    "replies": 0,
    "author": "holllywhat",
    "authorName": "holly",
    "authorId": "6631945109157986309",
    "avatar": "https://p16-common-sign.tiktokcdn-eu.com/tos-no1a-avt-0068c001-no/40064b56625a35d0fc3300a738197961~tplv-tiktokx-cropcenter:100:100.jpg?…",
    "pinnedByAuthor": false,
    "likedByAuthor": false
  }
]
```

### Use it from AI agents (MCP)

This Actor is available as a tool through the Apify MCP server, so Claude, Cursor, ChatGPT or any MCP client can call it directly.

- MCP server URL: `https://mcp.apify.com/?actors=api_harbor/tiktok-comments-scraper`
- Token: Apify Console > **Settings** > **Integrations** (your Apify API token)

**Claude Desktop** (`claude_desktop_config.json`):

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com/?actors=api_harbor/tiktok-comments-scraper",
      "headers": { "Authorization": "Bearer <APIFY_TOKEN>" }
    }
  }
}
```

**Claude Code:**

```bash
claude mcp add --transport http apify "https://mcp.apify.com/?actors=api_harbor/tiktok-comments-scraper" --header "Authorization: Bearer <APIFY_TOKEN>"
```

**Cursor** (`.cursor/mcp.json`) or **VS Code** (`.vscode/mcp.json`, use `"servers"` instead of `"mcpServers"`): same JSON as Claude Desktop.

Example prompts:

- "Get the top 300 comments of this TikTok video and summarize the sentiment."
- "List every question viewers ask in the comments of my last 5 videos."
- "Compare the comments of these two product reviews and extract the main complaints."

### Use it from Python (TikTok API alternative)

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

```python
from apify_client import ApifyClient

client = ApifyClient("<APIFY_TOKEN>")
run = client.actor("api_harbor/tiktok-comments-scraper").call(run_input={"videos": ["https://www.tiktok.com/@scout2015/video/6718335390845095173"], "maxComments": 100, "maxReplies": 5})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    if item.get("error"):
        print("failed:", item.get("input"), item["error"])  # not charged
        continue
    print(item)
```

### Fast cache and structured errors

- **Cache:** identical inputs are served from cache, so repeated requests come back in seconds.
- **Structured errors:** an item that cannot be fetched is returned as a row with an `error` field (and the failed `input`). These rows are **never charged**, and your agent or pipeline can branch on them without parsing logs.

### FAQ

**Do I need a TikTok account or an API key?**
No. No login, no cookies, no API key. Nothing to configure.

**Does `maxComments` count replies?**
No. It caps top-level comments per video. Replies are capped separately by `maxReplies` (per comment, 0 by default).

**Is it legal to scrape TikTok?**
This Actor only reads public data. It contains personal data such as usernames, so you are responsible for complying with GDPR, your local laws and TikTok's terms for your use case.

**Is there a TikTok comment API?**
Yes: this Actor is one. Call it through the Apify REST API (`POST https://api.apify.com/v2/acts/api_harbor~tiktok-comments-scraper/run-sync-get-dataset-items`), the Python or JavaScript client, or MCP.

**Can I use it from Python?**
Yes. See the Python example above with `apify-client`.

**Can I schedule runs?**
Yes. Create a schedule in Apify Console (for example daily). Each run writes a new dataset you can export or send to a webhook.

**Does it work with Make, Zapier or n8n?**
Yes. Use the official Apify integrations for Make, Zapier and n8n, or call the REST API from any HTTP node.

**Can AI agents use it through MCP?**
Yes. Add `https://mcp.apify.com/?actors=api_harbor/tiktok-comments-scraper` to Claude Desktop, Claude Code, Cursor, VS Code or any MCP client with your Apify token. See the MCP section above.

**Something is missing or broken?**
Open an issue in the **Issues** tab.

### Related Actors

- [TikTok Video Scraper API](https://apify.com/api_harbor/tiktok-video-scraper): views, likes, shares, hashtags and music of any video.
- [YouTube Comments Scraper API](https://apify.com/api_harbor/youtube-comments-scraper): comments and replies of YouTube videos.

# Actor input Schema

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

TikTok video URLs or numeric video IDs. Up to 50 per run.

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

Maximum number of top-level comments per video (up to 10,000). Replies are not counted in this limit.

## `maxReplies` (type: `integer`):

Replies to fetch for each comment. 0 = no replies.

## Actor input object example

```json
{
  "videos": [
    "https://www.tiktok.com/@scout2015/video/6718335390845095173"
  ],
  "maxComments": 100,
  "maxReplies": 0
}
```

# Actor output Schema

## `results` (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 = {
    "videos": [
        "https://www.tiktok.com/@scout2015/video/6718335390845095173"
    ],
    "maxComments": 100,
    "maxReplies": 0
};

// Run the Actor and wait for it to finish
const run = await client.actor("api_harbor/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 = {
    "videos": ["https://www.tiktok.com/@scout2015/video/6718335390845095173"],
    "maxComments": 100,
    "maxReplies": 0,
}

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

```

## MCP server setup

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