# Bilibili Scraper Pro (B站) (`stone_jadex/bilibili-scraper-pro`) Actor

- **URL**: https://apify.com/stone_jadex/bilibili-scraper-pro.md
- **Developed by:** [Stone Jade](https://apify.com/stone_jadex) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 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 Pro — B站 videos, creators, trending, comments & danmaku API

**Bilibili Scraper Pro** extracts public data from **Bilibili (哔哩哔哩 / B站)**, China's largest youth video and anime community, into clean JSON / CSV / Excel with **consistent English field names**, ISO‑8601 timestamps, full URLs and numeric stats. No login and no account or cookies to supply (the Actor uses an anonymous guest identifier internally, like a logged‑out visitor), no browser — fast and cheap.

### ✨ What you can scrape

| Source | Input | Output |
|---|---|---|
| 🔎 Keyword search | `searchKeywords` | Videos ranked by relevance / views / date / danmaku / favorites |
| 🎬 Videos | `videoUrls` (URL, BV id, av id) | Full video record incl. multi‑part (P) pages, coins, shares, subtitles flag |
| 📺 Creator uploads | `userIds` | Latest uploads with full stats |
| 👤 Creator profiles | `profileUserIds` | Followers, following, likes, video count, level, bio, verification (total views when public) |
| 🔥 Popular / trending | `includePopular` | 综合热门 board with recommendation reason |
| 🏆 Ranking boards | `rankingCategoryIds` (0 = all) | 排行榜 by category |
| 📅 Weekly must‑watch | `includeWeeklyMustWatch` | Latest 每周必看 issue |
| 🏷️ Tags & related | `includeTags`, `includeRelated` | Video tags; related videos embedded |
| 💬 Comments | `includeComments` | Top comments + their reply threads (see limits) |
| 🎞️ Danmaku (弹幕) | `danmakuMode` = `raw` / `summary` / `both` | Raw bullet comments, or a cheap per‑video summary: top terms, per‑minute density timeline, peak minute |

Every video row embeds **uploader info** (`uploader.uid`, `name`, `avatarUrl`, `profileUrl`) and a `stats` object (`views`, `likes`, `coins`, `favorites`, `shares`, `comments`, `danmaku`).

### 🧑‍💼 Use cases

- Market & trend research on Chinese youth culture, gaming, anime, tech
- Influencer (UP主) discovery and benchmarking — followers, engagement, upload cadence
- Brand monitoring and campaign tracking on Chinese social media
- Audience reaction analysis with danmaku density timelines (which moment went viral)
- Datasets for NLP / LLM research on Chinese user-generated text

### ⌨️ Input example

```json
{
  "searchKeywords": ["原神", "AI"],
  "profileUserIds": ["546195"],
  "includePopular": true,
  "maxVideosPerSource": 50,
  "includeTags": true,
  "includeComments": true,
  "maxCommentsPerVideo": 100,
  "danmakuMode": "summary"
}
```

#### Key limits (defaults)

| Parameter | Default | Range | Notes |
|---|---|---|---|
| `maxVideosPerSource` | 5 | 1–1000 | per keyword / creator / board; small default keeps rate‑limited runs under ~3 min |
| `maxCommentsPerVideo` | 20 | 1–10000 | includes replies |
| `maxDanmakuPerVideo` | 500 | 1–10000 | raw mode only |
Invalid inputs (unrecognised URLs, nothing to scrape, out‑of‑range limits) fail fast with a clear message and no charge for results.

### 📤 Output examples

Video (abridged, from a test run):

```json
{"type":"video","source":"uploads:546195","rank":1,"bvid":"BV1iqpt6cEMU","url":"https://www.bilibili.com/video/BV1iqpt6cEMU",
 "title":"超市里……未检测到人脸……","durationSeconds":2893,"publishedAt":"2026-10-10T06:30:00.000Z",
 "uploader":{"uid":546195,"name":"老番茄","profileUrl":"https://space.bilibili.com/546195"},
 "stats":{"views":2390666,"likes":205324,"coins":73686,"favorites":70730,"shares":4899,"comments":1795,"danmaku":10417}}
```

Danmaku summary: `{"type":"danmaku-summary","bvid":"BV1iqpt6cEMU","total":7200,"perMinuteAvg":146.94,"peakMinute":0,"peakCount":529,"topTerms":[{"term":"哈哈哈哈","count":567},…],"timeline":[{"minute":0,"count":529},…]}`

Creator profile (from a test run): `{"type":"profile","uid":546195,"name":"老番茄","followers":20841233,"following":6,"likes":196033828,"videoCount":681,"level":6,"verification":{"type":0,"isVerified":true,"title":"2025百大UP主、…"},"totalVideoViews":null}` — `totalVideoViews` is often unavailable without login.

The dataset has ready‑made **views**: Videos, Creator profiles, Comments, Danmaku. A run summary (counts, requests, rate‑limit hits, errors, final status) is saved to the key‑value store as **`OUTPUT`**.

### ⚠️ Honest limitations

- **Comments:** without login Bilibili returns only **~3 top‑level (hot) comments per video**. The Actor paginates the full reply threads under those comments, so you typically get tens to a few thousand comments per popular video — **not the complete comment section**.
- **Danmaku:** the public pool is capped by Bilibili (roughly the most recent 1,000–8,000 per video part), so totals may be lower than the on‑video counter.
- **AI summary** is experimental and was not returned to anonymous requests in our tests.
- Unavailable videos (deleted / private / region‑restricted) are output as a basic row with `detailLevel: "minimal"` and `available: false`, and that video row is **not charged**. Comments, raw danmaku and danmaku summaries scraped for such a video are still public data and are charged normally.
- Bilibili rate‑limits aggressively (HTTP 412 / code ‑352). The Actor uses WBI signing, a global polite throttle (one request at a time), bounded retries with backoff, an overall deadline, and always saves partial results. A **built-in proxy fallback** is included in the price: requests go direct, and only after a 412 the Actor switches to Apify datacenter proxy, then residential proxy (capped per run; danmaku files never use residential). You can also supply your own proxy.

### 💰 Pricing (pay per event)

| Event name | What it is | Price | Per 1,000 |
|---|---|---|---|
| `video` | one video row | $0.003 | $3.00 |
| `profile` | one creator profile row | $0.003 | $3.00 |
| `comment` | one comment or reply row | $0.0007 | $0.70 |
| `danmaku` | one raw danmaku row | $0.0002 | $0.20 |
| `danmaku-summary` | one per‑video danmaku summary | $0.005 | $5.00 |

**What is not charged**

- Invalid input (the run fails immediately with a clear message).
- The video row of an unavailable video (deleted / private / region‑restricted; `detailLevel: "minimal"`, `available: false`). Only that video row is free — comments, raw danmaku and a danmaku summary collected for it are charged as usual.
- Danmaku summaries for videos with no public danmaku (`total: 0`).
- Duplicates (each video/comment/danmaku is output once per run).
- Proxy usage — the built‑in fallback is included in the event prices.

No start fee. Set **Max total charge** on a run to cap spend; the Actor stops gracefully when it is reached.

### 🆚 Why this Actor

| | Bilibili Scraper Pro | Typical alternatives |
|---|---|---|
| Sources | search, videos, creator uploads, creator profiles, popular, ranking boards, weekly must‑watch | usually a subset |
| Danmaku | raw rows **and** a cheap per‑video summary (top terms, density timeline) | raw rows or none |
| Tags, related videos, multi‑P pages | ✅ | often missing |
| Comment author privacy | none / hashed / public | usually always public |
| Rate‑limit handling | built‑in proxy fallback, included in price | often bring‑your‑own proxy |
| Failed / unavailable items | not charged | varies |

### ❓ FAQ

**Do I need a Bilibili account or cookies?** No. You don't supply any login or cookies; the Actor obtains an anonymous guest identifier (the same kind a logged‑out browser gets) and accesses only public data.
**Why did I get fewer comments than the video shows?** See limitations — anonymous access exposes only the hot comments and their replies.
**How are comment authors handled?** By default no author fields are output. `hashed` gives a pseudonymous id (HMAC with a random per‑run key: stable within one run, not reversible, not linkable across runs) plus author level; region is never output in `hashed` mode; `public` outputs public nickname/UID.
**Do I need to configure a proxy?** No. The built-in fallback (datacenter → residential) kicks in only when Bilibili rate-limits and is included in the event price. Supplying your own proxy disables it.
**Can I scrape thousands of videos?** Yes; search/uploads/popular are ~20–30 videos per request. Enrichment options (details, tags, related) add requests per video and slow things down.
**Is it legal? / Disclaimer:** This Actor only accesses publicly available data without logging in. You, the user, are solely responsible for how you use it, including compliance with Bilibili's Terms of Service, copyright in videos, comments and danmaku (user‑generated content), and privacy / data‑protection laws such as China's PIPL and the EU GDPR. Do not use the data to republish others' content or to profile individuals without a lawful basis. If in doubt, consult a lawyer.

### 🇨🇳 中文说明

**Bilibili Scraper Pro** 用于抓取 B站公开数据：关键词搜索、视频详情（含分P）、UP主投稿、UP主资料（粉丝、关注、获赞、播放、等级、认证）、综合热门、排行榜、每周必看、标签、相关推荐、评论及楼中楼回复、弹幕（原始或汇总：高频词、每分钟密度、峰值）。

- 无需登录，也无需提供账号或 Cookie（Actor 内部使用匿名访客标识），仅抓取公开数据；输出字段为统一英文命名。
- 未登录状态下 B站每个视频只返回约 3 条热门评论，本工具会抓取这些评论下的全部回复，但无法获取完整评论区。
- 默认不输出评论用户信息，可选择哈希或公开昵称。
- 内置代理回退（已含在价格中）：仅在被 B站限流（412）后才依次切换到数据中心代理、住宅代理；弹幕文件不走住宅代理。
- 使用者需自行遵守 B站用户协议及《个人信息保护法》等法律法规。

# Changelog

This Actor's version history is a separate document: https://apify.com/stone_jadex/bilibili-scraper-pro/changelog.md

# Actor input Schema

## `searchKeywords` (type: `array`):

Search Bilibili videos by keyword (Chinese or English), e.g. 原神, AI, vlog.

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

Individual videos: https://www.bilibili.com/video/BV1..., BV1... or av123.

## `userIds` (type: `array`):

Scrape latest uploads of these creators. Numeric UID or https://space.bilibili.com/<uid>.

## `profileUserIds` (type: `array`):

Output one profile row per creator: followers, following, likes, total views, level, bio, verification.

## `includePopular` (type: `boolean`):

Scrape the 综合热门 (popular) board.

## `rankingCategoryIds` (type: `array`):

Ranking board by category id (rid). 0 = all-site ranking. Some category ids may not have boards; errors are reported in OUTPUT.

## `includeWeeklyMustWatch` (type: `boolean`):

Scrape the latest weekly must-watch issue (best effort; Bilibili may rate-limit it).

## `maxVideosPerSource` (type: `integer`):

Max videos per keyword / creator / board.

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

totalrank = relevance, click = most viewed, pubdate = newest, dm = most danmaku, stow = most favorited.

## `fetchDetails` (type: `boolean`):

One extra request per video for coins, shares, multi-part (P) pages, subtitle availability, full description. Slower, more rate-limit prone. Popular/ranking already include full stats.

## `includeTags` (type: `boolean`):

One extra request per video.

## `includeRelated` (type: `boolean`):

Embed related/recommended videos list (bvid, title, uploader, views).

## `maxRelatedPerVideo` (type: `integer`):

Max related videos embedded per video.

## `includeAiSummary` (type: `boolean`):

Tries Bilibili's AI video summary (AI视频总结). In our tests it was NOT returned to anonymous requests, so expect aiSummary.available=false. Adds one request per video.

## `includeComments` (type: `boolean`):

Scrape public comments. Anonymous limit: Bilibili returns ~3 top-level (hot) comments per video; the Actor then paginates their full reply threads. Expect tens to a few thousand comments per video depending on how many replies those top comments have — not the full comment section.

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

Includes replies.

## `includeCommentReplies` (type: `boolean`):

Paginate replies under top-level comments (main way to get more than 3 comments).

## `commentUserData` (type: `string`):

none = no author fields (default, privacy-friendly); hashed = pseudonymous author id + level/region; public = public username & UID.

## `danmakuMode` (type: `string`):

off; summary = one cheap row per video (top terms, per-minute density timeline, peak); raw = individual danmaku rows; both.

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

Raw rows are sampled evenly across the video timeline if there are more.

## `builtInProxyFallback` (type: `boolean`):

Included in the price. Requests go direct; only after Bilibili rate-limits (HTTP 412) the Actor switches to Apify datacenter proxy, then (within a small developer-set budget) residential proxy. Danmaku files never use residential.

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

Optional. If set, ALL requests use your own proxy (billed to your account per Apify rules) and the built-in fallback is disabled.

## `requestDelayMs` (type: `integer`):

Polite global delay; auto-increases when rate limited.

## `maxRunSeconds` (type: `integer`):

Stop gracefully after N seconds (0 = use Actor timeout). Partial results are always kept.

## Actor input object example

```json
{
  "searchKeywords": [
    "原神"
  ],
  "includePopular": false,
  "includeWeeklyMustWatch": false,
  "maxVideosPerSource": 5,
  "searchOrder": "totalrank",
  "fetchDetails": false,
  "includeTags": false,
  "includeRelated": false,
  "maxRelatedPerVideo": 10,
  "includeAiSummary": false,
  "includeComments": false,
  "maxCommentsPerVideo": 20,
  "includeCommentReplies": true,
  "commentUserData": "none",
  "danmakuMode": "off",
  "maxDanmakuPerVideo": 500,
  "builtInProxyFallback": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "requestDelayMs": 800,
  "maxRunSeconds": 0
}
```

# Actor output Schema

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

Scraped items in the default dataset.

# 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 = {
    "searchKeywords": [
        "原神"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("stone_jadex/bilibili-scraper-pro").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 = { "searchKeywords": ["原神"] }

# Run the Actor and wait for it to finish
run = client.actor("stone_jadex/bilibili-scraper-pro").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 '{
  "searchKeywords": [
    "原神"
  ]
}' |
apify call stone_jadex/bilibili-scraper-pro --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,stone_jadex/bilibili-scraper-pro"
        }
    }
}
```

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/WnjoFk9b09huZ8uMf/builds/k9buCHUa4xVXGmxzT/openapi.json
