# Bilibili Scraper API - B站 哔哩哔哩 Videos, 弹幕 Danmaku & UP主 (`scrapifier/bilibili-scraper`) Actor

📺 Scrape Bilibili (哔哩哔哩, B站) without login: keyword search with date, duration and category filters, full video stats, tags, UP主 profiles and uploads, comments and danmaku (弹幕). Deep search breaks the 1,000-result cap. B站数据采集，支持中英文关键词。Pay per result.

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

## Pricing

from $2.03 / 1,000 results

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 API - B站 哔哩哔哩 Videos, 弹幕 Danmaku & UP主

**English** | [中文](#-bilibili-scraper-api--b站-哔哩哔哩数据采集api-中文)

Scrape Bilibili (哔哩哔哩, B站) by keyword, video URL, creator space URL or trending board, and export videos, UP主 profiles, comments and danmaku as JSON, CSV or Excel — or pull them straight from the API.

⚡ **Up to 50 fields per video**: title, description, tags, category 分区, length, publish date, the full engagement set — **views 播放, danmaku 弹幕, comments 评论, likes 点赞, coins 投币, favourites 收藏, shares 分享** — plus ready-made **engagement rates**, the creator and their follower count, **joint-upload collaborators 联合投稿**, reuse rights, Bilibili's own content notices (e.g. 含AI生成内容) and **how many people are watching right now**. Search in **Chinese or English**, filter by **date, length and category**, and let **deep search** split a keyword by category, then publication date, then length, then sort order to go far past Bilibili's ~1,000-result ceiling: **12,000 unique videos from a single keyword** in our test run, spanning 2017 to today. Also returns **UP主 profiles** (followers, uploads, verification, average views), **comment threads** and **danmaku with the exact second each bullet comment appears — every part of a multi-part video included**. **No login, no cookies, no proxy, no browser**, and you **pay per result**.

[![Apify Actor](https://apify.com/actor-badge?actor=scrapifier/bilibili-scraper)](https://apify.com/scrapifier/bilibili-scraper)

### 🎯 Why scrape Bilibili?

- **China market research without an account**: Bilibili has no public API and no open export. This Actor turns any keyword into a dated, structured dataset of what Chinese audiences actually watch and say.
- **Influencer marketing and UP主 discovery**: find creators by keyword, rank them by followers and uploads, check verification, then pull their full upload history with views to size real reach before you pay for a placement.
- **Brand, game and product monitoring**: track every new video mentioning your brand, game or product, with views, likes and comment counts, and re-run daily on a schedule.
- **Audience reaction analysis**: danmaku (弹幕) carries the second of the video it belongs to. No other platform exposes *where* in a video the audience reacted — build retention and reaction curves from it.
- **Cross-border e-commerce and product research**: watch 开箱 (unboxing) and review videos for a product category, read the comments, and see which features the Chinese audience actually discusses.
- **Competitive benchmarking**: compare coins 投币 and favourites 收藏 — Bilibili's quality signals — not just raw view counts, across your channel and your competitors'.
- **AI and research datasets**: build Chinese-language video, comment and danmaku corpora with dates, categories and engagement metadata attached.

### 📊 What data does the Bilibili Scraper extract?

#### Videos — one row per video

| Field | Description |
|---|---|
| `bvid`, `aid`, `url` | BV id, av id and the direct bilibili.com link |
| `title`, `description`, `coverUrl` | Title, description and cover image |
| `duration`, `durationSeconds` | Length as displayed (`6:47`) and in seconds |
| `publishedAt`, `publishedDate`, `uploadedAt` | Publication timestamp (UTC ISO 8601), date, and upload time |
| `category`, `categoryId` | Bilibili zone 分区, e.g. 美食记录 (211) |
| `views`, `danmakuCount`, `comments` | Play count 播放, danmaku count 弹幕, comment count 评论 |
| `likes`, `coins`, `favourites`, `shares` | 点赞, 投币, 收藏, 分享 |
| `tags[]` | Video tags as set by the creator |
| `creatorMid`, `creatorName`, `creatorUrl`, `creatorAvatar` | UP主 identity and space link |
| `copyright` | `original` (自制) or `repost` (转载) |
| `partCount`, `parts[]` | Multi-part videos: every P with its own id, title and length |
| `widthPx`, `heightPx` | Resolution |
| `dynamicText`, `shortLink`, `publishLocation` | The post text published with the video, the b23.tv link, the IP region shown |
| `honours[]` | Badges such as 每周必看 or a ranking placement |
| `likeRate`, `engagementRate`, `danmakuPerMinute` | Ready-made ratios: likes/views, (likes+coins+favourites+shares+comments)/views, danmaku per minute |
| `staff[]` | Joint uploads 联合投稿: every collaborator with mid, name, role, space URL and followers |
| `noticeMessage` | The notice Bilibili displays on the video, e.g. 含AI生成内容 (AI-generated content) or 个人观点，仅供参考 |
| `allowsDownload`, `noReprint`, `noShare`, `isPaid`, `isCollaboration`, `isInteractive`, `is360` | Reuse rights and video kind |
| `watchingNow`, `watchingNowWeb` | People watching right now, when **Add live viewer counts** is on |
| `creatorFollowers`, `creatorFollowing`, `creatorVideoCount` | Creator stats, when **Add creator stats** is on |
| `trendingSource`, `trendingPosition`, `recommendedReason` | Board name, position and the reason shown, on trending rows |
| `searchKeyword`, `matchedInput` | The keyword, URL or board the row came from |

`cid`, the full `description`, `tags`, `copyright`, `parts`, resolution, `publishLocation` and `honours` need **Fetch each video's page** (one extra request per video). Any field is `null` when Bilibili does not display it.

#### Creators (UP主) — one row per creator

| Field | Description |
|---|---|
| `mid`, `name`, `url`, `avatar` | Creator id, name, space URL, avatar |
| `signature` | Bio 签名 |
| `followers`, `following` | 粉丝数 and 关注数 |
| `videoCount`, `articleCount`, `audioCount`, `albumCount`, `seasonCount` | Uploads 投稿, 专栏, 音频, 相册, 合集 |
| `level`, `isSeniorMember` | Account level and 硬核会员 status |
| `verifiedType`, `verifiedNote` | `personal` / `organisation` verification and its text |
| `isLive`, `liveRoomId`, `liveRoomUrl` | Live status and room |
| `latestVideos[]` | Recent uploads with title, URL, views, length and date |
| `latestVideosAvgViews`, `lastUploadDate` | Average views over those uploads, and when the creator last posted |

#### Comments — one row per comment

`commentId`, `parentCommentId`, `text`, `likes`, `replyCount`, `publishedAt`, `timeLabel`, `location` (IP region), `isTop` (pinned), `authorMid`, `authorName`, `authorUrl`, `authorAvatar`, `authorLevel`, `authorIsVip`, `authorSignature`, `likedByCreator`, `repliedByCreator`, `images[]`, plus the video context: `videoId`, `videoUrl`, `videoTitle`, `videoViews`, `videoPublishedDate`, `creatorName`.

#### Danmaku 弹幕 — one row per bullet comment

`danmakuId`, `text`, `atSeconds` and `atTime` (where it appears in the video), `mode` (scroll 滚动 / top 顶部 / bottom 底部 / reverse 逆向), `fontSize`, `color`, `senderHash`, `sentAt`, `sentDate`, `pool`, `weight`, `action`, plus the same video context block — and `partPage` / `partTitle` on multi-part videos, because **every part's track is read, not just the first**.

#### Hot searches 热搜 — one row per trending keyword

`rank`, `keyword`, `displayName`, `iconUrl`, `searchUrl`.

### 🚀 How to scrape Bilibili

1. Open the Actor and type one or more **Search keywords** — Chinese or English both work (`美食`, `genshin impact`, `开箱`).
2. Pick the **Data type**: `videos`, `creators`, `comments` or `danmaku`. Videos is the default.
3. Narrow with the filters: **sort** (relevance, newest, most played, most danmaku, most favourited, most commented), **length**, **category 分区**, **published after / before**.
4. Optionally add **Video URLs** (a BV id, an av id, a bilibili.com link or a b23.tv share link) and **Creator space URLs** (`https://space.bilibili.com/504799975` or just the id), or pick a **Trending board** (popular 综合热门, ranking 排行榜, newest in category 最新投稿, hot searches 热搜).
5. Set **Max rows** (`100` prefilled, `0` = no limit) — you pay per row, so keep a cap on your first run.
6. Click **Start**. Each keyword is searched, split by publication date when it fills up, deduplicated by video id, and saved in batches of 100.
7. Open the **Storage** tab to preview and export as JSON, CSV, Excel or XML, or read the dataset from the API.

The same run can be started from the Apify API, the Python or JavaScript client, the MCP server, or put on a schedule for daily monitoring.

### 📥 Input parameters

| Field | Key | Type | Default | Description |
|---|---|---|---|---|
| Search keywords | `keywords` | array of strings | `["genshin impact"]` | What to search. Chinese and English both work. One search per keyword. |
| Video URLs or IDs | `videoUrls` | array of strings | none | `https://www.bilibili.com/video/BV1p5p26fEWB`, a BV id, an av id or a b23.tv link. Each one always gets its full page. |
| Creator space URLs or IDs | `creatorUrls` | array of strings | none | `https://space.bilibili.com/504799975` or `504799975`. |
| Data type | `dataType` | select | `videos` | `videos`, `creators`, `comments`, `danmaku`. |
| Trending board | `trending` | select | `none` | `popular`, `ranking`, `newest_in_category`, `hot_searches`. |
| Sort search results by | `sortBy` | select | `relevance` | `relevance` 综合排序, `newest` 最新发布, `most_played` 最多播放, `most_danmaku` 最多弹幕, `most_favourited` 最多收藏, `most_commented` 最多评论. |
| Video length | `duration` | select | `any` | `under_10min`, `10_30min`, `30_60min`, `over_60min`. |
| Categories 分区 | `categories` | select (multiple) | none | Each selected category is searched separately, so none is dropped. `douga` 动画, `guochuang` 国创, `cartoon` 动漫, `music` 音乐, `dance` 舞蹈, `game` 游戏, `knowledge` 知识, `tech` 科技数码, `life` 生活, `food` 美食, `animal` 动物圈, `kichiku` 鬼畜, `fashion` 时尚, `ent` 娱乐, `cinephile` 影视, `documentary` 纪录片, `movie` 电影, `teleplay` 电视剧, `news` 资讯, `car` 汽车, `sports` 运动. |
| Published after / before | `publishedAfter`, `publishedBefore` | date | none | `YYYY-MM-DD` window, applied by Bilibili itself. |
| Deep search | `deepSearch` | boolean | `true` | Splits a full search by category, then publication date, then video length, then sort order, until the whole range is covered. |
| Fetch each video's page | `includeVideoDetails` | boolean | `false` | Adds description, tags, coins, favourites, shares, parts, resolution, publish location, honours. |
| Add creator stats | `includeCreatorStats` | boolean | `false` | Adds `creatorFollowers`, `creatorFollowing`, `creatorVideoCount` to video rows. |
| Add live viewer counts | `includeOnlineViewers` | boolean | `false` | Adds `watchingNow` / `watchingNowWeb` (在线人数) to video rows. |
| Uploads per creator | `creatorVideos` | integer | `0` | In Videos mode, uploads collected per creator URL. `0` = all of them. |
| Comments per video | `maxCommentsPerVideo` | integer | `100` | Comments mode. `0` = as many as the feed serves. |
| Include reply threads | `includeCommentReplies` | boolean | `false` | Also collects replies, linked by `parentCommentId`. |
| Comment order | `commentSort` | select | `top` | `top` 热门 or `newest` 最新. |
| Danmaku per video | `maxDanmakuPerVideo` | integer | `500` | Danmaku mode. `0` = every bullet comment served for the video. |
| Your Bilibili SESSDATA | `sessionCookie` | string (secret) | none | Optional, comments only — see the FAQ. |
| Max videos per search | `maxVideosPerSearch` | integer | `0` | Per-keyword / per-board cap. `0` = none. |
| Max rows for the run | `maxItems` | integer | `100` | Hard stop across every input. `0` = no limit. |
| Flatten nested fields | `flatten` | boolean | `false` | One text column per field, for clean CSV / Excel. |
| Report what each input returned | `emitInputStatus` | boolean | `true` | Adds `input_status` to the run's OUTPUT record. |
| Proxy | `proxyConfiguration` | object | off | Not needed. Only switch it on if you require a specific exit country. |

### 📤 Output example

```json
{
  "type": "video",
  "bvid": "BV1p5p26fEWB",
  "aid": 117438364589696,
  "url": "https://www.bilibili.com/video/BV1p5p26fEWB",
  "title": "在黄山脚下小村庄吃只有3张桌子的农家菜，红烧仔鸡 臭鳜鱼 笋片烧肉",
  "coverUrl": "https://i0.hdslb.com/bfs/archive/6f2ccf2fa6da4de1f1dd78a779e1ef4d87b3ec87.jpg",
  "duration": "6:47",
  "durationSeconds": 407,
  "publishedAt": "2026-10-14T08:44:54Z",
  "publishedDate": "2026-10-14",
  "category": "美食记录",
  "categoryId": 211,
  "views": 161509,
  "danmakuCount": 507,
  "comments": 399,
  "likes": 12170,
  "coins": 443,
  "favourites": 972,
  "shares": 285,
  "tags": ["种草", "农家菜", "臭鳜鱼", "美食推荐", "探店", "安徽美食", "黄山美食"],
  "creatorMid": 504799975,
  "creatorName": "达哥在上海",
  "creatorUrl": "https://space.bilibili.com/504799975",
  "creatorFollowers": 1298842,
  "likeRate": 0.07535,
  "engagementRate": 0.08749,
  "danmakuPerMinute": 74.8,
  "allowsDownload": true,
  "noReprint": true,
  "watchingNow": "179",
  "searchKeyword": "美食",
  "matchedInput": "美食"
}
```

A danmaku row:

```json
{
  "type": "danmaku",
  "danmakuId": "2221957516483857664",
  "text": "省流:我下去洗个澡",
  "atSeconds": 0.0,
  "atTime": "0:00",
  "mode": "scroll",
  "fontSize": 25,
  "color": "#ffffff",
  "sentAt": "2026-10-14T09:12:56Z",
  "videoId": "BV1p5p26fEWB",
  "videoTitle": "在黄山脚下小村庄吃只有3张桌子的农家菜…"
}
```

### 💡 Ready-to-run examples

Every example below was run before publishing and returns data as-is.

**1. What is being published about a game, newest first**

```json
{
  "keywords": ["genshin impact", "原神"],
  "dataType": "videos",
  "sortBy": "newest",
  "includeVideoDetails": true,
  "maxItems": 200
}
```

**2. A whole keyword, past the 1,000-result ceiling**

```json
{ "keywords": ["原神"], "dataType": "videos", "deepSearch": true, "maxItems": 12000 }
```

Returned **12,000 unique videos spanning 2017 → today**, across 88 sub-categories, in 19 searches, 321 requests and 3 min 21 s — and it stopped only because `maxItems` said so. A single search on that keyword returns ~725. `input_status` reports every slice and what it returned.

**3. Find food UP主 to work with**

```json
{ "keywords": ["美食"], "dataType": "creators", "maxItems": 100 }
```

**4. Everything one creator has uploaded**

```json
{
  "creatorUrls": ["https://space.bilibili.com/504799975"],
  "dataType": "videos",
  "creatorVideos": 0,
  "includeVideoDetails": true
}
```

**5. Audience reaction, second by second**

```json
{
  "videoUrls": ["https://www.bilibili.com/video/BV1p5p26fEWB"],
  "dataType": "danmaku",
  "maxDanmakuPerVideo": 1000
}
```

**6. Comments on the videos a keyword returns**

```json
{
  "keywords": ["扫地机器人"],
  "dataType": "comments",
  "maxVideosPerSearch": 20,
  "maxCommentsPerVideo": 100,
  "includeCommentReplies": true
}
```

**7. Today's trending board, and the hot searches**

```json
{ "trending": "popular", "maxVideosPerSearch": 100 }
```

```json
{ "trending": "hot_searches" }
```

**8. New tech unboxings, 10–30 minutes, most played**

```json
{
  "keywords": ["开箱"],
  "categories": ["tech"],
  "duration": "10_30min",
  "publishedAfter": "2026-09-01",
  "sortBy": "most_played"
}
```

### 💰 Pricing: how much does it cost to scrape Bilibili?

Pay per result, no subscription and no platform usage added on top:

| Apify plan | Price per 1,000 rows |
|---|---|
| Free / Starter | **$2.99** |
| Bronze | $2.63 |
| Silver | $2.39 |
| Gold and above | $2.03 |

A row is one video, one creator, one comment or one danmaku. Starting a run costs $0.00005. So 1,000 videos cost **$2.99**, 10,000 danmaku **$29.90**, and the 2,000-video deep search in example 2 costs **$5.98**. Set **Max rows** on your first runs to keep every run predictable.

### ⚙️ Performance, limits and reliability

- **No browser, no proxy, no login.** Measured on the platform: **1,500 plain video rows in 27 seconds** for **$0.0022** of platform usage, and **1,000 fully enriched rows** (video page + tags + creator stats) in 3 min 40 s for **$0.021** — no proxy traffic at all.
- **Past the search ceiling.** Bilibili serves roughly 1,000 results per search however you paginate it. Deep search cuts the keyword into disjoint slices — categories first (the highest-yield cut), then publication-date windows, then length bands, then the remaining sort orders — and deduplicates by video id: **12,000 unique videos from a single keyword** in our test, spanning 2017 to today and 88 sub-categories, in 19 searches and 321 requests — against ~725 for a single search.
- **Nothing silently dropped.** Select five categories and all five are searched, not just the first. Ask for a creator's uploads and the pagination runs to the last one. Ask for danmaku on a multi-part video and every part's track is read, merged and deduplicated.
- **Honest reporting.** The `input_status` report in OUTPUT lists, per keyword, URL or board: rows collected, the number of results Bilibili announced, how many date windows the search was split into, and why anything came back empty. No silent empty run.
- **Long runs stay safe.** The Actor watches the run timeout and finishes cleanly with the data already collected instead of being cut off, and it respects your max-cost-per-run setting.
- **Rate limits** are handled with automatic back-off and retries; transient refusals are retried before anything is reported as an error.

### 🔌 Integrations and API

Export to JSON, CSV, Excel, XML or HTML, or call the Actor directly:

```bash
curl -X POST "https://api.apify.com/v2/acts/scrapifier~bilibili-scraper/run-sync-get-dataset-items?token=<YOUR_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"keywords":["美食"],"dataType":"videos","maxItems":100}'
```

Works with the Apify Python and JavaScript clients, scheduling, webhooks, the MCP server for AI agents, and with Make, Zapier, n8n, LangChain, Google Sheets and Airtable.

### ❓ FAQ

**Do I need a Bilibili account or cookies?** No. Videos, creators, danmaku, trending boards and search all work with nothing. One exception: the public comment feed serves the top replies of each video. If you need entire comment threads, paste your own `SESSDATA` value, copied from a browser where you are logged in, into the optional SESSDATA field. The run tells you in OUTPUT when a video's comments were served partially.

**Do I need a proxy?** No. Leave the proxy off unless your own workflow requires a specific exit country.

**How many results can one keyword return?** Bilibili itself stops at about 1,000 per search. With deep search on, the only real limit is your `maxItems`: our test keyword returned 12,000 unique videos covering 2017 to today, and stopped only because `maxItems` said so.

**Does it work with English keywords?** Yes. `genshin impact`, `minecraft` or `python tutorial` all return results, and so does any Chinese keyword. Titles, tags and comments come back in their original language, unescaped and with the search highlighting removed.

**Why is `danmakuCount` higher than the number of danmaku rows?** `danmakuCount` is the lifetime counter displayed on the video. The player serves the danmaku currently in rotation for each segment of the timeline, and those are the rows you get.

**Can I monitor a keyword or a creator every day?** Yes — put the Actor on an Apify schedule, keep `publishedAfter` at yesterday's date, and send new rows to your warehouse or to Slack with a webhook.

**Is this legal?** The Actor reads only publicly displayed pages and data, the same a visitor sees, and it never signs in on your behalf. You are responsible for using the output in compliance with applicable laws and Bilibili's terms.

### 🔗 Related scrapers

[Trustpilot](https://apify.com/scrapifier/trustpilot-reviews-scraper) · [Capterra](https://apify.com/scrapifier/capterra-reviews-scraper) · [Quora](https://apify.com/scrapifier/quora-scraper) · [Airbnb](https://apify.com/scrapifier/airbnb-scraper) · [Vinted](https://apify.com/scrapifier/vinted-scraper) · [StockX](https://apify.com/scrapifier/stockx-scraper) · [GOAT](https://apify.com/scrapifier/goat-sneakers-scraper) · [Glassdoor](https://apify.com/scrapifier/glassdoor-reviews-scraper) · [Indeed](https://apify.com/scrapifier/indeed-jobs-scraper)

***

## 🇨🇳 Bilibili Scraper API — B站 哔哩哔哩数据采集API (中文)

[English](#bilibili-scraper-api---b站-哔哩哔哩-videos-danmaku--up主) | **中文**

B站（哔哩哔哩）数据采集工具：按关键词、视频链接、UP主空间链接或热门榜单采集 **视频数据、UP主资料、评论和弹幕**，一键导出 JSON、CSV、Excel，也可直接通过 API 调用。

⚡ **每条视频最多 50 个字段**：标题、简介、标签、分区、时长、发布时间，完整互动数据——**播放量、弹幕数、评论数、点赞、投币、收藏、分享**，并直接给出**互动率**，还有 UP主及其粉丝数、**联合投稿成员**、转载/下载权限、B站标注的内容提示（如 含AI生成内容）以及**当前在线观看人数**。支持**中英文关键词**，可按**发布时间、视频时长、分区**筛选。开启**深度搜索**后，系统会按**分区 → 发布时间 → 时长 → 排序方式**自动拆分，突破 B站约 1,000 条的搜索上限：单个关键词实测取得 **12,000 条去重视频**，覆盖 2017 年至今。另外还可采集 **UP主资料**（粉丝数、投稿数、认证、平均播放）、**评论楼层**，以及带**精确出现秒数**的**弹幕——多 P 视频的每一个分 P 都会采集**。**无需登录、无需 Cookie、无需代理、无需浏览器**，**按条计费**。

### 🎯 为什么要采集 B站数据？

- **中国市场调研**：B站没有公开 API，也没有导出功能。本工具把任意关键词变成带时间、带结构的数据集，直接看到中国用户在看什么、说什么。
- **UP主筛选与达人营销**：按关键词找 UP主，按粉丝数和投稿量排序，查看认证状态，再拉取其全部投稿和播放量，投放前先评估真实影响力。
- **品牌 / 游戏 / 产品舆情监控**：追踪每一条提及你品牌、游戏或产品的新视频，附带播放、点赞、评论数，可配合定时任务每天自动运行。
- **观众反应分析**：弹幕带有在视频中出现的**秒数**。这是 YouTube 和抖音都没有的信号，可用来绘制观众反应曲线和留存曲线。
- **跨境电商与选品research**：追踪某一品类的**开箱**和测评视频，读取评论，看清中国用户真正关心哪些卖点。
- **竞品对标**：对比**投币**和**收藏**这两个 B站特有的内容质量信号，而不只是播放量。
- **AI 语料与学术研究**：构建带日期、分区和互动数据的中文视频、评论、弹幕语料库。

### 📊 能采集到哪些字段？

#### 视频 — 每条视频一行

| 字段 | 说明 |
|---|---|
| `bvid`、`aid`、`url` | BV号、av号和视频直链 |
| `title`、`description`、`coverUrl` | 标题、简介、封面图 |
| `duration`、`durationSeconds` | 显示时长（`6:47`）与秒数 |
| `publishedAt`、`publishedDate`、`uploadedAt` | 发布时间（UTC ISO 8601）、日期、投稿时间 |
| `category`、`categoryId` | 分区名称与分区 id，例如 美食记录（211） |
| `views`、`danmakuCount`、`comments` | 播放量、弹幕数、评论数 |
| `likes`、`coins`、`favourites`、`shares` | 点赞、投币、收藏、分享 |
| `tags[]` | 视频标签 |
| `creatorMid`、`creatorName`、`creatorUrl`、`creatorAvatar` | UP主 mid、昵称、空间链接、头像 |
| `copyright` | `original` 自制 / `repost` 转载 |
| `partCount`、`parts[]` | 多 P 视频：每个分 P 的 cid、标题、时长 |
| `widthPx`、`heightPx` | 分辨率 |
| `dynamicText`、`shortLink`、`publishLocation` | 投稿动态文案、b23.tv 短链、IP 属地 |
| `honours[]` | 每周必看、排行榜等荣誉标识 |
| `likeRate`、`engagementRate`、`danmakuPerMinute` | 现成的比率：点赞率、互动率（点赞+投币+收藏+分享+评论）/播放、每分钟弹幕数 |
| `staff[]` | 联合投稿成员：mid、昵称、身份、空间链接、头像、粉丝数 |
| `noticeMessage` | B站在视频上展示的提示，如 含AI生成内容、个人观点，仅供参考 |
| `allowsDownload`、`noReprint`、`noShare`、`isPaid`、`isCollaboration`、`isInteractive`、`is360` | 下载 / 转载 / 分享权限与视频类型 |
| `watchingNow`、`watchingNowWeb` | 开启「在线观看人数」后附带 |
| `creatorFollowers`、`creatorFollowing`、`creatorVideoCount` | 开启「补充 UP主数据」后附带 |
| `trendingSource`、`trendingPosition`、`recommendedReason` | 榜单来源、榜上位置、推荐理由 |
| `searchKeyword`、`matchedInput` | 该行来自哪个关键词 / 链接 / 榜单 |

其中 `cid`、完整简介、`tags`、`copyright`、分 P、分辨率、IP 属地和荣誉需开启「**抓取视频详情页**」（每条视频多一次请求）。B站未展示的字段返回 `null`。

#### UP主 — 每位 UP主一行

`mid`、`name`、`url`、`avatar`、`signature` 签名、`followers` 粉丝数、`following` 关注数、`videoCount` 投稿数、`articleCount` 专栏、`audioCount` 音频、`albumCount` 相册、`seasonCount` 合集、`level` 等级、`isSeniorMember` 硬核会员、`verifiedType` 认证类型（个人 / 机构）、`verifiedNote` 认证说明、`isLive` 是否直播中、`liveRoomId`、`liveRoomUrl`、`latestVideos[]` 最新投稿（标题、链接、播放量、时长、日期）、`latestVideosAvgViews` 近期平均播放、`lastUploadDate` 最近更新日期。

#### 评论 — 每条评论一行

`commentId`、`parentCommentId` 父评论、`text` 内容、`likes` 点赞、`replyCount` 回复数、`publishedAt` 时间、`timeLabel`、`location` IP 属地、`isTop` 是否置顶、`authorMid`、`authorName`、`authorUrl`、`authorAvatar`、`authorLevel` 等级、`authorIsVip` 大会员、`authorSignature` 个性签名、`likedByCreator` UP主点赞、`repliedByCreator` UP主回复、`images[]` 评论图片，并附带视频上下文（`videoId`、`videoUrl`、`videoTitle`、`videoViews`、`creatorName`）。

#### 弹幕 — 每条弹幕一行

`danmakuId`、`text` 内容、`atSeconds` / `atTime` 出现位置、`mode` 弹幕类型（滚动 / 顶部 / 底部 / 逆向）、`fontSize` 字号、`color` 颜色、`senderHash` 发送者哈希、`sentAt` 发送时间、`pool` 弹幕池、`weight` 权重、`action`，同样附带视频上下文；多 P 视频还带 `partPage` / `partTitle`，因为**每个分 P 的弹幕都会采集，而不只是第一个**。

#### 热搜 — 每个热词一行

`rank` 排名、`keyword` 关键词、`displayName`、`iconUrl`、`searchUrl`。

### 🚀 使用步骤

1. 在 **Search keywords** 中填入一个或多个关键词，中英文均可（`美食`、`genshin impact`、`开箱`）。
2. 选择 **Data type**：`videos` 视频、`creators` UP主、`comments` 评论、`danmaku` 弹幕，默认 `videos`。
3. 按需筛选：**排序**（综合、最新发布、最多播放、最多弹幕、最多收藏、最多评论）、**时长**、**分区**、**发布时间区间**。
4. 也可填入 **Video URLs**（BV号、av号、视频链接或 b23.tv 短链）和 **Creator space URLs**（`https://space.bilibili.com/504799975` 或直接填 mid），或选择一个 **Trending board**（综合热门、排行榜、最新投稿、热搜）。
5. 设置 **Max rows**（默认 `100`，`0` 表示不限）。按条计费，首次运行建议设置上限。
6. 点击 **Start**。每个关键词会被搜索、在触顶时按发布日期自动拆分、按视频 id 去重，并每 100 条写入一次。
7. 在 **Storage** 标签页预览并导出 JSON、CSV、Excel、XML，或通过 API 读取数据集。

同样的任务可通过 Apify API、Python / JavaScript 客户端、MCP Server 调用，或设置为每日定时运行。

### 💡 可直接运行的示例

**1. 某游戏的最新相关视频**

```json
{ "keywords": ["原神", "genshin impact"], "dataType": "videos", "sortBy": "newest", "includeVideoDetails": true, "maxItems": 200 }
```

**2. 突破 1,000 条上限，采集一整个关键词**

```json
{ "keywords": ["原神"], "dataType": "videos", "deepSearch": true, "maxItems": 12000 }
```

实测返回 **12,000 条去重视频，覆盖 2017 年至今、88 个子分区**，共 19 次搜索、321 次请求，用时 3 分 21 秒，且只是因为达到 `maxItems` 才停止——同一关键词单次搜索仅约 725 条。`input_status` 会报告每个切片的采集结果。

**3. 寻找美食区 UP主**

```json
{ "keywords": ["美食"], "dataType": "creators", "maxItems": 100 }
```

**4. 某位 UP主的全部投稿**

```json
{ "creatorUrls": ["https://space.bilibili.com/504799975"], "dataType": "videos", "creatorVideos": 0, "includeVideoDetails": true }
```

**5. 逐秒观众反应（弹幕）**

```json
{ "videoUrls": ["https://www.bilibili.com/video/BV1p5p26fEWB"], "dataType": "danmaku", "maxDanmakuPerVideo": 1000 }
```

**6. 关键词相关视频的评论**

```json
{ "keywords": ["扫地机器人"], "dataType": "comments", "maxVideosPerSearch": 20, "maxCommentsPerVideo": 100, "includeCommentReplies": true }
```

**7. 今日热门与热搜**

```json
{ "trending": "popular", "maxVideosPerSearch": 100 }
```

```json
{ "trending": "hot_searches" }
```

**8. 科技区 10–30 分钟开箱视频，按播放量排序**

```json
{ "keywords": ["开箱"], "categories": ["tech"], "duration": "10_30min", "publishedAfter": "2026-09-01", "sortBy": "most_played" }
```

### 💰 价格：采集 B站数据要多少钱？

按条计费，无订阅，不额外收取平台用量费用：

| Apify 套餐 | 每 1,000 条 |
|---|---|
| Free / Starter | **$2.99** |
| Bronze | $2.63 |
| Silver | $2.39 |
| Gold 及以上 | $2.03 |

一条 = 一个视频 / 一位 UP主 / 一条评论 / 一条弹幕。启动一次任务 $0.00005。即：1,000 条视频 **$2.99**，10,000 条弹幕 **$29.90**，示例 2 中 2,000 条视频的深度搜索 **$5.98**。首次运行建议设置 **Max rows**。

### ⚙️ 性能与稳定性

- **无浏览器、无代理、无需登录**：平台实测 **1,500 条基础视频数据 / 27 秒**，平台用量 **$0.0022**；**1,000 条完整字段数据**（含详情页、标签、UP主数据）/ 3 分 40 秒，平台用量 **$0.021**，代理流量为 0。
- **突破搜索上限**：B站单次搜索约 1,000 条封顶。深度搜索按**分区 → 发布时间 → 时长 → 排序方式**递归拆分为互不重叠的切片，并按视频 id 全局去重，实测单关键词取得 **12,000 条去重视频**，覆盖 2017 年至今、88 个子分区，仅用 19 次搜索、321 次请求（单次搜索仅约 725 条）。
- **不会悄悄丢数据**：选 5 个分区就搜 5 个分区，而不是只搜第一个；采集 UP主投稿会翻到最后一页；多 P 视频的弹幕会逐 P 采集、合并并去重。
- **结果透明**：OUTPUT 中的 `input_status` 会列出每个关键词、链接或榜单采集了多少条、B站声明的结果总数、搜索被拆分成了几个时间窗口，以及为空的原因，不会出现「成功但没有数据」。
- **长任务安全**：任务接近超时时会先保存已采集数据再正常结束，同时遵守你设置的单次运行费用上限。
- **限流处理**：自动退避重试，临时失败会先重试再上报。

### 🔌 API 与集成

支持导出 JSON、CSV、Excel、XML、HTML，也可直接调用：

```bash
curl -X POST "https://api.apify.com/v2/acts/scrapifier~bilibili-scraper/run-sync-get-dataset-items?token=<YOUR_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"keywords":["美食"],"dataType":"videos","maxItems":100}'
```

兼容 Apify 的 Python / JavaScript 客户端、定时任务、Webhook、面向 AI Agent 的 MCP Server，以及 Make、Zapier、n8n、LangChain、Google Sheets、Airtable。

### ❓ 常见问题

**需要 B站账号或 Cookie 吗？** 不需要。视频、UP主、弹幕、榜单和搜索都无需任何凭证。唯一的例外是评论：公开评论接口只提供每个视频的热门楼层。如果需要完整评论楼层，可在可选的 SESSDATA 字段中填入你自己浏览器登录后的 `SESSDATA` 值。若某条视频的评论只取到部分，OUTPUT 会明确说明。

**需要代理吗？** 不需要。除非你的流程要求特定出口国家，否则保持关闭即可。

**一个关键词最多能采集多少条？** B站本身约 1,000 条封顶。开启深度搜索后，真正的上限只有你设置的 `maxItems`：测试关键词已取得 12,000 条去重视频（2017 年至今），仅因达到 `maxItems` 而停止。

**支持英文关键词吗？** 支持。`genshin impact`、`minecraft`、`python tutorial` 均可，中文关键词同样可用。标题、标签和评论按原文返回，已去除搜索高亮标记。

**为什么 `danmakuCount` 比弹幕行数多？** `danmakuCount` 是视频页显示的累计弹幕数，而弹幕行来自播放器当前为各时间段提供的弹幕。

**可以每天监控一个关键词或一位 UP主吗？** 可以。设置 Apify 定时任务，把 `publishedAfter` 设为前一天，再用 Webhook 把新数据推送到数据仓库或 Slack。

**合规吗？** 本工具只读取公开展示的页面和数据，与普通访客所见一致，不会代替你登录。请自行确保数据用途符合相关法律与 B站条款。

### 🔗 其他采集工具

[Trustpilot](https://apify.com/scrapifier/trustpilot-reviews-scraper) · [Capterra](https://apify.com/scrapifier/capterra-reviews-scraper) · [Quora](https://apify.com/scrapifier/quora-scraper) · [Airbnb](https://apify.com/scrapifier/airbnb-scraper) · [Vinted](https://apify.com/scrapifier/vinted-scraper) · [StockX](https://apify.com/scrapifier/stockx-scraper) · [GOAT](https://apify.com/scrapifier/goat-sneakers-scraper)

### 💬 Support

Found a bug, a missing field or a keyword that returns nothing? Open an issue on the Actor's **Issues** tab with your input and the run id — 有问题请在 Issues 标签页反馈，附上输入参数和 run id。

# Actor input Schema

## `keywords` (type: `array`):

What to search on Bilibili. Chinese and English both work ("美食", "genshin impact"). One search per keyword; with Deep search on, each search is split by publication date until every matching video is reached.

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

Specific videos: https://www.bilibili.com/video/BV1p5p26fEWB, a BV id, an av id, or a b23.tv share link. Each one always gets its full video page.

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

Creators: https://space.bilibili.com/504799975 or just 504799975. In Videos mode you get their uploads, in Creators mode their profile.

## `dataType` (type: `string`):

Videos: one row per video with views, danmaku, comments, likes, coins, favourites and shares. Creators: one row per UP主. Comments and Danmaku: one row each, read from the videos your keywords, video URLs or creators resolve to.

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

Collect a board instead of (or on top of) a keyword search. Ranking and Newest follow the categories selected below.

## `sortBy` (type: `string`):

Applied by Bilibili itself to every keyword search.

## `duration` (type: `string`):

Filter keyword searches by video length.

## `categories` (type: `array`):

Empty = every category. Each category you select is searched separately, so none is dropped; they are also used by the Ranking and Newest boards. A few zones publish no "newest" feed — the run reports it per input.

## `publishedAfter` (type: `string`):

YYYY-MM-DD. Only videos published on or after this date.

## `publishedBefore` (type: `string`):

YYYY-MM-DD. Only videos published on or before this date.

## `deepSearch` (type: `boolean`):

Bilibili stops every keyword search at about 1,000 results. When a search fills up it is split into disjoint slices — by category 分区 first (the highest-yield cut), then by publication-date window, then by video length, then by the remaining sort orders — and every slice is deduplicated by video id. A saturated keyword returned 5,000+ unique videos this way instead of ~725. Turn off for a quick single-pass search.

## `includeVideoDetails` (type: `boolean`):

Adds the full description, tags, category, coins, favourites, shares, parts, resolution, publish location and honours to every video row. One extra request per video.

## `includeCreatorStats` (type: `boolean`):

Adds the creator's follower count, following count and total video count to every video row.

## `includeOnlineViewers` (type: `boolean`):

Adds how many people are watching each video right now (在线人数) to every video row. One extra request per video.

## `creatorVideos` (type: `integer`):

In Videos mode, how many uploads to collect for each creator URL. 0 = every upload they have.

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

Comments mode only. 0 = as many as the comment feed serves.

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

Comments mode only. Also collects the replies under each comment, linked by parentCommentId.

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

Comments mode only.

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

Danmaku mode only. 0 = every bullet comment the player serves for that video.

## `sessionCookie` (type: `string`):

Optional, and only for comments. The public comment feed serves the top replies of each video; paste your own SESSDATA value, copied from a browser where you are logged in, to export whole threads. Videos, creators, danmaku and trending boards never need it.

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

Cap for each keyword, creator or trending board separately. 0 = no per-search cap.

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

Hard stop for the run, across every input. 0 = no limit.

## `flatten` (type: `boolean`):

Turns lists and objects (tags, parts, latest videos) into single text columns, so a CSV or Excel export stays readable.

## `emitInputStatus` (type: `boolean`):

Adds an input_status report to the run's OUTPUT record: rows collected per keyword, URL or board, the count Bilibili announced, and why anything came back empty.

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

Not needed — this Actor reads Bilibili directly. Only switch a proxy on if your own runs need a specific exit country.

## `debug` (type: `boolean`):

Adds extra detail to the run log when you are debugging an input.

## Actor input object example

```json
{
  "keywords": [
    "genshin impact"
  ],
  "dataType": "videos",
  "trending": "none",
  "sortBy": "relevance",
  "duration": "any",
  "deepSearch": true,
  "includeVideoDetails": false,
  "includeCreatorStats": false,
  "includeOnlineViewers": false,
  "maxCommentsPerVideo": 100,
  "includeCommentReplies": false,
  "commentSort": "top",
  "maxDanmakuPerVideo": 500,
  "maxItems": 100,
  "flatten": false,
  "emitInputStatus": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "debug": false
}
```

# Actor output Schema

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

All video / creator / comment / danmaku rows extracted by this run.

# 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 = {
    "keywords": [
        "genshin impact"
    ],
    "maxCommentsPerVideo": 100,
    "maxDanmakuPerVideo": 500,
    "maxItems": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapifier/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 = {
    "keywords": ["genshin impact"],
    "maxCommentsPerVideo": 100,
    "maxDanmakuPerVideo": 500,
    "maxItems": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("scrapifier/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 '{
  "keywords": [
    "genshin impact"
  ],
  "maxCommentsPerVideo": 100,
  "maxDanmakuPerVideo": 500,
  "maxItems": 100
}' |
apify call scrapifier/bilibili-scraper --silent --output-dataset

```

## MCP server setup

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