# Douyin Danmaku Scraper - Bullet Comments (弹幕) from Videos (`hgservices/douyin-danmaku-scraper`) Actor

Scrape the danmaku (弹幕), the bullet comments that fly over Douyin (抖音) videos: text, time in the video, likes, post time and user ID for every comment, plus the video's caption, author and length. Paste video or share links. No login. Export JSON, CSV or Excel.

- **URL**: https://apify.com/hgservices/douyin-danmaku-scraper.md
- **Developed by:** [Harish Garg](https://apify.com/hgservices) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 video segment with danmakus

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/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 Danmaku Scraper — Bullet Comments (弹幕) from Douyin Videos

Paste any **Douyin (抖音)** video link and get its **danmaku (弹幕, also called danmu or bullet comments)**. These are the comments that fly across the video while it plays. Every danmaku comes with its **text, the exact moment in the video, likes, post time and the poster's user ID**, plus the video's **caption, author and length**.

No Douyin account, no login, no cookies, no coding. Export the danmaku to **JSON, CSV, Excel or HTML**, get them through the **API**, or ask an AI assistant such as **Claude** or **ChatGPT** to run the scraper for you.

### What does the Douyin Danmaku Scraper do?

- 💬 **Every danmaku of a video.** The scraper reads the full timeline of the video, from the first second to the last.
- ⏱️ **Time-coded.** Each danmaku has the moment it appears in the video, in milliseconds and as `m:ss`. You can see which scenes get the most reactions.
- 👍 **Likes and post time.** You get the like count and the date and time each danmaku was posted.
- 🎬 **Video context on every row.** Each row has the video ID, link, caption, author, length and Douyin's danmaku total.
- 📱 **Accepts every common link.** Desktop links, `v.douyin.com` share links, the full share text from the Douyin app, or plain video IDs.
- 🎚️ **Optional limit.** Get all danmaku, or only the first N of each video.
- 🔁 **Many videos in one run.** Add as many links as you need. The scraper skips a video that you added two times.
- ✅ **Clear errors.** A deleted video, a video without danmaku, a profile link or a link from another site gets a row that tells you what is wrong.

### What data can you extract from Douyin danmaku?

| Field | What you get |
|------|-------------|
| Danmaku | ID, text, ad flag |
| Time in video | Milliseconds from the start, and `m:ss` (or `h:mm:ss`) |
| Engagement | Like count |
| Posted | Date and time in UTC |
| Poster | Numeric Douyin user ID |
| Video | ID, URL, caption, author name, length, Douyin's danmaku total |

### Input

| Field | Type | Description |
|-------|------|-------------|
| `videoUrls` | array of strings (required) | Douyin video links, share links, share text or video IDs. |
| `maxDanmakuPerVideo` | integer (optional) | The maximum number of danmaku for each video, counted from the start of the video. Leave it empty to get all of them. |

#### Which links can I use?

- `https://www.douyin.com/video/7667193358258867499`
- `https://www.douyin.com/?modal_id=7667193358258867499` and other links with `modal_id`
- `https://www.douyin.com/note/…` links
- `https://v.douyin.com/gNby9EOAPLE/` share links
- The full share text from the Douyin app ("复制打开抖音，看看…")
- A plain video ID: `7667193358258867499`

Profile links (`/user/…`) and links from other sites, such as TikTok, do not work. They get an error row.

#### Input example

```json
{
    "videoUrls": [
        "https://www.douyin.com/video/7667193358258867499",
        "https://v.douyin.com/gNby9EOAPLE/"
    ],
    "maxDanmakuPerVideo": 500
}
```

### Output

You get one row for each danmaku. The rows of a video come in timeline order, from the start of the video to the end.

#### Output example

```json
{
    "sourceInput": "https://www.douyin.com/video/7667193358258867499",
    "videoId": "7667193358258867499",
    "videoUrl": "https://www.douyin.com/video/7667193358258867499",
    "videoCaption": "穿越到一战时期？ #游戏 #单机游戏 #青年创作者成长计划 #八号战壕",
    "videoAuthorName": "超稽阿威",
    "videoDurationMs": 650183,
    "videoDanmakuTotal": 458,
    "danmakuId": "7669005622700344113",
    "text": "？后室都来了",
    "offsetMs": 639192,
    "offsetClock": "10:39",
    "createTime": "2026-08-01T10:18:35+00:00",
    "userId": "53938550907",
    "likeCount": 11,
    "isAd": false
}
```

#### Error row example

An input that returns no danmaku gets one row with an `error` field instead:

```json
{
    "sourceInput": "https://www.douyin.com/user/MS4wLjABAAAA…",
    "error": "This is a Douyin profile link, not a video link. Open one of the creator's videos and paste its link or share link instead."
}
```

### How to use the Douyin Danmaku Scraper

You can run the scraper in four ways: in Apify Console, with the Apify API, with the Apify API clients for JavaScript and Python, or from an AI assistant. All four use the same input and give the same output.

#### 1. Apify Console (no coding)

1. Open the Douyin Danmaku Scraper page in Apify Store and click **Try for free**.
2. Sign in to Apify, or create a free account.
3. On the **Input** tab, paste one or more Douyin links or IDs into **Video URLs or IDs**.
4. Optional: type a number in **Max danmaku per video**.
5. Click **Start**.
6. When the run ends, open the **Output** tab to see the danmaku in a table.
7. Click **Export** to download the data as JSON, CSV, Excel, HTML or XML.

To use the same input again, click **Save as a new task**. To run the task automatically, for example every day, add a **schedule** to it.

#### 2. Apify API (HTTP)

Get your API token from **Settings → API & Integrations** in Apify Console. Replace `YOUR_API_TOKEN` in the examples with your token.

This request runs the scraper, waits for it to finish and returns the danmaku in the response:

```bash
curl -X POST "https://api.apify.com/v2/acts/hgservices~douyin-danmaku-scraper/run-sync-get-dataset-items" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"videoUrls": ["https://www.douyin.com/video/7667193358258867499"]}'
```

To get CSV or Excel instead of JSON, add `?format=csv` or `?format=xlsx` to the URL.

A synchronous request waits for a maximum of 300 seconds. For many videos or very long videos, start the run without waiting, and then get the results:

```bash
## 1. Start the run. The response contains "id" and "defaultDatasetId".
curl -X POST "https://api.apify.com/v2/acts/hgservices~douyin-danmaku-scraper/runs" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"videoUrls": ["https://www.douyin.com/video/7667193358258867499"]}'

## 2. When the run status is SUCCEEDED, get the danmaku.
curl "https://api.apify.com/v2/datasets/DATASET_ID/items?format=json" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

#### 3. JavaScript / Node.js (apify-client)

Install the client with `npm install apify-client`.

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });

const run = await client.actor('hgservices/douyin-danmaku-scraper').call({
    videoUrls: ['https://www.douyin.com/video/7667193358258867499'],
    maxDanmakuPerVideo: 500,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
for (const d of items) {
    console.log(d.offsetClock, d.text, d.likeCount);
}
```

#### 4. Python (apify-client)

Install the client with `pip install apify-client`. This example is for apify-client version 3 or later.

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")

run = client.actor("hgservices/douyin-danmaku-scraper").call(run_input={
    "videoUrls": ["https://www.douyin.com/video/7667193358258867499"],
    "maxDanmakuPerVideo": 500,
})

for d in client.dataset(run.default_dataset_id).iterate_items():
    print(d.get("offsetClock"), d.get("text"), d.get("likeCount"))
```

In apify-client version 2 or earlier, use `run["defaultDatasetId"]` instead of `run.default_dataset_id`.

The **API** tab of the Actor page has more examples and the full list of API endpoints.

#### 5. AI assistants: Claude, ChatGPT and other MCP clients

The scraper is available through the **Apify MCP server**. Connect your AI assistant to the server one time, and then ask in plain language. For example:

> *"Get the danmaku of https://www.douyin.com/video/7667193358258867499 and tell me which minute of the video gets the most reactions."*

To give the assistant only this scraper, use this server URL:

```
https://mcp.apify.com?tools=hgservices/douyin-danmaku-scraper
```

You can also use `https://mcp.apify.com` without parameters. Then the assistant can search Apify Store and run this scraper and other Actors.

**Claude (claude.ai and Claude Desktop)**

1. Open **Settings → Connectors**.
2. Click **Add custom connector**.
3. Type a name, for example `Apify`, and paste the server URL.
4. Click **Add**, and then sign in to Apify.

**Claude Code**

```bash
claude mcp add --transport http apify "https://mcp.apify.com?tools=hgservices/douyin-danmaku-scraper"
```

Then run `/mcp` in Claude Code and sign in to Apify.

**ChatGPT**

1. Turn on **Developer mode** in ChatGPT.
2. Open **Settings → Apps & Connectors** and click **Create**.
3. Type a name, and paste the server URL into **MCP Server URL**.
4. Select **OAuth** for authentication, click **Create**, and then sign in to Apify.
5. In a new chat, click **+** → **More**, and select your Apify connector.

**Cursor, VS Code, Windsurf and other MCP clients**

Add this to the MCP configuration of your client:

```json
{
    "mcpServers": {
        "apify": {
            "url": "https://mcp.apify.com?tools=hgservices/douyin-danmaku-scraper"
        }
    }
}
```

Your client opens a browser window the first time, so that you can sign in to Apify. The [Apify MCP configurator](https://mcp.apify.com) can make the configuration for other clients.

### Integrations

Send the danmaku to the tools you already use with Apify integrations: **Google Sheets, Google Drive, Slack, Make, Zapier, n8n, Airbyte, GitHub** and webhooks. Use **schedules** to scrape the same videos again at regular intervals and see how their danmaku grow.

### Use cases

- **Audience reaction analysis** — see which moments of a video make viewers react, and how.
- **Sentiment analysis** — collect real-time viewer comments for NLP and sentiment models.
- **Content research** — find the scenes, jokes and topics that get the most danmaku.
- **Brand and campaign monitoring** — read what viewers say during branded or sponsored videos.
- **Gaming and entertainment research** — study live viewer reactions to game plays, dramas and shows.
- **Datasets for AI and machine learning** — time-coded Chinese comments with likes.

### Tips for the best results

- **Not every video has danmaku.** Many Douyin videos have none, mostly short or less popular ones. Those inputs get a row that says so.
- **You can get fewer than the total.** `videoDanmakuTotal` is Douyin's own count. Douyin does not show some danmaku to visitors who are not logged in. In our tests, a run got about 90% of the total.
- **Long and popular videos have the most.** Entertainment, gaming and long videos often have hundreds of danmaku.
- **Use `offsetMs` to find hot moments.** Group the danmaku by minute to see where viewers react the most.
- **Use the limit for a quick sample.** Set `maxDanmakuPerVideo` to get only the start of each video.

### FAQ

**What is danmaku?**
Danmaku (弹幕, "bullet comments", also called danmu) are short comments that viewers post at a moment of a video. Everyone who watches the video sees them fly across the screen at that moment. They are different from the normal comments under a video.

**Does the scraper get the normal comments of a video?**
No. This scraper gets only the danmaku that show over the video, not the comments under it.

**Does the scraper return the poster's name?**
No. Douyin shows only a numeric user ID with each danmaku, not a name or a profile link.

**Do I need a Douyin account?**
No. The scraper works without an account, a password or cookies.

**Does it work with share links from the Douyin app?**
Yes. Paste the `v.douyin.com` link or the full share text that the app copies.

**Can I scrape TikTok or Bilibili danmaku with this scraper?**
No. This scraper works with Douyin, the Chinese version of TikTok, only.

**Why does a video show an error "no danmaku"?**
The video has no bullet comments on Douyin. Open the video in a browser and turn on danmaku to check.

### Other Douyin scrapers

- [Douyin Video Downloader & Scraper](https://apify.com/hgservices/douyin-scraper) — get no-watermark videos and video data.
- [Douyin Profile Scraper](https://apify.com/hgservices/douyin-profile-scraper) — get a creator's videos with stats.
- [Douyin Search Scraper](https://apify.com/hgservices/douyin-search-scraper) — find Douyin videos by keyword.
- [Douyin Related Videos Scraper](https://apify.com/hgservices/douyin-related-videos-scraper) — get the videos Douyin recommends next to a video.
- [Douyin Collection Scraper](https://apify.com/hgservices/douyin-collection-scraper) — get every episode of a series or short drama.
- [Douyin AI Transcript Scraper](https://apify.com/hgservices/douyin-ai-transcript-scraper) — get the spoken text of Douyin videos.

### Is it legal to scrape Douyin?

This scraper collects only **publicly available** data. You are responsible for how you use the data. Obey Douyin's terms of service and the laws that apply to you, such as GDPR and copyright law.

### Feedback and support

Found a problem or need a new field? Open an issue on the **Issues** tab.

# Actor input Schema

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

Douyin video links (https://www.douyin.com/video/7667193358258867499), links with ?modal_id=<id>, v.douyin.com share links, the full share text copied from the Douyin app, or plain numeric video IDs. You get every danmaku of each video.

## `maxDanmakuPerVideo` (type: `integer`):

Stop after this many danmaku for each video, counted from the start of the video. Leave empty to get all of them.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.douyin.com/video/7667193358258867499"
  ]
}
```

# Actor output Schema

## `danmaku` (type: `string`):

One item per danmaku: text, time in the video (ms and m:ss), post time, user ID, likes, ad flag, plus the video's ID, URL, caption, author, length and Douyin's danmaku total. Failed inputs appear as items with 'sourceInput' and 'error' fields.

# 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/7667193358258867499"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("hgservices/douyin-danmaku-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/7667193358258867499"] }

# Run the Actor and wait for it to finish
run = client.actor("hgservices/douyin-danmaku-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/7667193358258867499"
  ]
}' |
apify call hgservices/douyin-danmaku-scraper --silent --output-dataset

```

## MCP server setup

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