# Bilibili (哔哩哔哩) Video Scraper ✅ NO COOKIES (`atomus/bilibili-scraper`) Actor

Scrape Bilibili (哔哩哔哩) by keyword or URL: video search, video details, comments, UP主 profiles, danmaku (弹幕 bullet-comments), and native subtitle transcripts, plus trending. No cookies, no login. Fast structured JSON. Pay only for results returned; failed lookups are free.

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

## Pricing

from $8.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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Bilibili Scraper: Videos, Comments, Danmaku (弹幕) & Native Subtitles

Scrape **Bilibili (哔哩哔哩 / B站)** by keyword or URL, video search, video details, comments, UP主 (creator) profiles, **danmaku (弹幕 bullet-comments)**, **native subtitle transcripts**, and trending. **No cookies. No login.** Give it a keyword or a plain video link and it returns clean, structured JSON, and you pay only for the results you get back.

This is the only Bilibili scraper on Apify that extracts both **raw danmaku bullets** and Bilibili's **native subtitle track** as a transcript, instantly, at any video length, with no cookie and no audio re-transcription.

***

### What is Bilibili?

Bilibili (哔哩哔哩, "B站") is one of China's largest video platforms, 300M+ monthly users, huge in anime, gaming, tech, and education. Its signature feature is **danmaku (弹幕)**: real-time comments that scroll across the video as it plays. Bilibili also has its own engagement metrics, **coins (投币)** and **favorites (收藏)** on top of the usual views, likes, and replies, all of which this scraper captures.

### Is there an official Bilibili API?

There is no public, international Bilibili API. Bilibili's developer platform requires Chinese phone verification and is heavily rate-limited, and most public data sits behind WBI request signing. This actor is the practical **Bilibili API alternative**: it handles the signing and returns structured JSON with zero authentication, no cookie, no account, no proxy setup.

***

### What data can you extract from Bilibili?

Pick a mode with the **What to scrape** dropdown. Each mode is billed as its own event, and you only pay for results returned.

| Mode | Input | Returns |
|---|---|---|
| **Keyword search → videos** | keyword(s) | Videos: title, description, views, likes, coins, favorites, danmaku count, replies, author, duration, tags, category |
| **Video detail** | video URL / BV id | Full video: all engagement stats, owner, category, publish date, resolution, copyright (original/repost), and the full **per-part (分P) breakdown** (every episode's `cid`, title, duration) |
| **Video comments** | video URL / BV id | Comments: text, likes, reply count, author, timestamp, **IP location (归属地)**, commenter level/VIP/verified, whether the **UP主 liked/replied**, and up to 3 free reply previews per comment |
| **Danmaku (弹幕)** | video URL / BV id | Bullet-comments: text, timestamp in the video, send time, mode, color |
| **Transcript (native CC)** | video URL / BV id | Native subtitle track parsed into timed segments + joined full text |
| **UP主 profile** | space URL / UID | Creator card: name, avatar, signature, level, fans, following, verification, VIP |
| **UP主 videos** | space URL / UID | Every video a creator posted: title, views, danmaku count, duration, category, `cid`, publish date |
| **Trending** | (none) | Trending videos (热门) or hot search terms (热搜) |

#### Two things no other Bilibili scraper does well

- **Raw danmaku (弹幕).** Bilibili's scrolling bullet-comments are a data source no other platform has. Each call returns a full danmaku pool, often **1,000+ bullets**, each with its exact timestamp in the video, so you can map audience reaction to the moment it happened. (Other actors only sell an aggregated "reaction profile"; this returns the raw bullets.)
- **Native transcripts.** When a video has a Bilibili subtitle track (including the auto-generated `ai-zh` one), this actor returns it directly as timed segments and full text, **instantly, at any length**. No audio download, no speech-to-text step, no 5-minute cap.

***

### How do I scrape Bilibili? (3 steps)

1. **Pick a mode** in **What to scrape** (search, video detail, comments, danmaku, transcript, profile, UP主 videos, or trending).
2. **Give it input**, one or more keywords for search, or Bilibili video URLs / BV ids (e.g. `BV1rpWjevEip`) for the video modes, or a UP主 space URL / UID for profile and UP主 videos.
3. **Run it** and collect the structured results from the dataset (via the Console, the Apify API, or your language client).

***

### Input

| Field | Used by | Example |
|---|---|---|
| `searchType` | all | `"danmaku"` |
| `keywords` | search | `["编程", "游戏"]` |
| `videoUrls` | video detail, comments, danmaku, transcript | `["https://www.bilibili.com/video/BV1rpWjevEip"]` |
| `userUrls` | profile, UP主 videos | `["https://space.bilibili.com/178360345"]` |
| `maxItems` | search, comments, UP主 videos, trending | `50` |
| `sortOrder` | search | `"totalrank"` (or `click`, `pubdate`, `dm`, `stow`) |
| `includeReplies` | comments | `false` (ON also fetches full reply threads; each reply billed as one comment, capped by `maxItems`) |
| `durationFilter` | search | `"any"` (or `short`, `medium`, `long`, `verylong`) |
| `publishedAfter` / `publishedBefore` | search | `"2020-01-01"` / `"2020-12-31"` (free date-range filter) |
| `trendType` | trending | `"videos"` or `"keywords"` |

Video inputs accept a full URL (`https://www.bilibili.com/video/BV…`) or a bare **BV id** (`BV1rpWjevEip`).

**Example: danmaku from one video**

```json
{
  "searchType": "danmaku",
  "videoUrls": ["https://www.bilibili.com/video/BV1rpWjevEip"]
}
```

**Example: keyword search**

```json
{
  "searchType": "search",
  "keywords": ["编程", "游戏"],
  "sortOrder": "totalrank",
  "maxItems": 50
}
```

***

### Output

Search / video-detail item:

```json
{
  "searchType": "search",
  "bvid": "BV1rpWjevEip",
  "aid": "113006243481679",
  "title": "【全748集】Python零基础全套教程",
  "url": "https://www.bilibili.com/video/BV1rpWjevEip",
  "view_count": 18738611,
  "like_count": 497530,
  "coin_count": 361759,
  "favorite_count": 774826,
  "danmaku_count": 123656,
  "reply_count": 329821,
  "duration": 143894,
  "category": "计算机技术",
  "tags": ["Python教程", "编程语言"],
  "owner": { "mid": "3546597933714079", "name": "Python官方课程" }
}
```

Danmaku item:

```json
{
  "searchType": "danmaku",
  "video": "BV1rpWjevEip",
  "text": "老大 我们真的能学会吗",
  "progress": 71.774,
  "mode": 1,
  "color": 16777215,
  "ctime": 1783262069
}
```

Transcript item:

```json
{
  "searchType": "transcript",
  "video": "BV1rpWjevEip",
  "available": true,
  "lang": "ai-zh",
  "segments": [{ "from": 0.5, "to": 3.2, "content": "大家好" }],
  "text": "大家好 …"
}
```

***

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

You pay per result, per mode. **Gold and higher Apify plans get 20% off** every event, and **failed lookups are free**.

| Mode | Event | Price | Gold (−20%) |
|---|---|---|---|
| Keyword search | `video-scraped` | $0.01 / video | $0.008 |
| Video detail | `video-detail-scraped` | $0.02 / video | $0.016 |
| Comments | `comment-scraped` | $0.008 / comment (min 2) | $0.0064 |
| UP主 profile | `profile-scraped` | $0.012 / profile | $0.0096 |
| UP主 videos | `video-scraped` | $0.01 / video | $0.008 |
| Danmaku | `danmaku-scraped` | $0.01 / video | $0.008 |
| Transcript | `transcript-scraped` | $0.01 / video | $0.008 |
| Trending | `trend-scraped` | $0.008 / result (min 2) | $0.0064 |

**Free to try:** on the free Apify plan you can sample the actor each month, 10 search results plus one of each other mode, so you can inspect every field before paying. Any paid Apify plan removes the cap.

***

### Bilibili Scraper vs cookie-based tools vs the official API

| | This actor | Cookie / login scrapers | Official Bilibili API |
|---|---|---|---|
| Authentication | **None** | Logged-in cookie / session | Chinese phone verification |
| Breaks when a cookie expires | No | Yes | n/a |
| International access | **Yes** | Varies | Restricted |
| Danmaku (弹幕) raw bullets | **Yes** | Rare | Manual |
| Native subtitle transcript | **Yes** | Rare | Manual |
| Billing | **Pay per result** | Varies | Quota-limited |

***

### Use cases

- **Trend & topic research**: search a keyword, rank by plays or danmaku, track what's rising.
- **Audience reaction analysis**: pull raw danmaku with timestamps to find the exact moments viewers reacted.
- **Content & subtitle mining**: grab native transcripts for summarization, translation, or search indexing.
- **Creator (UP主) research**: profiles with fans, level, and verification for influencer shortlists.
- **Comment analysis**: sentiment and themes from a video's comment threads.

### Use it with AI agents and MCP

Every Apify actor is callable from the Apify API and from AI agent frameworks (MCP, LangChain, and similar), so this scraper can feed a Bilibili research or monitoring agent directly.

***

### FAQ

**Is it legal to scrape Bilibili?** This actor only accesses publicly available data through Bilibili's public endpoints, the same data any visitor sees without logging in. It does not bypass authentication or access private data. Review your local laws and Bilibili's terms of service for your use case.

**Is there an official Bilibili API?** No public international one, see above. This actor is the practical alternative, with no authentication.

**What is danmaku (弹幕)?** Real-time comments that scroll across a Bilibili video as it plays. This actor returns them as raw bullets with the exact timestamp each one appears.

**Can I get a video's transcript?** Yes, the transcript mode returns Bilibili's native subtitle track (including auto-generated `ai-zh`) as timed segments and full text, at any video length.

**Can I use it from Python or JavaScript?** Yes. Call the actor with the Apify client for your language (`apify-client`) and read the results from the run's dataset.

**How much does it cost?** See the pricing table above, per result, per mode, with 20% off on Gold+ plans and free failed lookups.

***

### More scrapers by Atomus

Atomus builds reliable, no-cookie data scrapers. See the full lineup on the [Atomus Apify page](https://apify.com/atomus).

### Disclaimer

This actor scrapes publicly available data only. "Bilibili" and "哔哩哔哩" are trademarks of their respective owner; this actor is independent and not affiliated with or endorsed by Bilibili. Use the data in compliance with Bilibili's terms and applicable law.

***

## 哔哩哔哩 (Bilibili) 采集器

无需 **Cookie**、无需**登录**，按**关键词或链接**抓取哔哩哔哩（B站）数据：视频搜索、视频详情、评论、UP主主页、**弹幕**、**原生字幕转写**、热门/热搜。只需提供关键词或视频链接，即可返回干净的结构化 JSON，只为返回的结果付费。

这是 Apify 上唯一同时提取**原生弹幕**和 B站**原生字幕轨道**（转写文本）的哔哩哔哩采集器——即时、不限时长、无需 Cookie、无需音频重新转写。

### 模式

| 模式 | 输入 | 返回 |
|---|---|---|
| **关键词搜索视频** | 关键词 | 视频：标题、简介、播放、点赞、投币、收藏、弹幕数、评论数、作者、时长、标签、分区 |
| **视频详情** | 视频链接 / BV号 | 完整视频：全部互动数据、UP主、分区、`cid`、发布时间、清晰度、原创/转载，以及完整**分P列表**（每个分P的 `cid`、标题、时长） |
| **视频评论** | 视频链接 / BV号 | 评论：内容、点赞、回复数、作者、时间、**IP属地**、评论者等级/大会员/认证、**UP主是否点赞/回复**，以及每条最多 3 条免费楼中楼预览 |
| **弹幕** | 视频链接 / BV号 | 弹幕：内容、出现时间、发送时间、模式、颜色 |
| **字幕/转写** | 视频链接 / BV号 | 原生字幕轨道，解析为带时间轴的分段 + 全文 |
| **UP主主页** | 主页链接 / UID | UP主信息：昵称、头像、签名、等级、粉丝、关注、认证、大会员 |
| **UP主投稿视频** | 主页链接 / UID | UP主的全部投稿视频：标题、播放、弹幕数、时长、分区、`cid`、发布时间 |
| **热门** | （无） | 热门视频（热门）或热搜关键词（热搜） |

### 定价

按结果计费，只为返回的结果付费。**Gold 及以上 Apify 套餐享全部事件 8 折，失败的查询免费。** 免费套餐每月可试用：10 条搜索结果 + 其他每个模式各 1 条，付费前先查看字段；升级任意付费套餐即可解除上限。

| 模式 | 事件 | 价格 | Gold（−20%） |
|---|---|---|---|
| 关键词搜索 | `video-scraped` | $0.01 / 视频 | $0.008 |
| 视频详情 | `video-detail-scraped` | $0.02 / 视频 | $0.016 |
| 评论 | `comment-scraped` | $0.008 / 条（最少2） | $0.0064 |
| UP主主页 | `profile-scraped` | $0.012 / 个 | $0.0096 |
| UP主投稿视频 | `video-scraped` | $0.01 / 视频 | $0.008 |
| 弹幕 | `danmaku-scraped` | $0.01 / 视频 | $0.008 |
| 字幕/转写 | `transcript-scraped` | $0.01 / 视频 | $0.008 |
| 热门 | `trend-scraped` | $0.008 / 条（最少2） | $0.0064 |

### 两大差异化能力

- **原生弹幕。** B站标志性的滚动即时评论，是其他平台没有的数据源。每次调用返回整段弹幕池（通常1000+条）及其在视频中的精确时间点。
- **原生字幕转写。** 当视频有 B站字幕轨道（包括自动生成的 `ai-zh`）时，直接返回带时间轴的分段与全文——即时、不限时长、无需下载音频或重新转写。

### 常见问题

**抓取哔哩哔哩合法吗？** 本采集器仅访问公开可见的数据（无需登录即可查看的数据），不绕过任何认证，不访问私密数据。请根据你的使用场景遵守当地法律与哔哩哔哩的服务条款。

**有官方 API 吗？** 没有面向国际开发者的公开 API。本采集器即为实用的替代方案，无需任何认证。

### 免责声明

本采集器仅抓取公开可见的数据。「哔哩哔哩」「Bilibili」为其各自所有者的商标；本采集器为独立产品，与哔哩哔哩无隶属或背书关系。

# Actor input Schema

## `searchType` (type: `string`):

Choose the mode. EVERY mode is paid: the run is billed per result by the mode you pick here (price shown in each option below). Each mode uses a different input field and is billed as its own event; failed lookups are free, Gold+ Apify plans get 20% off. // 请选择模式。所有模式均按结果计费，价格见下方各选项。不同模式使用下方不同的输入字段并按各自事件计费；查询失败不收费，Gold 及以上套餐享 8 折。

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

Used by "Keyword search" ($0.01 per video returned). One or more search terms, e.g. "编程" (programming), "游戏" (games). // 用于「关键词搜索」（每返回一个视频 $0.01），可填写一个或多个关键词。

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

Used by "Video detail" ($0.02/video), "Comments" ($0.008/comment, min 2), "Danmaku" ($0.01/video), and "Transcript" ($0.01/video). Paste video URLs (https://www.bilibili.com/video/BV...) or bare BV IDs (BV1rpWjevEip). // 用于「视频详情」（$0.02/条）「评论」（$0.008/条，最低 2 条）「弹幕」（$0.01/视频）「字幕」（$0.01/视频），可粘贴视频链接或BV号。

## `userUrls` (type: `array`):

Used by "UP主 profile" ($0.012 per user) and "UP主 videos" ($0.01 per video returned). Paste space URLs (https://space.bilibili.com/178360345) or bare numeric UIDs. // 用于「UP主主页」（每个用户 $0.012）和「UP主投稿视频」（每返回一个视频 $0.01），可粘贴主页链接或纯数字UID。

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

How many results to return per keyword or target for list modes (search, comments, UP主 videos, trending). ⚠️ This is your main cost lever: those modes bill per result, so total cost ≈ mode price × results (up to this cap) × targets. Video detail / profile return one record per target; danmaku and transcript return the full set from a single call. // 每个关键词或目标返回的最大结果数（搜索/评论/UP主投稿/热门）。⚠️ 这是主要的费用控制项：上述模式按结果计费，总费用≈模式单价×结果数（不超过此上限）×目标数。视频详情/主页每个目标一条；弹幕与字幕按单次调用返回全部。

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

Only for "Keyword search". How to sort results. // 仅用于「关键词搜索」，结果排序方式。

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

Only for "Keyword search". Filter results by video length. Free. // 仅用于「关键词搜索」，按视频时长筛选，免费。

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

Only for "Keyword search". Return only videos published on or after this date (YYYY-MM-DD). Free. // 仅用于「关键词搜索」，仅返回该日期（含）之后发布的视频，格式 YYYY-MM-DD，免费。

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

Only for "Keyword search". Return only videos published on or before this date (YYYY-MM-DD). Free. // 仅用于「关键词搜索」，仅返回该日期（含）之前发布的视频，格式 YYYY-MM-DD，免费。

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

Only for "Video comments". Off by default, each top-level comment still ships up to 3 reply previews for free. Turn ON to also fetch every reply (楼中楼) in each thread. Each reply is a comment, so it is billed as one comment ($0.008), and "Max results" caps the total (comments + replies). // 仅用于「视频评论」。默认关闭，每条评论仍免费附带最多 3 条楼中楼预览；开启后抓取每条评论下的全部楼中楼。回复即评论，按评论计费（$0.008/条），「最大结果数」限制总量（评论+回复）。

## `trendType` (type: `string`):

Only for "Trending" ($0.008 per result, min 2). Return trending videos (热门视频) or hot search terms (热搜词). // 仅用于「热门」（$0.008/条，每次最低 2 条），返回热门视频或热搜关键词。

## Actor input object example

```json
{
  "searchType": "search",
  "keywords": [
    "编程"
  ],
  "maxItems": 20,
  "sortOrder": "totalrank",
  "durationFilter": "any",
  "includeReplies": false,
  "trendType": "videos"
}
```

# Actor output Schema

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

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

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

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "keywords": [
        "编程"
    ],
    "publishedAfter": "",
    "publishedBefore": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("atomus/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": ["编程"],
    "publishedAfter": "",
    "publishedBefore": "",
}

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

```

## MCP server setup

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