# Bilibili Scraper: Videos, Comments, Danmaku & UP主 Creators (`deltaspider/bilibili-scraper`) Actor

Scrape Bilibili (哔哩哔哩, B站) videos, complete UP主 upload lists, comments with replies and danmaku (弹幕), one row each. Bilibili API alternative, no login. JSON, CSV, Excel.

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

## Pricing

Pay per event

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: videos, comments, danmaku and UP主 creators

Scrape [Bilibili](https://www.bilibili.com) (哔哩哔哩, B站), China's largest video community, with no login, no cookies and no browser. Get videos by keyword, link or creator, full creator upload lists, comments with replies, and danmaku (弹幕), one row each. Export to JSON, CSV or Excel, or call it from the API.

### What does Bilibili Scraper do?

- 🔎 **Search videos** by keyword, sorted by relevance, views, date, danmaku or favorites (up to 1,000 per query).
- 🎬 **Video details** from links, `b23.tv` share links, BV ids or av ids: views, likes, coins (投币), favorites (收藏), shares, comments, danmaku.
- 👤 **Creators (UP主)**: profile (followers, likes, level, verification) plus their **complete upload list**, newest first.
- 💬 **Comments and replies** (评论) for every video: comments most popular or newest first, replies oldest first.
- 🌊 **Danmaku (弹幕)**: bullet comments with their exact second in the video, across all parts of multi-part videos. For busy videos Bilibili serves a large sample rather than every danmaku ever sent (9,641 of 23,792 on one measured video).
- 🔥 **Trending**: Bilibili's popular board.

### What data can you get from Bilibili?

| Row             | Fields                                                                                                                                             |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| Video           | title, description, cover, duration, publish date, category, tags, creator, views, likes, coins, favorites, shares, comments, danmaku count, parts |
| Creator         | name, bio, avatar, level, followers, following, video count, total likes, verification                                                             |
| Comment / reply | text, likes, reply count, date, author, author level, images, root and parent comment                                                              |
| Danmaku         | text, second in the video, part, send time, color, mode, font size, anonymous sender hash                                                          |

Search and creator lists leave some stats empty (coins and shares; likes and comment counts for creator lists). Turn on **Fetch full stats** (`fetchVideoDetails`) to fill them in, at no extra charge. Tags come from search results. A value Bilibili does not report is `null`, never 0.

### How to scrape Bilibili

1. Click **Try for free**.
2. Add search keywords, video links or creator ids (or all three), and choose whether you want comments and danmaku.
3. Click **Start**, then download the dataset as JSON, CSV or Excel, or read it through the API.

Tip: search in Chinese. `耐克` finds far more videos than `Nike`.

### Input example

```json
{
  "searchQueries": ["黑神话"],
  "creatorIds": ["https://space.bilibili.com/546195"],
  "videoUrls": ["https://b23.tv/BV1qyNo6TEX3"],
  "maxVideosPerSearch": 100,
  "maxVideosPerCreator": 200,
  "maxCommentsPerVideo": 20,
  "maxRepliesPerComment": 5,
  "maxDanmakuPerVideo": 500
}
```

### Output example

```json
{
  "type": "video",
  "bvid": "BV1qyNo6TEX3",
  "url": "https://www.bilibili.com/video/BV1qyNo6TEX3",
  "title": "躲在超市后门拆炸弹的三人",
  "authorName": "老番茄",
  "views": 5227184,
  "likes": 336882,
  "coins": 120910,
  "favorites": 86242,
  "commentCount": 5013,
  "danmakuCount": 23792,
  "publishedAt": "2026-07-18T03:30:00.000Z"
}
```

```json
{
  "type": "danmaku",
  "videoBvid": "BV1qyNo6TEX3",
  "part": 1,
  "timeSeconds": 12.862,
  "text": "空瓶",
  "sentAt": "2026-07-18T03:30:27.000Z",
  "senderHash": "edb9d388"
}
```

### Use cases

- **Brand and product monitoring** in China's Gen Z community: track videos and comments about your brand, game or launch.
- **Creator (UP主 / KOL) research**: follower growth, full upload history and engagement, for partnerships and sponsorships.
- **Audience reaction analysis**: danmaku show second by second where viewers reacted.
- **NLP and AI training data**: comments and danmaku are a large corpus of informal Chinese.
- **Market and trend research**: what is trending on Bilibili, by category.

### How much does it cost to scrape Bilibili?

Pay per row, no start fee. Paid Apify plans get lower prices.

| Row              | Free plan | Bronze   | Silver    | Gold and up |
| ---------------- | --------- | -------- | --------- | ----------- |
| Video or creator | $0.004    | $0.0035  | $0.003    | $0.0025     |
| Comment or reply | $0.0015   | $0.0012  | $0.001    | $0.0008     |
| Danmaku          | $0.00006  | $0.00005 | $0.000045 | $0.00004    |

The $5 monthly free credit covers about 1,250 videos. 100 videos with 20 comments each cost $3.40 on the free plan. A run stops cleanly at your maximum charge, and you only pay for rows you receive.

### FAQ

**Is there a Bilibili API?** Bilibili has no open API for international developers. This scraper works as a Bilibili API alternative: send a JSON input, get structured data back.

**Do I need a Bilibili account, cookies or a VPN?** No. Everything comes from public pages and endpoints.

**Can I get every video of a creator?** Yes. The full upload list is read directly, however long the channel is (tested on a 679-video channel: all 679).

**What are danmaku?** Danmaku (弹幕, "bullet comments") are viewer comments that scroll across the video, each tied to a second of playback.

**Can I use it from Python or JavaScript?** Yes, with the Apify API clients:

```python
from apify_client import ApifyClient
client = ApifyClient("YOUR_API_TOKEN")
run = client.actor("deltaspider/bilibili-scraper").call(run_input={"searchQueries": ["原神"], "maxVideosPerSearch": 50})
items = client.dataset(run["defaultDatasetId"]).list_items().items
```

**Can I use it with Make, Zapier, n8n, Google Sheets or an AI agent?** Yes, through Apify integrations and the Apify MCP server.

**Is it legal to scrape Bilibili?** The scraper collects only publicly available data. Personal data is protected by laws such as the GDPR and PIPL; use the data lawfully and check with a lawyer if unsure. This independent Actor is not affiliated with Bilibili (哔哩哔哩).

**Something is missing?** Open an issue on the Issues tab.

# Actor input Schema

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

Keywords to search videos for. Chinese keywords usually find far more than English ones (耐克 rather than Nike).

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

Bilibili video links, b23.tv share links, BV ids (BV1qyNo6TEX3) or av ids (av170001).

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

Creator ids (546195), UID:546195, space.bilibili.com/546195 links or b23.tv share links. Each returns a profile row plus the creator's uploads, newest first.

## `maxVideosPerSearch` (type: `integer`):

Bilibili returns at most 1,000 videos per query.

## `searchSort` (type: `string`):

Order of search results.

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

How many of each creator's uploads to list, newest first. Set 0 for profiles only. The full upload list is available, however long.

## `maxTrendingVideos` (type: `integer`):

How many videos to take from Bilibili's popular board. 0 skips it.

## `fetchVideoDetails` (type: `boolean`):

Search and creator lists omit some numbers (coins, shares, and likes for creator lists). This reads each video's detail page to fill them in. No extra charge, but one more request per video, so runs take longer. Video URLs and trending videos always have full stats.

## `maxCommentsPerVideo` (type: `integer`):

Top-level comments to collect for every video in the run. 0 skips comments.

## `commentSort` (type: `string`):

Which comments come first when a video has more than you ask for.

## `maxRepliesPerComment` (type: `integer`):

Replies to collect under each collected comment that has any, oldest first. Replies are comment rows with rootCommentId and parentCommentId set, and do not count toward Comments per video. 0 skips replies.

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

Danmaku (bullet comments) to collect for every video, one row each with its part and second in the video, in playback order. Multi-part videos are read part by part. 0 skips danmaku.

## `proxyConfiguration` (type: `object`):

Bilibili limits requests per IP. Apify Proxy (datacenter) works well.

## Actor input object example

```json
{
  "searchQueries": [
    "黑神话"
  ],
  "maxVideosPerSearch": 50,
  "searchSort": "totalrank",
  "maxVideosPerCreator": 50,
  "maxTrendingVideos": 0,
  "fetchVideoDetails": false,
  "maxCommentsPerVideo": 0,
  "commentSort": "hot",
  "maxRepliesPerComment": 0,
  "maxDanmakuPerVideo": 0,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `results` (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": [
        "黑神话"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("deltaspider/bilibili-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": ["黑神话"],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("deltaspider/bilibili-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": [
    "黑神话"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call deltaspider/bilibili-scraper --silent --output-dataset

```

## MCP server setup

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