# Bilibili Scraper: Videos, Comments, Danmaku, Search & Live (`openclawai/bilibili-scraper`) Actor

Scrape Bilibili (哔哩哔哩): user videos, video details, profiles, comments + replies, danmaku (on-screen comments), uploader subtitles, keyword search, popular videos, hot search and live rooms. No login or cookies. Pay only per result.

- **URL**: https://apify.com/openclawai/bilibili-scraper.md
- **Developed by:** [Pika Choo](https://apify.com/openclawai) (community)
- **Categories:** Social media, Videos, AI
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $2.50 / 1,000 bilibili videos

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

## 📺 Bilibili Scraper: Videos, Comments, Danmaku, Search & Live

Scrape Bilibili (哔哩哔哩) without login: uploader videos, comments with replies, danmaku with timestamps, search, popular and live rooms. **$2.50 per 1,000 videos.**

### 📋 Table of contents

- [What does it do?](#what-does-it-do)
- [Features](#features)
- [Pricing](#pricing)
- [Input](#input)
- [Output](#output)
- [Troubleshooting](#troubleshooting)
- [Who uses this Bilibili Scraper?](#who-uses-this-bilibili-scraper)
- [Use cases](#use-cases)
- [FAQ](#faq)
- [API, Python, JavaScript and MCP](#api-python-javascript-and-mcp)

### What does it do?

Bilibili Scraper collects public data from Bilibili, China's biggest video community for games, anime, tech and education. Give it video links, BV ids, space links or keywords and it returns videos with stats, uploader profiles, comment threads, danmaku (on-screen bullet comments) with the second they appear, search results, the popular feed, the hot-search list and live rooms. No account, cookies or proxy.

### Features

#### 🎬 What you can scrape on Bilibili

| Mode | What you give it | What you get |
|---|---|---|
| `user_posts` | profile link / user ID | User posts — all videos from a profile |
| `video_detail` | video or post link | Video details — one video per link |
| `user_profile` | profile link / user ID | User profile — bio, followers, likes |
| `video_comments` | video or post link | Video comments (+ replies) |
| `search_videos` | keywords | Search videos (keywords) |
| `trending` | nothing (pick a category) | Trending videos |
| `hot_search` | nothing | Hot search terms |
| `live_info` | profile or live room link | Live room info |
| `danmaku` | video link or BV id | Bilibili danmaku (on-screen comments) |
| `subtitles` | video link or BV id | Bilibili subtitles (full text) |

#### ✨ Smart features

- Danmaku with the second each line appears (`raw.time_sec`)
- Replies are placed right under their comment (comments with 3+ replies)
- `b23.tv` short links are resolved for you
- Uploader subtitles when the uploader added them
- Popular feed and hot-search list in one call
- Duplicates are removed automatically
- 🔓 No login, no cookies, no proxy setup
- 💸 Pay only for results: hint and error rows are free

#### 🧭 More scrapers from us

- [TikTok, Douyin & Bilibili Scraper (all platforms in one run)](https://apify.com/openclawai/tiktok-douyin-bilibili-scraper)
- [Douyin Scraper (抖音)](https://apify.com/openclawai/douyin-scraper)
- [Kuaishou Scraper (快手)](https://apify.com/openclawai/kuaishou-scraper)
- [TikTok Scraper](https://apify.com/openclawai/tiktok-scraper)

### Pricing

You pay per result. No compute or proxy charges on top, and hint and error rows are free.

| What you get | Price per 1,000 |
|---|---|
| 📺 Bilibili videos (any mode) | **$2.50** |
| 💬 Comments, replies and danmaku lines | **$0.50** |
| 🔍 Profiles and live rooms | **$1.50** |
| 📈 Hot-search terms | **$1.00** |
| 📝 Subtitle track (per video) | **$3.00** |

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

| Job | Cost |
|---|---|
| 1,000 Bilibili videos | $2.50 |
| 10,000 Bilibili videos | $25 |
| 10,000 danmaku lines | $5.00 |
| 100,000 comments | $50 |

Set **Max cost per run** in the run options and the actor stops cleanly at that amount.

#### 🆓 Free plan

On the free Apify plan each run returns up to 10 results, so you can check the data before you buy. Comment replies need a paid plan. Any paid Apify plan removes the limit.

#### ⚡ Speed

List modes return a page of rows per request; a video's full danmaku track usually comes back in seconds.

### Input

| Field | What it does |
|---|---|
| `mode` | Links, @usernames or IDs: user_posts, video_detail, user_profile, video_comments, live_info, danmaku, subtitles. Keywords: search_videos. No input: trending, hot_search. |
| `urls` | One per line: video links or BV ids, space.bilibili.com profile links or UIDs, live room links. b23.tv short links work too. |
| `queries` | Keywords for video search, one per line. Chinese keywords give the best results. |
| `maxItems` | Stop after this many rows per link or keyword (comments include their replies). |
| `includeReplies` | In video_comments mode, also fetch the replies under each comment that has 3 or more replies (TikTok, Douyin, Bilibili). Replies are billed as comments. Paid Apify plans only. |
| `downloadVideos` | Add the direct video file URL to each video row when the platform provides one. |

#### 🧪 Example inputs

**All danmaku from a video**

```json
{"mode": "danmaku", "urls": ["https://www.bilibili.com/video/BV1M1421t7hT"], "maxItems": 5000}
```

**Comments with replies**

```json
{"mode": "video_comments", "urls": ["BV1M1421t7hT"], "maxItems": 500, "includeReplies": true}
```

**An uploader's latest videos**

```json
{"mode": "user_posts", "urls": ["https://space.bilibili.com/178360345"], "maxItems": 100}
```

**Search videos**

```json
{"mode": "search_videos", "queries": ["原神", "机械键盘"], "maxItems": 200}
```

### Output

Every row uses the same fields. Export as JSON, CSV, Excel, XML or HTML.

#### 📦 Example output

```json
{
  "platform": "bilibili",
  "item_type": "video",
  "item_id": "BV1M1421t7hT",
  "url": "https://www.bilibili.com/video/BV1M1421t7hT",
  "title": "陈翔六点半：恶语伤人六月寒",
  "description": "陈翔六点半：恶语伤人六月寒",
  "author_id": "19286458",
  "author_name": "陈翔六点半",
  "duration_sec": 353.0,
  "cover_url": "http://i2.hdslb.com/bfs/archive/149821b536849b6ad802a8a5e1c4576681090f…",
  "created_at": "2024-08-11T10:40:00+00:00",
  "play_count": 2924458,
  "like_count": 71730,
  "comment_count": 2258,
  "share_count": 995,
  "collect_count": 14543,
  "mode": "video_detail",
  "source_input": "BV1M1421t7hT",
  "scraped_at": "2026-10-08T19:59:26.999963+00:00",
  "raw": {
    "…": "full original record"
  }
}
```

#### 📤 Main fields

| Field | Description |
|---|---|
| `platform`, `item_type`, `mode`, `source_input` | Where the row came from and what it is (`video`, `user`, `comment`, `hint`, `error`…) |
| `item_id`, `url` | Native ID and a link back to the item |
| `title`, `description`, `hashtags`, `created_at` | Text and publish time (ISO 8601) |
| `author_id`, `author_name`, `author_username` | Creator or account |
| `play_count`, `like_count`, `comment_count`, `share_count`, `collect_count` | Engagement counts |
| `raw` | The full original record, every field the platform returned |
| `error_message` | Explanation on free `hint` / `error` rows |

### Troubleshooting

#### A video has no subtitles?

Only uploader-added subtitles are available. Bilibili's AI captions need a login and aren't included. You get a free `hint` row and no charge.

#### Getting no results?

Check that the link or username is public and typed correctly. Private accounts, deleted posts and hidden lists return a free `hint` row that says why. Keyword modes need the **Keywords** field, link modes need **Links**.

#### Getting fewer results than `maxItems`?

The platform ran out of items for that input (a small profile, a niche keyword), or the run reached its **Max cost per run** limit. The log says which one.

#### Some fields are empty?

Platforms don't return every field for every item. Everything the platform did return is kept in `raw`.

#### Video or image links stopped working?

Media URLs from these platforms expire after a few hours. Download files right after the run.

#### The run failed or shows an error row?

Retry once: the platforms sometimes refuse a request for a few minutes. If it keeps failing, open an issue with the run link and we'll fix it fast.

### Who uses this Bilibili Scraper?

#### 🎮 Game and anime studios

Track reactions to trailers and releases through comments and danmaku.

#### 📊 Market researchers

Measure sentiment on brands, games and tech products.

#### 🧑‍🤝‍🧑 KOL agencies

Pull uploader profiles and engagement.

#### 🎓 Researchers

Study online culture through danmaku and comment threads.

#### 🤖 AI and data teams

Collect Chinese comments and danmaku as training data.

#### 🧑‍💻 Developers and AI agents

Bring Bilibili data into apps through the API or MCP.

### Use cases

#### Reaction timelines

Plot danmaku by `time_sec` to see the exact moments viewers react to.

#### Launch monitoring

Pull comments on a trailer every hour after release.

#### Creator research

Pull uploader videos and stats to rank creators in a niche.

### FAQ

#### Can I scrape Bilibili without an account?

Yes. No Bilibili login, cookies or API keys.

#### What is danmaku?

On-screen bullet comments that fly across the video at a specific second. This actor returns each line with its timestamp.

#### Does Bilibili have an official API?

Bilibili's open platform only covers creators' own accounts and needs approval. This actor needs nothing.

#### Can I scrape Bilibili comments and replies?

Yes, with `video_comments` and **Include comment replies** on.

#### How much does it cost to scrape 10,000 danmaku lines?

About $5, at $0.50 per 1,000 lines.

#### Can I get Bilibili subtitles?

Yes, when the uploader added them. AI captions need a login and aren't included.

#### Do I need a Chinese proxy?

No.

#### Can I search Bilibili in Chinese?

Yes, and it gives the best results.

#### Is there a free tier?

Yes. On the free Apify plan each run returns up to 10 results. Subtitles need a paid plan.

#### Can I use it from Python, JavaScript or an AI agent?

Yes, through the Apify API, the client libraries, or MCP.

### API, Python, JavaScript and MCP

**Python**

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("openclawai/bilibili-scraper").call(run_input={"mode": "danmaku", "urls": ["https://www.bilibili.com/video/BV1M1421t7hT"], "maxItems": 5000})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

**JavaScript**

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

const client = new ApifyClient({ token: "YOUR_APIFY_TOKEN" });
const run = await client.actor("openclawai/bilibili-scraper").call({"mode": "danmaku", "urls": ["https://www.bilibili.com/video/BV1M1421t7hT"], "maxItems": 5000});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

**MCP** (Claude, ChatGPT, Cursor and other MCP clients): `https://mcp.apify.com/?tools=openclawai/bilibili-scraper`

Works with Zapier, Make, n8n, Google Sheets, Slack, webhooks and scheduled runs.

### 🛡️ Legal

Collects **public** data only. You are responsible for complying with Bilibili's terms and with privacy laws such as GDPR, CCPA and PIPL when you store personal data.

### ⭐ Support

Something not working? Check the `hint` / `error` rows, then open an issue with the run link. We reply fast.

# Actor input Schema

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

Links, @usernames or IDs: user_posts, video_detail, user_profile, video_comments, live_info, danmaku, subtitles. Keywords: search_videos. No input: trending, hot_search.

## `urls` (type: `array`):

One per line: video links or BV ids, space.bilibili.com profile links or UIDs, live room links. b23.tv short links work too.

## `queries` (type: `array`):

Keywords for video search, one per line. Chinese keywords give the best results.

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

Stop after this many rows per link or keyword (comments include their replies).

## `includeReplies` (type: `boolean`):

In video_comments mode, also fetch the replies under each comment that has 3 or more replies (TikTok, Douyin, Bilibili). Replies are billed as comments. Paid Apify plans only.

## `downloadVideos` (type: `boolean`):

Add the direct video file URL to each video row when the platform provides one.

## Actor input object example

```json
{
  "mode": "user_posts",
  "urls": [
    "https://space.bilibili.com/178360345"
  ],
  "maxItems": 20,
  "includeReplies": false,
  "downloadVideos": 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 = {
    "mode": "user_posts",
    "urls": [
        "https://space.bilibili.com/178360345"
    ],
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("openclawai/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 = {
    "mode": "user_posts",
    "urls": ["https://space.bilibili.com/178360345"],
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("openclawai/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 '{
  "mode": "user_posts",
  "urls": [
    "https://space.bilibili.com/178360345"
  ],
  "maxItems": 20
}' |
apify call openclawai/bilibili-scraper --silent --output-dataset

```

## MCP server setup

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