# Douyin 抖音 Comments Scraper: Text, Likes & Users (`theshark/douyin-comments-scraper`) Actor

Scrape comments of Douyin (抖音) videos by link or ID, no login needed. Get comment text, likes, reply counts, date, IP region, pinned and author-liked flags, mentions, images and the commenter's profile. Set a limit per video. Pay only for results.

- **URL**: https://apify.com/theshark/douyin-comments-scraper.md
- **Developed by:** [TheShark](https://apify.com/theshark) (community)
- **Categories:** Social media, Videos, Automation
- **Features:** 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 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

## Douyin 抖音 Comments Scraper: Text, Likes & Users

Scrape comments of [Douyin](https://www.douyin.com) (抖音, the Chinese TikTok) videos: the comment text, likes, number of replies, date, IP region, pinned, hot and author-liked flags, mentions, attached images and the commenter's profile. One clean row per comment, as many as you need per video.

No Douyin account, login, cookies or proxies of your own are needed. You pay only for comments that were collected.

### What can you do with Douyin Comments Scraper?

- **Understand your audience:** what viewers say, ask and like under your videos or a competitor's.
- **Measure sentiment:** comment text, likes and replies, ready for your analysis tools.
- **Find active users:** commenters' nicknames, IDs and regions.
- **Track a campaign:** collect new comments on a schedule.
- **Use it as a Douyin API:** start runs and get results from your own code through the Apify API.

### What data can you get from Douyin comments?

| Data | Fields |
|---|---|
| Comment | ID, text, date, likes, number of replies, IP region, label, level |
| Flags | pinned, hot, liked by the author, folded |
| Commenter | nickname, Douyin ID, short ID, uid, sec_uid, avatar, region, verification |
| Content | mentions, attached images with sizes and download links |
| Context | the video ID, its total comment count and your input link |

### How to scrape Douyin comments

1. Paste video links (douyin.com/video/…, v.douyin.com short links from the share button) or numeric video IDs.
2. Optionally set **Max comments per video**. Leave it empty to collect all.
3. Click **Start**. A row per comment appears in the dataset.
4. Download the results as JSON, CSV, Excel or HTML, or get them through the API.

### Input

| Field | Description |
|---|---|
| Douyin video links or IDs | Video links, v.douyin.com short links or numeric video IDs, one per line. |
| Max comments per video | Stop after this many comments per video. Empty means all. |

```json
{
  "videoUrls": ["https://www.douyin.com/video/7704994297501846825"],
  "maxComments": 500
}
```

### Output

One row per comment.

#### Comment

| Field | Description |
|---|---|
| `cid` | Comment ID. |
| `aweme_id` | ID of the video the comment belongs to. |
| `input_url` | The video URL/ID you entered that produced this comment (matches short links to results). |
| `text` | Comment text. |
| `create_time` | Posted at, unix seconds. |
| `create_time_iso` | Posted at, ISO 8601 UTC. |
| `digg_count` | Likes. |
| `reply_count` | Total number of replies. |
| `content_type` | Douyin content type code (observed: 1 = text only, 3 = with media — `images[]` is filled for most, not all, of these). |
| `level` | Thread level (1 = top-level comment). |
| `item_comment_total` | Total comments on the video, as Douyin reports it with this page. |
| `ip_label` | Commenter's public IP region (e.g. `湖南`), province level. |
| `is_hot` | Marked as a hot comment. |
| `is_author_digged` | Liked by the video's author. |
| `user_digged` | Liked by the viewer (always `false` in this dataset). |
| `is_folded` | Folded (hidden by default) by Douyin. |
| `stick_position` | Pinned position (0 = not pinned). |
| `label_text` | Douyin label, e.g. `作者` when the video's author wrote the comment. |
| `label_type` | Douyin label type code (-1 = none). |
| `reply_id` | Parent comment ID when this row is a reply (empty for top-level comments). |
| `reply_to_reply_id` | Reply being answered inside a thread (empty if none). |

#### Commenter

| Field | Description |
|---|---|
| `user_sec_uid` | Commenter's sec_uid (same as `user.sec_uid`). |
| `user_nickname` | Commenter's display name (same as `user.nickname`). |
| `user.uid` | Numeric user ID. |
| `user.sec_uid` | Stable public user ID. |
| `user.nickname` | Display name. |
| `user.unique_id` | The @handle (Douyin ID). |
| `user.short_id` | Legacy numeric Douyin ID. |
| `user.avatar_thumb` | Avatar URL. |
| `user.region` | Account region code (e.g. `CN`). |
| `user.custom_verify` | Verification text. |
| `user.enterprise_verify_reason` | Business verification text. |
| `user.is_star` | Douyin's "star" (notable account) flag. |
| `user.commerce_user_level` | Douyin's seller level code (0 = none). |

#### Mentions, pictures, replies

| Field | Description |
|---|---|
| `mentions[]` | @mentions in the comment, each with: |
| `mentions[].text` | The mention as written (e.g. `@name`). |
| `mentions[].uid` | Mentioned user's numeric ID. |
| `mentions[].sec_uid` | Mentioned user's sec_uid. |
| `images[]` | Pictures attached to the comment, each with: |
| `images[].url` | Original image URL. |
| `images[].download_url` | Douyin's download rendition (watermarked). |
| `images[].width` | Width in pixels. |
| `images[].height` | Height in pixels. |
| `reply_comment[]` | Inline replies Douyin returned with the comment (same fields as a comment). Usually empty on the web — see Limits. |

#### Row statuses

| Row | Meaning | Charged? |
|---|---|---|
| Comment row | One comment, with `cid` and `text`. | Yes |
| `ok: true`, `comments: 0` | The video has no comments. | No |
| `ok: false` | The video's comments were not collected. `error` and `reason` say why: `BlockedOrGone` means the video was deleted, made private or never existed; for any other value, run it again later. | No |
| `error: "Skipped"` | The run did not get to this input. Run it again. | No |

Comment rows have no `ok` field; only the other rows do (`true` or `false`). Rows with `ok: false` carry `url` and `input_url` (your input). When only part of a video's comments came through, the collected ones stay in the dataset and its `ok: false` row gives their number in `comments`.

### How much does it cost to scrape Douyin comments?

The actor uses pay-per-event pricing: a flat price per collected comment and a small fee per run start. The current prices are on the **Pricing** tab.

| Event | When it is charged |
|---|---|
| Result | One comment collected. |
| Actor start | Once per run. |

You pay only for what was delivered:

- Only rows with data are charged. Rows with `ok: false` are free.
- Set a maximum cost per run in Apify and the actor stops cleanly when it is reached, keeping everything collected so far.
- Nothing is charged twice in one run, even if Apify restarts or migrates the run.

### Good to know

- **Replies.** Every comment has its `reply_count`. Reply threads themselves are not part of Douyin's public web data, so `reply_comment[]` is usually empty.
- **Images in comments** are signed CDN links that expire; download them soon after the run.
- **Order.** Comments come in the order Douyin shows them, until there are no more or your limit is reached.
- **Data is in Chinese**, exactly as Douyin shows it.

### Integrations and API

- **API:** start runs and download results with the [Apify API](https://docs.apify.com/api/v2) or the Apify clients for Python and JavaScript.
- **Schedules:** run the actor every hour, day or week and keep the numbers fresh.
- **Integrations:** send results to Google Sheets, Slack, Make, Zapier, webhooks and other tools supported by Apify.

### FAQ

**Do I need a Douyin account or proxies?**
No. The actor does not log in and uses its own proxies.

**How many comments can I get per video?**
As many as Douyin shows for the video. Set **Max comments per video** to cap the cost.

**Can I scrape several videos at once?**
Yes, paste as many links as you need. Each comment row has `input_url`, so you know which video it belongs to.

**Do I pay for comments that were not collected?**
No. Only comment rows are charged.

# Actor input Schema

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

Douyin videos to collect comments from: links (douyin.com/video/…, v.douyin.com short links) or numeric video IDs. One per line.

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

Stop after this many comments for each video. Leave empty to collect all of them.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.douyin.com/video/7704994297501846825"
  ],
  "maxComments": 50
}
```

# Actor output Schema

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

One row per comment of each video you entered: text, likes, replies, date and the commenter.

# 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 = {
    "videoUrls": [
        "https://www.douyin.com/video/7704994297501846825"
    ],
    "maxComments": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("theshark/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 = {
    "videoUrls": ["https://www.douyin.com/video/7704994297501846825"],
    "maxComments": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("theshark/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 '{
  "videoUrls": [
    "https://www.douyin.com/video/7704994297501846825"
  ],
  "maxComments": 50
}' |
apify call theshark/douyin-comments-scraper --silent --output-dataset

```

## MCP server setup

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