# Bilibili Scraper (B站 / 哔哩哔哩) (`bossless/bilibili-scraper`) Actor

Scrape Bilibili (B站 / 哔哩哔哩) without login or cookies: search videos by keyword, video stats (views, likes, coins, favorites, shares), tags, top comments, danmaku bullet comments, trending and top-100 lists, and creator (UP主) profiles with latest uploads. Pay per result.

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

## Pricing

from $3.00 / 1,000 video or creator profiles

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 (B站 / 哔哩哔哩)

**Bilibili Scraper extracts public data from Bilibili without a login, cookies or a Chinese phone number.** Search videos by keyword, scrape video URLs, the trending and top-100 lists, and creator pages. Get views, likes, coins, favorites, shares, tags, top comments and **danmaku** (弹幕, the on-screen bullet comments) as clean JSON, CSV or Excel, or through the Apify API.

Use it for market research on Chinese audiences, influencer (UP主) discovery, trend tracking, brand monitoring, and AI/LLM pipelines that need Chinese video data.

### What data can you scrape from Bilibili?

| Source | Input | Output |
|---|---|---|
| 🔍 Keyword search | `searchQueries`, in Chinese or English | Up to 1,000 videos per keyword, sorted by relevance, views, newest, danmaku or favorites |
| 🎬 Video URLs | `videoUrls`: `https://www.bilibili.com/video/BV...` or a bare BV id | Full stats for each video |
| 🔥 Trending | `trending`: `popular` or `ranking` | The live hot list or the all-categories top-100 leaderboard |
| 👤 Creators (UP主) | `creatorUrls`: `https://space.bilibili.com/<id>` or the numeric id | Profile with follower counts, plus the creator's latest uploads |
| 💬 Danmaku | `includeDanmaku: true` | Every bullet comment of each video, with video timestamp, colour and send time |
| ⭐ Top comments | `includeTopComments: true` | The top comments of each video |

Results go into three datasets, so each one is a clean table:

- **Videos**: the run's default dataset, one row per video.
- **Creators**: the dataset named `creators`.
- **Danmaku**: the dataset named `danmaku`.

### How to scrape Bilibili

1. Click **Try for free**.
2. Enter search keywords, video URLs or creator URLs, or pick a trending list.
3. Turn on danmaku, top comments or full details if you need them.
4. Click **Start**, then download the results as JSON, CSV, Excel or HTML, or read them through the API.

#### Input example

```json
{
  "searchQueries": ["原神", "iphone 17"],
  "maxResultsPerQuery": 200,
  "searchSort": "views",
  "includeDanmaku": true,
  "maxDanmakuPerVideo": 300
}
```

### Output examples

#### Video

```json
{
  "type": "video",
  "bvid": "BV12Kpxz9Eyb",
  "url": "https://www.bilibili.com/video/BV12Kpxz9Eyb",
  "title": "「小白」iPhone17全面测评：你想看的都在这了！",
  "durationSeconds": 1188,
  "publishedAt": "2025-09-17T12:00:00Z",
  "category": "数码",
  "tags": ["数码", "iPhone17", "苹果手机", "A19芯片"],
  "authorId": 8969156,
  "authorName": "小白测评",
  "views": 2106686,
  "likes": 53264,
  "coins": 27050,
  "favorites": 11884,
  "shares": 8159,
  "comments": 5844,
  "danmakuCount": 12126,
  "topComments": [{ "author": "椿巛", "text": "一时错乱了[笑哭]", "likes": 891, "replies": 8 }],
  "source": "search:iphone 17"
}
```

#### Creator

```json
{
  "type": "user",
  "userId": 946974,
  "url": "https://space.bilibili.com/946974",
  "name": "影视飓风",
  "level": 6,
  "verifiedTitle": "2025百大UP主",
  "followers": 18638025,
  "following": 686
}
```

#### Danmaku

```json
{
  "type": "danmaku",
  "bvid": "BV12Kpxz9Eyb",
  "text": "来了来了",
  "videoTimeSeconds": 12.5,
  "mode": "scroll",
  "color": "#ffffff",
  "sentAt": "2025-09-19T02:48:24Z"
}
```

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

You pay only for results, with no subscription:

| Event | Price | Example |
|---|---|---|
| Video or creator profile | **$4 per 1,000** ($3.50 Silver, $3 Gold) | 1,000 videos from a keyword search = $4 |
| Danmaku line | **$0.30 per 1,000** ($0.25 Silver, $0.20 Gold) | A typical video has ~180 danmaku, so about $0.05 per video |
| Run start | $0.00005 per run | |
| AI danmaku digest (optional) | **$0.03 per video** ($0.025 Silver, $0.02 Gold) | Only when 'AI danmaku digest' is on |
| AI tags (optional) | **$2 per 1,000** ($1.80 Silver, $1.50 Gold) | Only when 'AI tags' is on |

Set a **maximum cost per run** and the scraper stops cleanly when it is reached. Apify's free plan includes monthly credit, enough to try about 1,000 videos.

### AI insights: danmaku digest and AI tags (optional)

Turn these on when you want the meaning, not just the data. Both are off by default and cost nothing unless enabled.

- **AI danmaku digest** (`danmakuDigest`): for each video, the busiest moments with exact timestamps and comment counts, what viewers react to at each one, overall sentiment, memes and slang explained in English, and the main themes. It reads all of the video's danmaku, so you don't need to download them.
- **AI tags** (`aiEnrichment`): sentiment and score, topic labels, named entities and a one-sentence English summary for every video.

The timestamps and counts are computed exactly from the danmaku; the AI only labels them, so it can't invent numbers. Free-plan runs include a 3-item AI trial; the rest of the results are saved without AI fields.

Real output (14 October 2026, a 44-minute history video; 7,200 danmaku analysed):

```json
{
 "type": "video",
 "bvid": "BV1Cgpd6pEBR",
 "title": "苏联版“空中监狱”是什么？【神奇组织55】",
 "danmakuDigest": {
  "summaryEn": "Viewers were highly enthusiastic and humorous, frequently using memes to react to the creator's storytelling style and the absurd historical events described. The audience engaged in a playful, mock-loyal tone, often laughing at the chaotic and ironic nature of the Soviet-era incidents presented.",
  "sentiment": "positive",
  "sentimentScore": 0.8,
  "hotMoments": [
   {
    "timeSec": 0,
    "count": 364,
    "labelEn": "Enthusiastic welcome and mock loyalty"
   },
   {
    "timeSec": 10,
    "count": 113,
    "labelEn": "Viewers celebrating the start of the video"
   },
   {
    "timeSec": 620,
    "count": 107,
    "labelEn": "Jokes about the durability of Soviet vehicle pedals"
   }
  ],
  "memes": [
   {
    "text": "忠诚",
    "meaningEn": "Loyalty; a meme used to show mock devotion to the creator."
   },
   {
    "text": "开饭",
    "meaningEn": "Dinner is served; used when a new video is uploaded."
   },
   {
    "text": "懂你意思",
    "meaningEn": "I get what you mean; used to acknowledge implied jokes or sensitive topics."
   }
  ],
  "themes": [
   "Soviet History",
   "True Crime",
   "Humor",
   "Mechanical Failures",
   "Geopolitical Irony"
  ],
  "danmakuAnalysed": 7200
 },
 "ai": {
  "sentiment": "neutral",
  "sentimentScore": 0,
  "topics": [
   "History",
   "Aviation",
   "Crime",
   "Soviet Union"
  ],
  "entities": [
   "苏联"
  ],
  "summaryEn": "This video content explores the 1990 Far East hijacking case in the Soviet Union, often referred to as the Soviet version of 'Con Air'."
 }
}
```

### How fast is it?

- **Search only:** about 1,000 videos in 3 minutes.
- **Full details, top comments or danmaku:** about 5 seconds per video, because each extra is a separate request.

If a run gets close to its timeout, the scraper stops early and keeps everything it has already scraped. Raise the run timeout in **Run options** for big jobs.

### Use Bilibili Scraper with AI agents (MCP)

Connect Claude, Cursor, ChatGPT or any MCP client to the [Apify MCP server](https://mcp.apify.com) with this actor as a tool:

```
https://mcp.apify.com?tools=bossless/bilibili-scraper
```

The agent can then answer requests like *"find the most viewed Bilibili videos about 原神 this month"* or *"get the danmaku of this Bilibili video"*. Keep agent runs small (for example `maxResultsPerQuery: 20`) so they finish in seconds. Videos are in the run's default dataset; creators and danmaku are in the datasets named `creators` and `danmaku`.

### Use it through the API

Run the scraper and get the videos in one call:

```bash
curl -X POST "https://api.apify.com/v2/acts/bossless~bilibili-scraper/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"searchQueries": ["minecraft"], "maxResultsPerQuery": 20}'
```

Python:

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("bossless/bilibili-scraper").call(run_input={"searchQueries": ["minecraft"], "maxResultsPerQuery": 20})
for video in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(video["title"], video["views"])
```

It also works with Make, n8n, Zapier, LangChain and other Apify integrations.

### Good to know

- **No login needed.** The scraper uses Bilibili's public guest access through rotating residential IPs, and retries automatically when Bilibili rate-limits a request.
- **Search fields.** Search results don't include coins, shares or the video part id. Turn on **Fetch full details** to add them. Videos from URLs, creators and trending always include full stats.
- **Comments.** Bilibili shows logged-out visitors only the top 3 comments of a video, so `topComments` has at most 3 entries.
- **Creator uploads.** Bilibili shows logged-out visitors only a creator's most recent posts, so you get roughly their last 10 uploads. For more videos from a creator, search for their name.
- **Search depth.** Bilibili serves at most 1,000 results (50 pages) per keyword. Use several keywords or sort orders for wider coverage.

### FAQ

**Is there an official Bilibili API?**
Bilibili's own APIs are either internal or require a registered developer account. This scraper gives you the public data as structured JSON, without any account.

**Can I scrape Bilibili comments?**
Yes, the top comments of every video (up to 3, because Bilibili limits logged-out visitors), plus the full danmaku stream, which is usually far richer than the comments.

**Do I need proxies or cookies?**
No. Proxies are built in and no cookies are needed.

**Can I download Bilibili danmaku (弹幕)?**
Yes. Turn on **Include danmaku** and up to `maxDanmakuPerVideo` bullet comments per video (default 500) are saved to the `danmaku` dataset, each with its video time offset, display mode, color and send time, at $0.30 per 1,000 lines (less on paid plans).

**Is it legal to scrape Bilibili?**
This scraper collects only publicly visible data and doesn't log in. It doesn't collect the user ids of danmaku senders. Make sure your use complies with Bilibili's terms, copyright law and data-protection rules such as China's PIPL and the EU's GDPR, especially if you process personal data such as creator names.

**Is this an official Bilibili product?**
No. This is an independent tool and is not affiliated with or endorsed by Bilibili.

### Ready-made Bilibili tasks

One-click presets for common jobs. Open one, change the input if you like, and run it:

- [Bilibili Danmaku AI Digest (弹幕分析) in English](https://apify.com/bossless/bilibili-scraper/examples/bilibili-danmaku-ai-digest): hot moments, sentiment and memes explained, from all of a video's danmaku.
- [Bilibili Danmaku (弹幕) Downloader](https://apify.com/bossless/bilibili-scraper/examples/bilibili-danmaku-downloader): bullet comments of any video with timestamps.
- [Bilibili Top 100 Ranking (排行榜) Scraper](https://apify.com/bossless/bilibili-scraper/examples/bilibili-ranking): the all-categories leaderboard, ready to schedule daily.
- [Bilibili Trending & Popular Videos (热门)](https://apify.com/bossless/bilibili-scraper/examples/bilibili-trending-videos): the live popular list with full stats.
- [Bilibili Video Search by Keyword](https://apify.com/bossless/bilibili-scraper/examples/bilibili-video-search): search results with views, likes and danmaku counts.
- [Bilibili Creator (UP主) Profiles & Latest Uploads](https://apify.com/bossless/bilibili-scraper/examples/bilibili-creator-profiles): followers, verification and recent videos.

### More China data scrapers

- [Weibo Scraper (微博 / Sina Weibo)](https://apify.com/bossless/weibo-scraper) — Weibo hot search (微博热搜), user profiles, post search and timelines.
- [Zhihu Scraper (知乎)](https://apify.com/bossless/zhihu-scraper) — Zhihu hot list (知乎热榜), hot searches, column articles with full text, answers and search.
- [Chinese Video Transcriber](https://apify.com/bossless/chinese-video-transcriber) — Bilibili videos to text, English subtitles and SRT with AI.
- [China Hot Search in English](https://apify.com/bossless/china-hot-search) — Weibo, Douyin, Baidu, Zhihu and Bilibili trending topics with English summaries.

### 中文简介（B站爬虫 / 哔哩哔哩 API / 弹幕下载）

**Bilibili Scraper（B站数据采集）**：无需登录、无需 Cookie，即可采集 B站公开数据，包括关键词搜索视频、视频详情（播放、点赞、投币、收藏、分享）、标签、热门评论、弹幕、热门榜与排行榜，以及 UP主 资料和最新投稿。按结果计费，可导出 JSON、CSV、Excel，或通过 API 调用。

# Actor input Schema

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

Keywords to search Bilibili videos for, in Chinese or English (e.g. 原神, minecraft). Each keyword returns up to 1,000 videos.

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

Stop each keyword after this many videos. Bilibili serves at most 1,000 per keyword.

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

Order of the search results.

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

Bilibili video links (https://www.bilibili.com/video/BV...) or bare BV ids. Each returns full stats.

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

Creator pages (https://space.bilibili.com/123456) or numeric user ids. Returns the creator profile with follower counts.

## `includeLatestUploads` (type: `boolean`):

Also return each creator's most recent videos (roughly the last 10 posts; Bilibili hides older ones from logged-out visitors).

## `trending` (type: `string`):

Also scrape Bilibili's trending lists. 'Popular now' is the live hot list; 'Top 100 ranking' is the all-categories leaderboard.

## `maxTrendingResults` (type: `integer`):

Maximum number of trending videos to return.

## `fetchFullDetails` (type: `boolean`):

Search results lack coins, shares and some tags. Turn on to fetch them (one extra request per video, slower). Video URLs, creators and trending always include full stats.

## `includeTopComments` (type: `boolean`):

Attach the top comments to each video. Bilibili shows logged-out visitors at most 3 comments per video.

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

Return the on-screen danmaku comments of each video as separate items (type 'danmaku'), sorted by video time.

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

Maximum danmaku lines returned per video.

## `danmakuDigest` (type: `boolean`):

Adds a `danmakuDigest` to each video: when viewers reacted most (exact timestamps and counts), what they reacted to, overall sentiment, memes and slang explained in English, and themes. Reads all the video's danmaku (you don't need 'Include danmaku'). Charged once per digested video; skipped for videos with fewer than 20 danmaku. Free-plan runs include a 3-item AI trial.

## `aiEnrichment` (type: `boolean`):

Adds an `ai` field to each video: sentiment and score, topic labels, named entities and a one-sentence English summary, read from the title, description and tags. Charged once per tagged video. Free-plan runs include a 3-item AI trial.

## Actor input object example

```json
{
  "searchQueries": [
    "minecraft"
  ],
  "maxResultsPerQuery": 20,
  "searchSort": "relevance",
  "videoUrls": [],
  "creatorUrls": [],
  "includeLatestUploads": true,
  "trending": "none",
  "maxTrendingResults": 100,
  "fetchFullDetails": false,
  "includeTopComments": false,
  "includeDanmaku": false,
  "maxDanmakuPerVideo": 500,
  "danmakuDigest": false,
  "aiEnrichment": false
}
```

# Actor output Schema

## `videos` (type: `string`):

No description

## `creators` (type: `string`):

No description

## `danmaku` (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": [
        "minecraft"
    ],
    "maxResultsPerQuery": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("bossless/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": ["minecraft"],
    "maxResultsPerQuery": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("bossless/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": [
    "minecraft"
  ],
  "maxResultsPerQuery": 20
}' |
apify call bossless/bilibili-scraper --silent --output-dataset

```

## MCP server setup

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