# Bilibili Scraper - Videos, Comments, Danmaku & Creator Uploads (`topapi/bilibili-scraper`) Actor

Scrape Bilibili (哔哩哔哩 B站) videos by keyword, link, creator or ranking: views, likes, coins, favorites, shares, tags. Add comments with replies, danmaku and danmaku profiles, creator profiles with bio contacts, live rooms and hot search. Monitor mode, no login. From $0.90 per 1,000 videos.

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

## Pricing

from $0.90 / 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

### What does Bilibili Scraper do?

**Bilibili Scraper** extracts public data from [Bilibili](https://www.bilibili.com) (哔哩哔哩, B站), China's largest video community, and turns keywords, video links, creator pages and the popular lists into structured rows: each video with views, likes, coins, favorites, shares, comments, danmaku count, tags, category, duration and publish date; comments and replies; danmaku (bullet comments) with the second they appear; creator (UP主) profiles; live rooms and the hot-search board. Built for China-market researchers, brand and KOL teams, agencies, AI-training and data pipelines that need Bilibili numbers without an account.

Bilibili Scraper - B站 Scraper - 哔哩哔哩 Scraper - Bilibili Comments Scraper - Bilibili Danmaku Scraper - Bilibili API

<a href="https://console.apify.com/actors/nnSRQFsYoKIeTyLDF"><img src="https://api.apify.com/v2/key-value-stores/qNQ9zP0xaj2yxGeMY/records/bilibili-scraper-source.png" alt="Bilibili video page with views, likes, coins, favorites and shares that Bilibili Scraper turns into rows" style="width:70%"></a>

- **Ten modes in one actor:** keyword search, videos by link, comments of links, danmaku of links, a creator's uploads, creator profiles, creator search, popular / ranking / must-watch lists, hot search and live-room search. `type` tells the rows apart; each kind has its own price and you pay only for the kinds you switch on.
- **Past Bilibili's 1,000-results-per-search cap:** when a keyword has more, the run walks it by date window (measured: 1,200 unique videos for "原神" in 24 s).
- **A creator's whole upload list:** 935 videos back to 2015 for 影视飓风 (Bilibili's own counter shows 938), 99 per request, newest first.
- **Comments as deep as you ask:** 20 per page, hot or newest first, with replies, pinned comments and whether the uploader liked or replied.
- **Danmaku from two sources merged:** the video's danmaku pool plus its 6-minute timeline segments, deduplicated: 9,560 danmaku for one 45-minute video where the pool alone gives 7,200. Packed as one item per video by default, or one row per danmaku.
- **Danmaku reaction profile:** unique senders, danmaku per minute, the peak minute and an evenly spread sample, in one row per video.
- **No login, cookies or API key.** Paste keywords, links or creator ids and run.
- **Monitor mode for schedules:** each run returns only videos, comments, danmaku, creators, live rooms and topics no earlier run delivered.
- **Export anywhere:** JSON, CSV, Excel, XML; schedules, webhooks, Make, Zapier, n8n, Google Sheets; Apify API and MCP, with `compact` output for AI agents.

### What data can you get from Bilibili?

<table>
<tr>
<td>🎬 Video id, link, title (`bvid`, `url`)</td>
<td>👁️ Views (`viewCount`)</td>
<td>👍 Likes, 🪙 coins, ⭐ favorites, ↗️ shares</td>
</tr>
<tr>
<td>💬 Comment count (`replyCount`)</td>
<td>🔤 Danmaku count (`danmakuCount`)</td>
<td>⏱️ Duration, publish date</td>
</tr>
<tr>
<td>🏷️ Tags, category (`category`, `categoryId`)</td>
<td>📺 Parts (P1, P2…), resolution, original / repost</td>
<td>🏆 Honors and highest site rank (`honors`, `hisRank`)</td>
</tr>
<tr>
<td>📈 Engagement rate, like rate</td>
<td>👥 Watching now (`onlineCount`)</td>
<td>🔗 Related videos, stream links</td>
</tr>
<tr>
<td>🗨️ Comments + replies: text, likes, time, level</td>
<td>💥 Danmaku: text, second, colour, mode, sent time</td>
<td>📊 Danmaku profile: senders, per minute, peak</td>
</tr>
<tr>
<td>🧑‍🎨 Creator: followers, videos, total likes, level</td>
<td>✅ Verification, VIP, live room</td>
<td>📧 Email / WeChat / QQ from the public bio</td>
</tr>
<tr>
<td>🔴 Live rooms: title, watching, area, streamer</td>
<td>🔥 Hot search: keyword, heat score</td>
<td>🙂 Sentiment of comments and titles (optional)</td>
</tr>
</table>

On a 100-video search run with full details, views, likes, coins, favorites, shares, tags, category, parts and resolution were filled on 100% of rows.

### How to scrape Bilibili with Bilibili Scraper

1. [Create a free Apify account](https://console.apify.com/sign-up) — $5 of monthly credit, no card needed.
2. Open [Bilibili Scraper](https://apify.com/topapi/bilibili-scraper) and click **Try for free**.
3. Pick a mode under **What to scrape**, then type a keyword, paste video links or paste creator ids.
4. Switch on any extras (comments, danmaku, full details) and set **Max results**.
5. Click **Start**, then open **Storage** and **Export** as JSON, CSV or Excel — or let a schedule run it for you.

### ⬇️ Input

| Parameter | Type | Description |
|---|---|---|
| **🔍 What to scrape** | | |
| `mode` | Select | `search` · `video_detail` · `video_comments` · `video_danmaku` · `user_videos` · `user_profile` · `user_search` · `popular` · `hot_search` · `live_search`. Default `search` |
| `searchQuery` / `searchQueries` | Text / list | Keywords, Chinese or English, e.g. `原神`, `机械键盘`, `AI tutorial` |
| `searchAliases` | List | Other spellings searched with each query and merged into it, e.g. `耐克` for Nike |
| `videoUrls` | List | `bilibili.com/video/BV…`, `BV1…` ids, `av…` ids, `b23.tv` share links; `?p=2` picks a part |
| `userIds` | List | Creator ids (the number in `space.bilibili.com/<mid>`) or those links |
| `popularSource`, `category` | Select | Popular feed, ranking (by 15 categories or all) or the must-watch list |
| **🎯 Filters** (applied by Bilibili's search) | | |
| `sortOrder` | Select | Relevance, most views, newest, most danmaku, most favorites, most comments |
| `durationFilter` | Select | Any, under 10 min, 10-30, 30-60, over 60 |
| `pubtimeBegin`, `pubtimeEnd` | Text | Published window, e.g. `2026-09-01`; also filters uploads and popular rows |
| `searchCategoryId` | Integer | Bilibili category id, e.g. 4 = games, 188 = tech |
| `sortComments` | Select | Hot, newest, or most liked |
| **✂️ Refine results** (before anything is charged) | | |
| `minViews`, `minLikes` | Integer | Skip videos under these counts |
| `minDurationSec`, `maxDurationSec` | Integer | Length bounds in seconds |
| `publishedWithinDays` | Integer | Only videos from the last N days |
| `includeKeywords`, `excludeKeywords` | List | Words that must / must not appear in the title, description or tags |
| `minFollowers`, `onlyWithContacts` | Integer / Boolean | Creator rows: follower floor; only creators whose bio lists an email, WeChat, QQ or phone |
| **➕ Extra data** | | |
| `includeDetails` | Boolean | Full page data for search, uploads and popular rows (coins, shares, tags, parts, honors). Free |
| `includeRelated`, `includeCreatorProfile`, `includeOnlineCount`, `includeStreamUrls` | Boolean | Related videos, uploader stats, watching-now, DASH stream links. Free |
| `includeComments`, `maxComments`, `includeReplies`, `maxRepliesPerComment` | | Comments and replies as their own rows (charged per comment) |
| `includeDanmaku`, `danmakuOutput`, `maxDanmakuPerVideo` | | Danmaku, packed per video (default) or one row each (charged per danmaku) |
| `danmakuAllParts`, `danmakuStartSec`, `danmakuEndSec` | | Every part of a multi-part video; a time window inside the video |
| `includeDanmakuProfile`, `danmakuSampleSize` | | One reaction-profile row per video (charged per profile) |
| `sentimentAnalysis`, `anonymizeUsers` | Boolean | Lexicon sentiment on comments and titles; hashed commenter names |
| **🔁 Monitoring** | | |
| `monitorMode`, `monitorStoreName` | Boolean / Text | Only rows no earlier run with the same store delivered. Pair with a schedule |
| `followUpComments` | Boolean | With monitor + comments: also new comments under videos delivered before (up to 200) |
| **📦 Output** | | |
| `maxResults` | Integer | Default `100`; `0` = no limit. Videos (or creators, live rooms, topics) per run |
| `maxResultsPerSearch` | Integer | Cap per keyword or creator |
| `compact` | Boolean | Core fields only, for AI agents and MCP |
| **⚙️ Advanced** | | |
| `proxyConfiguration`, `maxConcurrency` | | Requests go direct first; the proxy is used only when Bilibili refuses the container's IP |

#### Input JSON

```json
{
  "mode": "search",
  "searchQuery": "机械键盘",
  "sortOrder": "pubdate",
  "maxResults": 100,
  "includeDetails": true,
  "includeComments": true,
  "maxComments": 20
}
```

#### Pick the mode before anything else

Each mode reads its own box: `search`, `user_search` and `live_search` read the keywords; the three `video_*` modes read `videoUrls`; `user_videos` and `user_profile` read `userIds`. **Do:** `{"mode": "user_videos", "userIds": ["946974"]}` · **Don't:** `{"mode": "search", "userIds": ["946974"]}` (search has no keyword, so the sample search runs).

#### Use a creator id, not a name

`userIds` takes the number from the creator's space link (`space.bilibili.com/546195` → `546195`). To find creators by name, use `user_search` with the name as the keyword.

#### Want only coins and shares? Switch on full details

Search results do not carry coins or shares (Bilibili's search API leaves them out), so those fields are empty on plain search rows. `includeDetails: true` reads each video's page data and fills them, at the same price per video.

### ⬆️ Output

Every record becomes one dataset item. These tables are real rows from platform runs:

<a href="https://console.apify.com/actors/nnSRQFsYoKIeTyLDF"><img src="https://api.apify.com/v2/key-value-stores/qNQ9zP0xaj2yxGeMY/records/bilibili-scraper-output.png" alt="Bilibili Scraper output table with views, likes, coins, favorites, shares, danmaku profile, comments and hot search" style="width:70%"></a>

A video row (shortened):

```json
{
  "type": "video",
  "bvid": "BV1EJpg6SEVV",
  "url": "https://www.bilibili.com/video/BV1EJpg6SEVV",
  "title": "【2026年10月键盘推荐】自费万元！机械+磁轴键盘全配列实拍实测…",
  "duration": 1037,
  "viewCount": 584578,
  "likeCount": 11340,
  "coinCount": 4297,
  "favoriteCount": 5697,
  "shareCount": 229,
  "replyCount": 498,
  "danmakuCount": 177,
  "authorName": "BR店长",
  "authorMid": 96153951,
  "publishDate": "2026-10-12T02:00:00.000Z",
  "category": "数码",
  "tags": ["键盘", "评测", "机械键盘", "客制化键盘"],
  "engagementRate": 0.037738,
  "source": "search"
}
```

A packed danmaku item holds a video's danmaku in `danmaku`, one object per danmaku: `danmakuId`, `text`, `videoTime` (second), `videoTimeFormatted`, `mode`, `fontSize`, `color`, `sentAt`, `pool`, `senderHash`, `weight`. With `danmakuOutput: "rows"` each of those is its own `type: "danmaku"` row.

#### Fields and how often they were filled

| Rows | Field fill on platform runs |
|---|---|
| Search, no details (20 rows) | bvid, title, views, likes, favorites, comments, danmaku, duration, publish date, author, category, tags 100%; coins, shares, cid empty (not in search results) |
| Search + full details (100 rows) | the above plus coins, shares, cid, parts, resolution, original/repost 100%; description 63%; honors 3% |
| Creator uploads (935 rows) | views, likes, coins, favorites, shares, comments, danmaku, duration, description, cid 99-100%; tags only with full details |
| Comments + replies (386 rows) | text, likes, time, level, VIP, uploader-liked 100%; gender 44%; bio 58%; emotes 28%; mentions 23%; pictures 7%; replies carry `rootCommentId` |
| Danmaku (9,560 in a pack) | id, text, second, mode, colour, font size, sent time, sender hash, weight 100% |
| Creator search (5 rows) | name, followers, videos, level, verification, recent videos 100%; bio 80%; live room 60% |
| Live rooms / hot search | room, title, watching, area, streamer 100% / keyword, heat score 100% |

### How can I use Bilibili data?

- 🎯 **Brand and KOL teams** — find creators by keyword, read their followers, total likes and the business contact in their bio, then track their uploads.
- 📊 **Market researchers** — follow a category's ranking or a product keyword week over week (views, coins, favorites as purchase-intent signals).
- 💬 **Consumer-insight teams** — pull comments and danmaku to see what viewers say at each second of a launch video.
- 🎮 **Game and anime studios** — measure reaction to a trailer with the danmaku profile: peak minute, danmaku per minute, unique senders.
- 🤖 **AI and NLP teams** — build Chinese text corpora from comments and danmaku, with timestamps.
- 📈 **Agencies** — schedule `monitorMode` runs and get only new uploads and comments each day.

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

Bilibili Scraper is pay-per-event (the Pricing tab always shows the live rates). There is no start fee.

| Event | Price | When it is charged |
|---|---:|---|
| `video` | **$0.0009 per video** ($0.90 per 1,000) | Each video row delivered after your filters |
| `comment` | **$0.00044 per comment** ($0.44 per 1,000) | Each comment or reply row |
| `danmaku` | **$0.000018 per danmaku** ($0.018 per 1,000) | Each danmaku, packed or as a row |
| `creator` | **$0.0009 per creator** | Each creator profile row |
| `danmaku-profile` | **$0.0045 per profile** | Each video part profiled |
| `hot-search` | **$0.00045 per topic** | Each hot-search row |
| `live-room` | **$0.0009 per live room** | Each live-room row |

Worked examples:

- **The sample input** (search "原神", 20 videos) = 20 × $0.0009 = **$0.018**
- **1,000 videos** from a keyword = **$0.90**
- **1 video + 100 comments** = $0.0009 + 100 × $0.00044 = **$0.045**
- **All danmaku of a 45-minute video** (about 9,500) = **$0.17**; its reaction profile = **$0.0045**
- **A creator's 935 uploads + their profile** = 935 × $0.0009 + $0.0009 = **$0.84**
- **The hot-search board** (50 topics) = **$0.0225**

Apify platform usage is included in these prices. Measured on the platform at the default 256 MB: 20 videos in 3 s, 100 videos with full details in 17 s, 1,000 with full details in 123 s, 935 uploads in 15 s, 1,000 comments in 29 s.

### Integrations, API, scheduling & MCP

- **Schedules:** run Bilibili Scraper hourly or daily from the **Schedules** tab; with `monitorMode` each run returns only what is new.
- **Webhooks:** fire a URL when a run finishes — push rows to your CRM, Slack or a sheet.
- **No-code:** Make, Zapier, n8n, Google Sheets, Airtable, Slack via [Apify integrations](https://docs.apify.com/integrations).
- **API:** `apify-client` for [Node.js](https://apify.com/topapi/bilibili-scraper/api/javascript) or [Python](https://apify.com/topapi/bilibili-scraper/api/python), and the [Apify API reference](https://docs.apify.com/api/v2).
- **MCP / AI agents:** connect Claude, Cursor or any MCP client through the [MCP tab](https://apify.com/topapi/bilibili-scraper/api/mcp); switch on `compact` to keep answers small.

### More TopApi scrapers

<table>
<tr>
<td>🎵 <a href="https://apify.com/topapi/douyin-scraper">Douyin Scraper</a> - 抖音 videos, creators, comments</td>
<td>🎬 <a href="https://apify.com/topapi/tiktok-scraper">TikTok Scraper</a> - TikTok posts by profile, hashtag or URL</td>
<td>🔗 <a href="https://apify.com/topapi/tiktok-video-scraper">TikTok Video Scraper</a> - TikTok videos by URL</td>
</tr>
<tr>
<td>▶️ <a href="https://apify.com/topapi/youtube-shorts-scraper">YouTube Shorts Scraper</a> - Shorts by channel or URL</td>
<td>📸 <a href="https://apify.com/topapi/instagram-scraper">Instagram Scraper</a> - posts and reels</td>
<td>🧭 <a href="https://apify.com/topapi">All TopApi actors</a></td>
</tr>
</table>

### Limits & empty runs

- **What Bilibili shows a signed-out visitor is the ceiling.** Subtitles, the commenter's IP location, follower and following lists and the AI summary are shown to logged-in viewers only, so they are not in the rows.
- **Search:** Bilibili returns at most about 1,000 videos per keyword; more comes from date windows, and the run summary says how many windows ran.
- **Zero counts are Bilibili's:** for some keywords many results show 0 views (23 of 50 for "机械键盘"); the row carries what Bilibili reports, and `engagementRate` stays empty when views are 0. Use `minViews` to skip them.
- **Danmaku:** Bilibili keeps a capped pool per video (7,200 of 31,800 on the test video); the two sources merged gave 9,560. Above `maxDanmakuPerVideo` an even spread across the timeline is returned.
- **Uploads:** the list a visitor gets held 935 of the 938 videos Bilibili counts for the test creator.
- **Refusals:** when Bilibili refuses the container's IP the request moves to the Apify proxy; if Bilibili asks for a human verification the run stops that keyword and says so. Nothing is charged for rows not delivered.
- **Empty dataset:** your filters removed everything, the video is deleted or private (`not_found` in the run summary), or monitor mode found nothing new. Lines that are not Bilibili links get a free `error` row.

### FAQ

#### How many videos can Bilibili Scraper get for one keyword?

About 1,000 per search on Bilibili, and past that by date window: a test run returned 1,200 unique videos for "原神" in 24 seconds. Set `maxResults` to the number you need.

#### Can Bilibili Scraper get every video of a Bilibili creator?

Yes, with `user_videos`: the creator's upload list, newest first, 99 per request (935 videos in 15 seconds in testing, against the 938 Bilibili shows).

#### Can Bilibili Scraper get Bilibili comments and replies?

Yes. `includeComments` (or the `video_comments` mode) returns 20 comments per page, hot or newest first, as deep as `maxComments` allows; `includeReplies` adds each thread's replies. A test run read 1,000 comments of one video in 29 seconds.

#### What is danmaku and can Bilibili Scraper export it?

Danmaku (弹幕) are the comments that fly across a Bilibili video at a given second. Bilibili Scraper returns them with the second, colour, display mode and send time, packed into one item per video (the default) or one row each, plus an optional reaction profile.

#### Can I run Bilibili Scraper on a schedule?

Yes. Save the input as a task, open **Schedules**, pick a cadence and switch on `monitorMode`; a run that finds nothing new delivers no rows and charges nothing.

#### Can I use Bilibili Scraper with the Apify API?

Yes — start runs and read datasets with `apify-client` for [Node.js](https://apify.com/topapi/bilibili-scraper/api/javascript) or [Python](https://apify.com/topapi/bilibili-scraper/api/python).

#### Can I use Bilibili Scraper through an MCP server?

Yes. Open the [MCP tab](https://apify.com/topapi/bilibili-scraper/api/mcp), connect your client and ask for Bilibili videos, comments or creators in plain language.

#### Do I need a Bilibili account, cookies or a proxy?

No. Bilibili Scraper reads what Bilibili shows a signed-out visitor; no account, cookie or QR login is involved.

#### Why did my Bilibili Scraper run return no rows?

The video is deleted or private, your filters removed every row (the run summary lists which filter), monitor mode found nothing new, or the input was not a Bilibili link (each such line gets a free `error` row). Nothing is charged for those.

#### Is it legal to scrape Bilibili?

Bilibili Scraper collects publicly available data only, nothing behind a login. You are responsible for complying with Bilibili's terms of service, creators' copyright and data-protection law (GDPR, CCPA, PIPL); creator profiles and comments are personal data.

#### Your feedback

Found a bug or missing a field? Open an issue on the [Issues tab](https://apify.com/topapi/bilibili-scraper/issues/open) — we answer within two working days.

# Actor input Schema

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

Pick one per run. Search, links, uploads and popular return video rows; comments, replies, danmaku and profiles can be added to any of them under Extra data.

## `searchQuery` (type: `string`):

One keyword, Chinese or English, for the search, creator-search and live-room modes. e.g. "原神", "机械键盘", "AI tutorial".

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

Extra keywords, each searched on its own (bulk). e.g. "iPhone 17", "小米汽车".

## `searchAliases` (type: `array`):

Other spellings searched with each query and merged into it, deduped by video. e.g. "耐克" for Nike.

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

For the video, comments and danmaku modes. Accepts bilibili.com/video/BV..., BV ids, av ids and b23.tv share links; ?p=2 picks a part.

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

For the uploads and profile modes: the number in space.bilibili.com/<mid>, or that link. e.g. "946974", "https://space.bilibili.com/546195".

## `popularSource` (type: `string`):

For the popular mode: the popular feed (综合热门), the ranking (排行榜, by category) or the must-watch list (入站必刷).

## `category` (type: `string`):

For the ranking: one category (zone) or all.

## `sortOrder` (type: `string`):

How Bilibili sorts search results.

## `durationFilter` (type: `string`):

Search only videos of this length.

## `pubtimeBegin` (type: `string`):

Only videos published on or after this date. 2026-04-15, 2026/04/15, 20260415 or 2026-04-15T10:30:00Z; empty = no limit. Also filters uploads and popular rows.

## `pubtimeEnd` (type: `string`):

Only videos published on or before this date (same formats). A bare date means 00:00 UTC that day.

## `searchCategoryId` (type: `integer`):

Bilibili category (tid) for search, e.g. 4 = games, 36 = knowledge, 188 = tech. 0 = all.

## `sortComments` (type: `string`):

Hot (Bilibili's ranking), newest first, or hot re-sorted by likes within each page.

## `minViews` (type: `integer`):

Skip videos with fewer views. 0 = no limit.

## `minLikes` (type: `integer`):

Skip videos with fewer likes. 0 = no limit.

## `minDurationSec` (type: `integer`):

Skip videos shorter than this many seconds. 0 = no limit.

## `maxDurationSec` (type: `integer`):

Skip videos longer than this many seconds. 0 = no limit.

## `publishedWithinDays` (type: `integer`):

Keep only videos from the last N days (any mode). Pairs well with a daily schedule. 0 = no limit.

## `includeKeywords` (type: `array`):

Keep a video only if its title, description or tags contain one of these words.

## `excludeKeywords` (type: `array`):

Drop a video whose title, description or tags contain one of these words.

## `minFollowers` (type: `integer`):

Creator rows only: skip creators with fewer followers. 0 = no limit.

## `onlyWithContacts` (type: `boolean`):

Creator rows only: keep creators whose public bio lists an email, WeChat, QQ or phone.

## `includeDetails` (type: `boolean`):

For search, uploads and popular rows: also read each video's page data (coins, shares, tags, parts, cid, honors). No extra charge; slower.

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

Add Bilibili's 40 related videos to each video row (relatedVideos). No extra charge.

## `includeCreatorProfile` (type: `boolean`):

Add the uploader's followers, video count, total likes, level and verification to each video row. No extra charge.

## `includeOnlineCount` (type: `boolean`):

Add how many people are watching each video right now (onlineCount). No extra charge.

## `includeStreamUrls` (type: `boolean`):

Add the DASH video and audio stream links a signed-out visitor gets (up to 480p; valid about 2 hours). No extra charge.

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

Also return each video's comments as their own rows (charged per comment).

## `maxComments` (type: `integer`):

Top-level comments per video, 20 per page, paged as deep as you ask.

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

Also return the replies under each comment (each a comment row with rootCommentId).

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

Maximum replies read under each comment.

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

Also return each video's danmaku (on-screen bullet comments), charged per danmaku. Output shape below.

## `danmakuOutput` (type: `string`):

Packed = one dataset item per video holding its danmaku as an array (compact, the default). Rows = one dataset item per danmaku. Same price either way.

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

Cap per video part. Above the cap an even spread across the timeline is returned, not the first N.

## `danmakuAllParts` (type: `boolean`):

Read danmaku of every part (P1, P2...) instead of the first (or the ?p= part of the link).

## `danmakuStartSec` (type: `integer`):

Only danmaku shown at or after this second of the video. 0 = from the start.

## `danmakuEndSec` (type: `integer`):

Only danmaku shown up to this second. 0 = to the end.

## `includeDanmakuProfile` (type: `boolean`):

One row per video with danmaku count, unique senders, per-minute rate, peak minute and an evenly spread text sample (charged per profile).

## `danmakuSampleSize` (type: `integer`):

Danmaku texts in each profile's sample, spread evenly across the timeline.

## `sentimentAnalysis` (type: `boolean`):

Add a lexicon-based sentiment (polarity and a -1 to +1 score) to comments and to video title + description. No extra charge.

## `anonymizeUsers` (type: `boolean`):

Replace commenter names and ids with stable hashes and drop their avatars and bios.

## `monitorMode` (type: `boolean`):

Return only videos, comments, danmaku, creators, live rooms and topics no earlier run with the same store delivered. Pairs with a daily schedule.

## `monitorStoreName` (type: `string`):

Names the saved state, so separate monitors do not collide. e.g. "nike-weekly".

## `followUpComments` (type: `boolean`):

With monitor and comments on: each run also reads the new comments under videos delivered by earlier runs (up to 200 videos).

## `maxResults` (type: `integer`):

Videos (or creators, live rooms, topics) per run. Bilibili's search returns about 1,000 per query; past that the run walks date windows. 0 = no limit.

## `maxResultsPerSearch` (type: `integer`):

Cap per keyword or per creator when you give several. 0 = only Max results applies.

## `compact` (type: `boolean`):

Core fields only, sized for AI agents and MCP.

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

Requests go direct first; the proxy (then residential) is used only for a request Bilibili refuses from the container's IP.

## `maxConcurrency` (type: `integer`):

How many videos are read at the same time.

## Actor input object example

```json
{
  "mode": "search",
  "searchQuery": "原神",
  "popularSource": "popular",
  "category": "all",
  "sortOrder": "totalrank",
  "durationFilter": "any",
  "searchCategoryId": 0,
  "sortComments": "hot",
  "minViews": 0,
  "minLikes": 0,
  "minDurationSec": 0,
  "maxDurationSec": 0,
  "publishedWithinDays": 0,
  "minFollowers": 0,
  "onlyWithContacts": false,
  "includeDetails": false,
  "includeRelated": false,
  "includeCreatorProfile": false,
  "includeOnlineCount": false,
  "includeStreamUrls": false,
  "includeComments": false,
  "maxComments": 20,
  "includeReplies": false,
  "maxRepliesPerComment": 10,
  "includeDanmaku": false,
  "danmakuOutput": "packed",
  "maxDanmakuPerVideo": 1000,
  "danmakuAllParts": false,
  "danmakuStartSec": 0,
  "danmakuEndSec": 0,
  "includeDanmakuProfile": false,
  "danmakuSampleSize": 25,
  "sentimentAnalysis": false,
  "anonymizeUsers": false,
  "monitorMode": false,
  "monitorStoreName": "bilibili-monitor",
  "followUpComments": false,
  "maxResults": 20,
  "maxResultsPerSearch": 0,
  "compact": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "maxConcurrency": 5
}
```

# Actor output Schema

## `rows` (type: `string`):

The dataset: video, comment, danmaku (packed or rows), danmaku-profile, creator, live-room and hot-search rows (`type` tells them apart).

## `summary` (type: `string`):

Per-input counts (read, filtered, delivered, already seen), Bilibili refusals, the egress used and danmaku sources read.

# 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",
    "searchQuery": "原神",
    "maxResults": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("topapi/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": "search",
    "searchQuery": "原神",
    "maxResults": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("topapi/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": "search",
  "searchQuery": "原神",
  "maxResults": 20
}' |
apify call topapi/bilibili-scraper --silent --output-dataset

```

## MCP server setup

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