# Bilibili Scraper Pro — Videos, Danmaku & Creator API (`moeover/bilibili-pro-scraper`) Actor

Fast, 10x cheaper Bilibili (B站) scraper & API. Extract video search, engagement stats, parsed timestamped danmaku XML, popular charts, and creator profiles with zero browser overhead.

- **URL**: https://apify.com/moeover/bilibili-pro-scraper.md
- **Developed by:** [Moe Over](https://apify.com/moeover) (community)
- **Categories:** Social media, Videos
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 bilibili item (video / creator / trending)s

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 Scraper Pro — Videos, Danmaku & Creator API

Fast, reliable Bilibili (B站) Video, Creator, Trending Chart & Parsed Timestamped Danmaku (弹幕) XML API — engineered for zero browser overhead, SPI guest-session reliability, and 10x lower cost than legacy scrapers.

### Key Capabilities & Advantages

- **Zero-Browser, Zero-Proxy Architecture:** Runs cleanly in lightweight containers with near-instant startup and high reliability.
- **Schema-First & MCP-Ready:** Ships with strict Input, Output, and Dataset table schemas for seamless use with **Apify MCP Server (Claude / Cursor)**, **n8n**, **Make**, **Clay**, and **Zapier**.
- **Transparent Pay-Per-Event Pricing:** Pay only for verified records delivered (`$2.00 per 1,000` bilibili video, trending, or creator records) — never for idle browser compute.

### Popular Use Cases

- **Chinese Market & Brand Sentiment Research:** Track video mentions, views, likes, coins (`投币`), favorites, and shares across product keywords.
- **Danmaku (弹幕) Audience Mining:** Enable `includeDanmaku: true` to automatically parse raw XML bullet-comments into timestamped JSON plus top repeated audience phrases (`danmakuTopPhrases`).
- **Creator / KOL Discovery & Vetting:** Pull creator profiles (`mode: creator`) with follower counts, archive counts, total likes, and official verification titles.
- **Viral Trend Monitoring:** Schedule `mode: popular` daily to track rising Chinese tech, gaming, AI, and consumer video trends.

***

### Input Configuration

Every field below matches the Actor's live Input Schema:

| Parameter | Type | Required | Default | Description |
| :--- | :--- | :---: | :--- | :--- |
| `mode` | `string` | No | `"search"` | Choose what to extract: keyword video search, specific video URLs/BVIDs, creator profiles, or live popular/trending charts. |
| `keywords` | `array` | No | `["AI Agent"]` | List of Chinese or English keywords to search on Bilibili (e.g. 'AI Agent', '黑神话悟空', 'Python'). |
| `searchOrder` | `string` | No | `"totalrank"` | How to sort video search results. |
| `videoUrls` | `array` | No | `[]` | Accepts full URLs (https://www.bilibili.com/video/BV...) or raw BV IDs (BV1...). |
| `creatorIds` | `array` | No | `[]` | Accepts numeric Bilibili UIDs (mid) or space URLs (https://space.bilibili.com/946974). |
| `includeDanmaku` | `boolean` | No | `false` | When enabled on 'video' or 'search' (with enrichDetails) mode, fetches and parses the video's danmaku XML into structured timestamped bullet comments + top phrases. |
| `maxDanmakuPerVideo` | `integer` | No | `200` | Maximum parsed danmaku lines stored per video when includeDanmaku is enabled. |
| `enrichVideoDetails` | `boolean` | No | `false` | Calls Bilibili's video detail API for each search hit to add exact likes, coins, shares, favorites, and CID. |
| `maxItems` | `integer` | No | `30` | Maximum number of items returned per keyword (search) or total items (popular). |

#### Example Input JSON

```json
{
  "mode": "search",
  "keywords": [
    "AI Agent"
  ],
  "searchOrder": "totalrank",
  "videoUrls": [],
  "creatorIds": [],
  "includeDanmaku": false,
  "maxDanmakuPerVideo": 200,
  "enrichVideoDetails": false,
  "maxItems": 20
}
```

***

### Output Data Structure

Results are written to the default Apify Dataset and downloadable as **JSON, CSV, Excel (XLSX), XML, or RSS**.

| Field | Type | Description |
| :--- | :--- | :--- |
| `itemType` | `string` | Item Type |
| `bvid` | `string` | BVID |
| `title` | `string` | Title |
| `author` | `string` | Creator |
| `views` | `number` | Views |
| `likes` | `number` | Likes |
| `coins` | `number` | Coins |
| `danmakuCount` | `number` | Danmaku Count |
| `publishedDate` | `string` | Published Date |
| `url` | `string` | URL |

#### Sample Output Record

```json
{
  "itemType": "video",
  "bvid": "BV1xx411c7mD",
  "title": "AI Agent Workflow Deep Dive",
  "author": "TechCreatorCN",
  "views": 184200,
  "likes": 12450,
  "coins": 4810,
  "danmakuCount": 920,
  "publishedDate": "2026-11-20",
  "danmakuTotalInXml": 920,
  "danmakuTopPhrases": [
    {
      "text": "太强了",
      "count": 48
    },
    {
      "text": "实用",
      "count": 31
    }
  ],
  "url": "https://www.bilibili.com/video/BV1xx411c7mD"
}
```

***

### Transparent Pricing (Pay-Per-Event)

- **Actor Start (`apify-actor-start`):** `$0.00005` flat startup fee per run.
- **Primary Event (`item-result`):** `$0.0020` per item (`$2.00 / 1,000`) — Bilibili video, trending, or creator record.
- **Optional Add-On Event (`danmaku-pack`):** `$0.0050` per item (`$5.00 / 1,000`) — Parsed timestamped Danmaku XML + top phrases (optional).

| Volume | Estimated Total Cost |
| :--- | ---: |
| **100** results | `$0.2001` |
| **1,000** results | `$2.00` |
| **10,000** results | `$20.00` |
| **50,000** results | `$100.00` |

Set Apify's built-in **Max cost per run** cap anytime to guarantee strict budget control.

***

### Integrations (API, Python, Node.js, n8n & AI Agents MCP)

#### cURL (Synchronous JSON Response)

```bash
curl -X POST "https://api.apify.com/v2/acts/moeover~bilibili-pro-scraper/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"mode": "search", "keywords": ["AI Agent"], "searchOrder": "totalrank", "videoUrls": [], "creatorIds": [], "includeDanmaku": false, "maxDanmakuPerVideo": 200, "enrichVideoDetails": false, "maxItems": 20}'
```

#### Python (`apify-client`)

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("moeover/bilibili-pro-scraper").call(run_input={"mode": "search", "keywords": ["AI Agent"], "searchOrder": "totalrank", "videoUrls": [], "creatorIds": [], "includeDanmaku": false, "maxDanmakuPerVideo": 200, "enrichVideoDetails": false, "maxItems": 20})
items = list(client.dataset(run["defaultDatasetId"]).iterate_items())
print(f"Fetched {len(items)} records")
```

#### Node.js / TypeScript (`apify-client`)

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

const client = new ApifyClient({ token: "YOUR_APIFY_TOKEN" });
const run = await client.actor("moeover/bilibili-pro-scraper").call({"mode": "search", "keywords": ["AI Agent"], "searchOrder": "totalrank", "videoUrls": [], "creatorIds": [], "includeDanmaku": false, "maxDanmakuPerVideo": 200, "enrichVideoDetails": false, "maxItems": 20});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### Claude Desktop / Cursor MCP Server

```json
{
  "mcpServers": {
    "apify": {
      "command": "npx",
      "args": ["-y", "@apify/actors-mcp-server", "--actors", "moeover/bilibili-pro-scraper"],
      "env": { "APIFY_TOKEN": "YOUR_APIFY_TOKEN" }
    }
  }
}
```

***

### Frequently Asked Questions

#### Do I need Chinese residential proxies or Bilibili cookies?

No. The Actor automatically initializes guest WBI signing keys and SPI fingerprint tokens (`buvid3`/`buvid4`) directly from Apify Cloud.

#### What formats are accepted for `videoUrls` and `creatorIds`?

Pass full Bilibili URLs (`https://www.bilibili.com/video/BV...`), bare `BV` IDs, `space.bilibili.com/<uid>` URLs, or numeric UIDs.

#### How is Danmaku priced?

If `includeDanmaku` is `false`, you only pay `$0.002` per item (`$2.00 / 1,000`). When enabled, parsed Danmaku packs add `$0.005` per video.

### Support & Reliability

This Actor is continuously monitored via automated weekly live canary runs. If you need a custom field, higher rate limit, or encounter an upstream change, open an issue in the **Issues** tab on Apify Console for rapid resolution.

***

### More Fast, Zero-Browser APIs by MoeOver

- **Hiring & B2B Buying Intent Suite:** [Global ATS Jobs Search (110k+ Direct Jobs)](https://apify.com/moeover/all-companies-ats-jobs-search) · [Company Hiring Velocity & YC Signals](https://apify.com/moeover/company-hiring-velocity-signals) · [Direct Career Site ATS API](https://apify.com/moeover/career-site-ats-jobs-api)
- **Lead Gen, E-Commerce, Ads & SEO Suite:** [Website Contacts & 40+ Tech Stack API](https://apify.com/moeover/website-contacts-tech-api) · [Shopify Store Products & Price Monitor](https://apify.com/moeover/shopify-store-products-api) · [Google Ads Transparency & Longevity API](https://apify.com/moeover/google-ads-transparency-scraper) · [4-Engine Keyword Autocomplete Pro](https://apify.com/moeover/keyword-autocomplete-pro-api)
- **App Intelligence, Media & AI RAG Suite:** [Apple App Store Reviews & Pain-Point API](https://apify.com/moeover/apple-appstore-reviews-api) · [Google Play Reviews & Pain-Point API](https://apify.com/moeover/google-play-reviews-api) · [Fast Website to Markdown RAG Crawler](https://apify.com/moeover/fast-markdown-rag-crawler) · [Google News Real-Time Intelligence](https://apify.com/moeover/google-news-intelligence-api) · [Bilibili Pro & Danmaku API](https://apify.com/moeover/bilibili-pro-scraper)

# Actor input Schema

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

Choose what to extract: keyword video search, specific video URLs/BVIDs, creator profiles, or live popular/trending charts.

## `keywords` (type: `array`):

List of Chinese or English keywords to search on Bilibili (e.g. 'AI Agent', '黑神话悟空', 'Python').

## `searchOrder` (type: `string`):

How to sort video search results.

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

Accepts full URLs (https://www.bilibili.com/video/BV...) or raw BV IDs (BV1...).

## `creatorIds` (type: `array`):

Accepts numeric Bilibili UIDs (mid) or space URLs (https://space.bilibili.com/946974).

## `includeDanmaku` (type: `boolean`):

When enabled on 'video' or 'search' (with enrichDetails) mode, fetches and parses the video's danmaku XML into structured timestamped bullet comments + top phrases.

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

Maximum parsed danmaku lines stored per video when includeDanmaku is enabled.

## `enrichVideoDetails` (type: `boolean`):

Calls Bilibili's video detail API for each search hit to add exact likes, coins, shares, favorites, and CID.

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

Maximum number of items returned per keyword (search) or total items (popular).

## Actor input object example

```json
{
  "mode": "search",
  "keywords": [
    "AI Agent"
  ],
  "searchOrder": "totalrank",
  "videoUrls": [],
  "creatorIds": [],
  "includeDanmaku": false,
  "maxDanmakuPerVideo": 200,
  "enrichVideoDetails": false,
  "maxItems": 20
}
```

# Actor output Schema

## `items` (type: `string`):

Direct API link to all extracted Bilibili video, danmaku, chart, or creator records.

## `overview` (type: `string`):

Formatted table view of item type, BVID, title, creator, views, likes, coins, danmaku count, and URL.

# 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 = {
    "mode": "search",
    "keywords": [
        "AI Agent"
    ],
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("moeover/bilibili-pro-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 = {
    "mode": "search",
    "keywords": ["AI Agent"],
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("moeover/bilibili-pro-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 '{
  "mode": "search",
  "keywords": [
    "AI Agent"
  ],
  "maxItems": 20
}' |
apify call moeover/bilibili-pro-scraper --silent --output-dataset

```

## MCP server setup

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