# Bilibili Danmaku Scraper - Full Bullet Comments, No Login (`headply/bilibili-danmaku-scraper`) Actor

Download the complete danmaku (弹幕, bullet comments) of any Bilibili video: text, video time, color, send time and sender hash, every part and segment. No login, no API key.

- **URL**: https://apify.com/headply/bilibili-danmaku-scraper.md
- **Developed by:** [Mayowa Ogedengbe](https://apify.com/headply) (community)
- **Categories:** Social media, Videos
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.70 / 1,000 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

## Bilibili Danmaku Scraper: Full Bullet Comments (No Login)

Download the **complete danmaku (弹幕, bullet comments)** of any Bilibili video, without an account: every comment that
flies across the video, with the exact second it appears, its text, color, position mode, send time and the sender's
hash. All parts of multi-part videos, every segment of long videos.

- **Complete, not a sample.** Bilibili's old XML danmaku file is capped (often 1,000–3,000). This Actor reads the
  segmented danmaku feed the player itself uses, six minutes at a time, so long videos come back in full.
- **Any video link:** `bilibili.com/video/...`, `b23.tv` short links, BV or av ids. Add `?p=2` to take one part only.
- **Analysis-ready:** sorted by video time, with ISO timestamps, ready for sentiment, keyword or "hot moment" analysis.
- **No login, no cookies, no API key.**

Tested on the platform: 3 videos → **4,249 danmaku in 11 seconds**, every request succeeding.

### Input

```json
{ "mode": "danmaku", "videoUrls": ["https://www.bilibili.com/video/BV1xx411c7XX", "https://b23.tv/AbCdEf1"], "maxDanmakuPerVideo": 20000 }
```

`maxDanmakuPerVideo` (default 5,000) caps each video, counted in video-time order. The same Actor can also search videos,
fetch video details and creators (`mode`: `search`, `videos`, `creators`): see the [Bilibili Scraper](https://apify.com/headply/bilibili-scraper).

### Output sample

```json
{
  "type": "danmaku",
  "bvid": "BV1QmpE6aEA7",
  "aid": 117421704741732,
  "cid": 42649978422,
  "part": 1,
  "danmakuId": "2219972847839986432",
  "text": "传送门08:20",
  "videoTimeSeconds": 0.0,
  "mode": 1,
  "fontSize": 25,
  "color": "#ffffff",
  "sentAt": "2026-10-11T15:29:46Z",
  "senderHash": "e33a9659",
  "pool": 0,
  "weight": 10,
  "scrapedAt": "2026-10-12T08:00:00Z"
}
```

`mode`: 1–3 scrolling, 4 bottom, 5 top, 7 advanced. `senderHash` is Bilibili's hashed sender id (the platform does not
expose usernames for danmaku). Field names are stable; a `SUMMARY` record lists counts and anything skipped.

### Pricing

| Event | Price per 1,000 |
|---|---|
| Danmaku | $1.00 |
| Run start | $0.001 per run |

Higher Apify plans get automatic discounts. Example: a 30-minute video with ~3,600 danmaku ≈ **$3.60**; cap it with
`maxDanmakuPerVideo` if you only need a sample. Videos that do not exist are not charged.

### API, n8n, Make

```bash
curl -X POST "https://api.apify.com/v2/acts/headply~bilibili-danmaku-scraper/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"mode":"danmaku","videoUrls":["BV1xx411c7XX"],"maxDanmakuPerVideo":5000}'
```

In n8n use the *Apify* node → *Run actor and get dataset* with actor `headply/bilibili-danmaku-scraper`.

### FAQ and limits

- **Is it every danmaku ever sent?** It is everything Bilibili currently serves for the video. Bilibili's `danmaku`
  counter on the video page also counts deleted or expired ones, so it can be higher than what any viewer sees.
- **Comments (评论)?** Not included: Bilibili shows only 3 comments per video to logged-out visitors.
- **Account needed?** No.

### Related

- [Bilibili Scraper](https://apify.com/headply/bilibili-scraper): search videos by keyword, video details, creators and their uploads.

# Actor input Schema

## `mode` (type: `string`):

One job per run. Each job uses the matching inputs below.

## `searchQueries` (type: `array`):

Mode 'search': keywords, Chinese or English. Each returns up to 1,000 videos.

## `maxResultsPerQuery` (type: `integer`):

Mode 'search'. Bilibili shows at most 1,000 results per keyword (50 pages x 20).

## `sortBy` (type: `string`):

Mode 'search'.

## `includeDetails` (type: `boolean`):

Mode 'search': adds coins, shares, exact likes, parts and the full tag list (one extra request per video, slower).

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

Modes 'videos', 'danmaku': bilibili.com/video URLs, b23.tv short links, BV ids or av ids. Add ?p=2 to a URL to take danmaku from that part only.

## `creatorUrls` (type: `array`):

Mode 'creators': space.bilibili.com/<id> URLs or numeric user ids.

## `maxVideosPerCreator` (type: `integer`):

Mode 'creators': newest first. 0 = profile only.

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

Mode 'danmaku': in video-time order.

## `onlyNew` (type: `boolean`):

Modes 'search' and 'creators': for scheduled runs, deliver only videos this monitor has not returned before.

## `monitorName` (type: `string`):

Keeps separate memories for different schedules.

## Actor input object example

```json
{
  "mode": "danmaku",
  "searchQueries": [],
  "maxResultsPerQuery": 50,
  "sortBy": "relevance",
  "includeDetails": false,
  "videoUrls": [
    "https://www.bilibili.com/video/BV1xx411c7XX"
  ],
  "creatorUrls": [],
  "maxVideosPerCreator": 30,
  "maxDanmakuPerVideo": 5000,
  "onlyNew": false,
  "monitorName": "default"
}
```

# Actor output Schema

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

No description

## `summary` (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 = {
    "searchQueries": [],
    "videoUrls": [
        "https://www.bilibili.com/video/BV1xx411c7XX"
    ]
};

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

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

```

## MCP server setup

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