# TikTok Comments and Replies Collector (`tik-aio/tiktok-comment-scraper`) Actor

Collect TikTok comments and replies from any public video in a structured format ready for production use.
Built for social listening teams, creator analytics, campaign monitoring, and moderation workflows.
Includes pagination, reply crawling, and output options.
Free trial: 100 comments/month.

- **URL**: https://apify.com/tik-aio/tiktok-comment-scraper.md
- **Developed by:** [Tik Gpt Anoy](https://apify.com/tik-aio) (community)
- **Categories:** Social media, Developer tools, Videos
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## TikTok Comments and Replies Scraper

Production-ready Apify Actor for extracting TikTok comments and replies from a video URL or video ID.

This Actor is designed for:
- Social listening and sentiment workflows
- Community moderation tools
- Creator and campaign analytics
- Data pipelines that need clean parsed output

### Free Trial

- Free trial: each user can get up to **100 output comments per month**.

### Features

- Accepts TikTok video URL or video ID
- Crawls top-level comments with pagination
- Crawls replies for each comment
- Parsed output designed for easy downstream use
- Optional raw output for full fidelity
- Safe logging mode to avoid leaking called request URLs

### Input

You can provide either video_url or video_id.

Example input:

```json
{
  "video_url": "https://www.tiktok.com/@tiktok/video/7627468769413106962",
  "limit_comments": 100,
  "fetch_replies": true,
  "limit_replies": 20,
  "output_mode": "parsed",
  "include_source_video_url": false,
  "proxy": ""
}
````

Input fields:

- video\_url: TikTok video URL
- video\_id: Optional direct video ID
- limit\_comments: Max top-level comments to crawl (upper bound)
- fetch\_replies: Fetch reply comments
- limit\_replies: Max replies per top-level comment
- output\_mode: raw, parsed, or both
- include\_source\_video\_url: Include source URL in output (default false)
- proxy: Optional outbound proxy URL

Limit behavior:

- If `limit_comments` is higher than the number of comments available on the video, the actor fetches all available comments and then stops automatically.
- The same rule applies to replies per comment when `limit_replies` is higher than available replies.

### Output

Recommended for users: output\_mode = parsed

Parsed output shape:

- video\_id
- source\_video\_url (null by default unless explicitly enabled)
- total\_comments
- total\_replies
- errors
- timestamp
- comments\[]

Each parsed comment includes:

- comment\_id
- text
- comment\_language
- digg\_count
- reply\_comment\_total
- replies\_fetched\_count
- share\_info
- author
- replies\[]

Each parsed reply includes:

- reply\_id
- parent\_comment\_id
- text
- comment\_language
- digg\_count
- share\_info
- author

Example parsed response (output\_mode = parsed):

```json
{
  "video_id": "7627865949982428432",
  "source_video_url": null,
  "total_comments": 2,
  "total_replies": 3,
  "errors": [],
  "timestamp": "2026-04-19T04:41:46.059893Z",
  "comments": [
    {
      "comment_id": "7628233157611766549",
      "video_id": "7627865949982428432",
      "text": "Great live performance",
      "comment_language": "en",
      "language": "en",
      "created_at_ts": 1776086451,
      "created_at_iso": "2026-04-13T13:20:51Z",
      "digg_count": 37,
      "like_count": 37,
      "reply_count": 1,
      "reply_comment_total": 1,
      "replies_fetched_count": 1,
      "status": 1,
      "share_info": {
        "acl": {
          "code": 0,
          "extra": "{}"
        },
        "need_confirm": true,
        "desc_tpl": "'s comment"
      },
      "labels": [],
      "mentions": [],
      "author": {
        "user_id": "7115250451100992513",
        "sec_uid": "MS4wLjABAAAA...",
        "unique_id": "sample_user",
        "nickname": "Sample User",
        "signature": "",
        "region": "VN",
        "avatar_url": "https://p16-sign.tiktokcdn.com/...",
        "avatar_uri": "tos-alisg-avt-0068/...",
        "verification_type": 0,
        "is_verified": false
      },
      "replies": [
        {
          "reply_id": "7628861253877220104",
          "video_id": "7627865949982428432",
          "parent_comment_id": "7628233157611766549",
          "reply_to_reply_id": "0",
          "reply_to_user_id": "",
          "reply_to_username": "",
          "text": "Agreed",
          "comment_language": "en",
          "language": "en",
          "created_at_ts": 1776232694,
          "created_at_iso": "2026-04-15T05:58:14Z",
          "digg_count": 11,
          "like_count": 11,
          "status": 1,
          "share_info": {
            "acl": {
              "code": 0,
              "extra": "{}"
            },
            "desc_tpl": "'s comment",
            "need_confirm": true
          },
          "labels": [],
          "mentions": [],
          "author": {
            "user_id": "6697171352418288642",
            "sec_uid": "MS4wLjABAAAA...",
            "unique_id": "reply_user",
            "nickname": "Reply User",
            "signature": "",
            "region": "VN",
            "avatar_url": "https://p16-sign.tiktokcdn.com/...",
            "avatar_uri": "tos-alisg-avt-0068/...",
            "follower_count": 0,
            "following_count": 0,
            "aweme_count": 0,
            "verification_type": 0,
            "is_verified": false
          }
        }
      ]
    }
  ]
}
```

Example response when output\_mode = both:

```json
{
  "parsed": {
    "video_id": "7627865949982428432",
    "source_video_url": null,
    "total_comments": 20,
    "total_replies": 28,
    "errors": [],
    "timestamp": "2026-04-19T04:41:46.059893Z",
    "comments": []
  },
  "raw": {
    "video_id": "7627865949982428432",
    "comments": [],
    "total_comments_fetched": 20,
    "total_replies_fetched": 28,
    "errors": [],
    "timestamp": "2026-04-19T04:41:46.059893Z"
  }
}
```

Full sample output is available in `data-sample.json`.

### Privacy and Security

- Request URLs are not logged directly
- Error text is sanitized to redact URLs
- source\_video\_url is hidden by default in parsed output

### Compliance

Use this Actor only where usage is lawful and compliant with applicable platform terms and local regulations.

# Actor input Schema

## `video_url` (type: `string`):

Full URL of the TikTok video (e.g., https://www.tiktok.com/@username/video/123456789)

## `video_id` (type: `string`):

Optional direct video ID if you do not want to pass video\_url

## `limit_comments` (type: `integer`):

Maximum number of comments to fetch (default: 100)

## `fetch_replies` (type: `boolean`):

Whether to fetch replies for each comment

## `limit_replies` (type: `integer`):

Maximum replies fetched for each parent comment

## `output_mode` (type: `string`):

Choose result format: raw, parsed, or both

## `include_source_video_url` (type: `boolean`):

When enabled, source\_video\_url will be returned in parsed output

## `proxy` (type: `string`):

Optional proxy URL (e.g., http://proxy.example.com:8080)

## Actor input object example

```json
{
  "video_url": "https://www.tiktok.com/@tiktok/video/7626770644042059015",
  "limit_comments": 100,
  "fetch_replies": true,
  "limit_replies": 100,
  "output_mode": "both",
  "include_source_video_url": false
}
```

# 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 = {};

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

# Run the Actor and wait for it to finish
run = client.actor("tik-aio/tiktok-comment-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 '{}' |
apify call tik-aio/tiktok-comment-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "TikTok Comments and Replies Collector",
        "description": "Collect TikTok comments and replies from any public video in a structured format ready for production use.\nBuilt for social listening teams, creator analytics, campaign monitoring, and moderation workflows.\nIncludes pagination, reply crawling, and output options.\nFree trial: 100 comments/month.",
        "version": "1.0",
        "x-build-id": "Ieaqakr5bLDrRNlqc"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/tik-aio~tiktok-comment-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-tik-aio-tiktok-comment-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/tik-aio~tiktok-comment-scraper/runs": {
            "post": {
                "operationId": "runs-sync-tik-aio-tiktok-comment-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/tik-aio~tiktok-comment-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-tik-aio-tiktok-comment-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",
                "properties": {
                    "video_url": {
                        "title": "TikTok Video URL",
                        "type": "string",
                        "description": "Full URL of the TikTok video (e.g., https://www.tiktok.com/@username/video/123456789)"
                    },
                    "video_id": {
                        "title": "TikTok Video ID (Optional)",
                        "type": "string",
                        "description": "Optional direct video ID if you do not want to pass video_url"
                    },
                    "limit_comments": {
                        "title": "Max Comments",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Maximum number of comments to fetch (default: 100)",
                        "default": 100
                    },
                    "fetch_replies": {
                        "title": "Fetch Replies",
                        "type": "boolean",
                        "description": "Whether to fetch replies for each comment",
                        "default": true
                    },
                    "limit_replies": {
                        "title": "Max Replies Per Comment",
                        "minimum": 0,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Maximum replies fetched for each parent comment",
                        "default": 100
                    },
                    "output_mode": {
                        "title": "Output Mode",
                        "enum": [
                            "both",
                            "parsed",
                            "raw"
                        ],
                        "type": "string",
                        "description": "Choose result format: raw, parsed, or both",
                        "default": "both"
                    },
                    "include_source_video_url": {
                        "title": "Include Source Video URL In Output",
                        "type": "boolean",
                        "description": "When enabled, source_video_url will be returned in parsed output",
                        "default": false
                    },
                    "proxy": {
                        "title": "Proxy URL",
                        "type": "string",
                        "description": "Optional proxy URL (e.g., http://proxy.example.com:8080)"
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
