# Bilibili Scraper API - Search, Danmaku, Video Stats, Monitor (`reportable_broth/bilibili-scraper`) Actor

Bilibili (哔哩哔哩, the Chinese YouTube) scraper API, no login: video search with sort and date filters, video stats (views, likes, coins, favorites, shares), tags, danmaku (弹幕) with timestamps, top comments, uploader profiles and popular videos. Monitor mode returns new videos only. $2.49 per 1,000.

- **URL**: https://apify.com/reportable\_broth/bilibili-scraper.md
- **Developed by:** [Quiet Harvest](https://apify.com/reportable_broth) (community)
- **Categories:** Social media, Videos, Marketing
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.49 / 1,000 items

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

A Bilibili scraper (哔哩哔哩, B站) that needs no login: video search, full video stats, danmaku (弹幕) with the second they appear, top comments, uploader profiles and the popular list.

$2.49 per 1,000 items. No cookie needed.

### What does Bilibili Scraper do?

- **Search.** Up to 1,000 videos per keyword. Sort by relevance, views, newest, danmaku, favorites or comments. Filter by length and publish date.
- **Video details.** Views, likes, coins, favorites, shares, danmaku and comment counts, tags.
- **Danmaku.** Each bullet comment with its text, the second it shows up, when it was sent, and its color.
- **Top comments.** The pinned and top ones Bilibili shows to visitors, usually 3.
- **Uploaders (UP主).** Followers, following, video count, likes received, level, verification.
- **Popular.** The current 热门 list.

### What can I use it for?

- Find the most-viewed or newest videos on a topic, within a date range.
- See which moments of a video got the most danmaku.
- Compare uploaders by followers, likes received and level.
- Check new videos on a keyword every hour.
- Save the 热门 list to see what's trending.

### How do I use it?

1. Open the actor on Apify and click Try for free. A free Apify account is enough to start.
2. Add keywords, video links (BV ids and b23.tv links work) or uploader links. You can mix them in one run.
3. Turn on extras if you want them: `fullDetails`, `danmakuPerVideo`, `topComments`. Keep `danmakuPerVideo` small on big searches.
4. Click Start. No login or cookie is needed.
5. When it finishes, open the Output tab and download JSON, CSV or Excel. Or read the dataset through the API.

### Examples

New videos on a keyword since a date, newest first:

```json
{ "searchKeywords": ["露营", "iPhone 17"], "maxVideosPerKeyword": 100, "sort": "newest", "publishedAfter": "2026-09-01" }
```

Danmaku and top comments for one video:

```json
{ "videoUrls": ["https://www.bilibili.com/video/BV1cXNW6XEeC"], "danmakuPerVideo": 500, "topComments": true }
```

An uploader's profile and the popular list:

```json
{ "users": ["https://space.bilibili.com/1864674231"], "popularVideos": 50 }
```

### Input

| Field | Default | |
|---|---|---|
| `searchKeywords` | `[]` | Chinese or English |
| `maxVideosPerKeyword` | `50` | Max 1,000 |
| `sort` | `relevance` | `relevance`, `views`, `newest`, `danmaku`, `favorites`, `comments` |
| `duration` | `any` | `any`, `under10`, `10to30`, `30to60`, `over60` (minutes) |
| `publishedAfter`, `publishedBefore` | | YYYY-MM-DD, China time |
| `videoUrls` | `[]` | BV/av URLs, BV ids or b23.tv links |
| `users` | `[]` | space.bilibili.com/<id> or the id |
| `popularVideos` | `0` | 0 = off |
| `fullDetails` | `false` | Coins, shares, tags, cid for search/popular videos |
| `danmakuPerVideo` | `0` | Applies to every video returned |
| `topComments` | `false` | Applies to every video returned |
| `onlyNew` | `false` | Skip items returned in earlier runs |
| `requestGapSecs` | `1` | Seconds between requests |

### What data do I get?

Rows have a `type`: `video`, `danmaku`, `comment` or `user`.

```json
{
  "type": "video",
  "id": "BV1cXNW6XEeC",
  "url": "https://www.bilibili.com/video/BV1cXNW6XEeC",
  "title": "...",
  "author": "...",
  "publishedAt": "2026-09-18T07:38:24+00:00",
  "durationSec": 612,
  "views": 48200, "likes": 3100, "coins": 820, "favorites": 1500,
  "danmaku": 960, "comments": 210,
  "tags": ["露营"]
}
```

Also: `aid`, `description`, `authorId`, `authorUrl`, `shares`, `category`, `cover`, `cid`. Danmaku rows have `text`, `atSec`, `sentAt`, `color`.

Text comes back as posted, mostly Simplified Chinese. Nothing is translated.

### Limits

- Visitors only see the top ~3 comments per video. That's Bilibili's rule. Danmaku aren't limited, a popular video gives thousands.
- An uploader's full video list and deep comment threads need a login, so they're not in here yet.
- Coins and shares aren't in search results. Turn on `fullDetails` for them (one extra request per video). Video URLs always get full details.
- Each danmaku line is one item and `danmakuPerVideo` applies to every video. Keep it small on big searches.
- One IP per run, switched when Bilibili pushes back. If it keeps pushing back the run stops and you only pay for what was delivered.

### How much does it cost?

$2.49 per 1,000 items. Videos, danmaku lines, comments and uploader profiles each count as one. There's no separate compute charge.

Some real numbers:

- 1,000 videos from one keyword: 1,000 × $0.00249 = $2.49.
- 100 videos with top comments (about 3 each): about 400 items = about $1.00.
- 100 videos with 200 danmaku each: 100 + 20,000 = 20,100 items = $50.05. This is why `danmakuPerVideo` should stay small on searches.

With `onlyNew` on and a schedule (hourly, say), each run only returns and charges for new videos, danmaku and comments. Apify's free plan gives you $5 of credit a month. That's about 2,000 items here.

### FAQ

**Do I need a Bilibili account or cookie?**
No. Everything here uses what Bilibili shows to logged-out visitors.

**Why do I only get about 3 comments per video?**
That's all Bilibili shows to visitors. Danmaku don't have this limit, so use `danmakuPerVideo` if you want audience reactions in bulk.

**Why did I get fewer videos than I asked for?**
Bilibili search stops at 1,000 videos per keyword, and date or length filters can leave fewer. With `onlyNew` on, videos from earlier runs are skipped on purpose.

**Can I schedule it?**
Yes. Save your input as a Task, add a Schedule, and turn on `onlyNew` so each run only returns new items.

### Other scrapers I made

- [Weibo Scraper](https://apify.com/reportable_broth/weibo-scraper), [RedNote / Xiaohongshu](https://apify.com/reportable_broth/rednote-xiaohongshu-scraper), [Douyin](https://apify.com/reportable_broth/douyin-scraper)
- [Threads Scraper & Monitor](https://apify.com/reportable_broth/threads-scraper-monitor), [YouTube Monitor](https://apify.com/reportable_broth/youtube-scraper-monitor)

Found a bug or need a field? Open an issue on the Issues tab.

### 中文说明

不用登录，抓 B 站视频搜索（可按播放、最新、弹幕、收藏排序，可筛时长和发布日期）、视频数据（播放、点赞、投币、收藏、分享）、带出现秒数的弹幕、热门评论、UP 主资料和热门视频。每 1,000 条 $2.49。

***

Only collects public data. You're responsible for how you use it.

# Actor input Schema

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

Video search, Chinese or English. Up to 1,000 videos per keyword.

## `maxVideosPerKeyword` (type: `integer`):

Bilibili returns up to 50 pages of 20.

## `sort` (type: `string`):

Search order.

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

Search filter.

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

Search filter, China time. Leave empty for any date.

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

Search filter, China time.

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

bilibili.com/video/BV..., av numbers, BV ids or b23.tv short links. Returns full details and tags.

## `users` (type: `array`):

space.bilibili.com/<id> or the numeric id. Returns followers, video count, likes received, level and verification.

## `popularVideos` (type: `integer`):

How many of Bilibili's current popular videos to return. 0 = off.

## `fullDetails` (type: `boolean`):

Adds coins, shares, exact duration, tags and the cid for each video (one extra request per video).

## `danmakuPerVideo` (type: `integer`):

Bullet comments with the second they appear. Applies to EVERY video returned (search, popular and URLs), and each danmaku line is one item - use a small number with big searches. 0 = off.

## `topComments` (type: `boolean`):

The pinned and top comments Bilibili shows without login (usually 3 per video). Applies to every video returned.

## `onlyNew` (type: `boolean`):

Schedule the Actor; each run returns only items earlier runs haven't returned.

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

Runs with the same inputs share memory automatically.

## `requestGapSecs` (type: `number`):

Default 1 s.

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

The Actor switches IP automatically when Bilibili pushes back.

## Actor input object example

```json
{
  "searchKeywords": [
    "露营"
  ],
  "maxVideosPerKeyword": 50,
  "sort": "relevance",
  "duration": "any",
  "videoUrls": [],
  "users": [],
  "popularVideos": 0,
  "fullDetails": false,
  "danmakuPerVideo": 0,
  "topComments": false,
  "onlyNew": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "searchKeywords": [
        "露营"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("reportable_broth/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 = {
    "searchKeywords": ["露营"],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("reportable_broth/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 '{
  "searchKeywords": [
    "露营"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call reportable_broth/bilibili-scraper --silent --output-dataset

```

## MCP server setup

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