# Douyin Comments Scraper (`toolzerhub/douyin-comments-scraper`) Actor

Collect public comments on any Douyin video by URL or aweme\_id, including reply threads under each comment. Every row returns the comment text, like count, reply count, IP region, author, and post time. Export the data, run via API, or schedule recurring Douyin comment monitoring.

- **URL**: https://apify.com/toolzerhub/douyin-comments-scraper.md
- **Developed by:** [ToolzerHub](https://apify.com/toolzerhub) (community)
- **Categories:** Social media, Automation, For creators
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 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 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

## Douyin Comments Scraper

Collect public comments on a Douyin video from its URL or `aweme_id`, with reply threads under each comment pulled in when you want them.

### Input

| Field | Type | Default | What it does |
|---|---|---|---|
| `aweme_id` | string | — | **Required.** A Douyin video URL or numeric ID. |
| `maxItems` | integer | `100` | Total rows to save — top-level comments and replies share this one budget. `0` collects until the video is exhausted. |
| `include_replies` | boolean | `false` | Also collect replies under each top-level comment. |

```json
{ "aweme_id": "https://www.douyin.com/video/7448118827402972455", "include_replies": true, "maxItems": 200 }
```

### Output

| Field | Contents |
|---|---|
| `cid` | Comment ID |
| `text` | Comment text |
| `digg_count` | Likes on this comment |
| `reply_comment_total` | Number of replies under this comment |
| `ip_label` | IP region shown next to the comment |
| `create_time` | When the comment was posted |
| `user` | The account that wrote it |
| `source_aweme_id` | The video this row was collected from |
| `source_comment_id` | The parent comment this row replies to — only set on reply rows |

### Questions

**With `maxItems: 100` and `include_replies` on, do I get 100 top-level comments plus all their replies?**
No. `maxItems` is one shared budget across everything the run saves, comments and replies together. The Actor pages top-level comments in batches of 50, and for each one — when `include_replies` is on — it fully drains that comment's reply thread, following the thread's own cursor to the end, before moving to the next top-level comment. A single comment with hundreds of replies can consume the whole `maxItems` budget by itself, before the run ever reaches the video's second comment. Turn `include_replies` off if you want breadth across top-level comments instead of depth on the first few.

**How do I tell a reply apart from a top-level comment in the output?**
`source_comment_id` is only set on reply rows, naming the comment it replies to. A row without it is a top-level comment.

**What happens on a video with comments disabled, or none yet?**
The run finishes with zero rows rather than erroring — an empty dataset here means the video had nothing to collect, not that the request failed.

### Other Douyin Actors

| Actor | Use when |
|---|---|
| [Douyin Danmaku Scraper](https://apify.com/toolzerhub/douyin-video-danmaku-scraper) | You want the scrolling on-video comments, not the comment section |
| [Douyin Video Analytics Scraper](https://apify.com/toolzerhub/douyin-video-analytics-scraper) | You want a word-cloud summary of the comments instead of the raw text |
| [Douyin Video Scraper](https://apify.com/toolzerhub/douyin-video-scraper) | You need the video's own caption and stats too |

### Support

Questions, bugs, or feature requests: **contact@toolzerhub.com**

Browse the rest: [apify.com/toolzerhub](https://apify.com/toolzerhub)

# Actor input Schema

## `aweme_id` (type: `string`):

A Douyin video URL, or the numeric video ID it contains.

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

Maximum rows to save. Set 0 to keep collecting until the source is exhausted.

## `include_replies` (type: `boolean`):

Also collect replies for each returned top-level comment.

## Actor input object example

```json
{
  "aweme_id": "https://www.douyin.com/video/7448118827402972455",
  "maxItems": 20,
  "include_replies": false
}
```

# Actor output Schema

## `dataset` (type: `string`):

Every record collected during this run

# 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 = {
    "aweme_id": "https://www.douyin.com/video/7448118827402972455",
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("toolzerhub/douyin-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 = {
    "aweme_id": "https://www.douyin.com/video/7448118827402972455",
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("toolzerhub/douyin-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 '{
  "aweme_id": "https://www.douyin.com/video/7448118827402972455",
  "maxItems": 20
}' |
apify call toolzerhub/douyin-comments-scraper --silent --output-dataset

```

## MCP server setup

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