# Bilibili Scraper: Videos, Trending & Danmaku (`cirkit/bilibili-scraper`) Actor

Scrape Bilibili (哔哩哔哩) videos by keyword, trending board, category ranking, video URL or creator. Get views, likes, coins, favorites, danmaku and comment counts, tags, creator followers, plus the danmaku bullet comments themselves. No login or cookies.

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

## Pricing

$2.00 / 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.

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 is Bilibili Scraper?

**Bilibili Scraper** lets you extract videos, trending boards, creator profiles and danmaku (弹幕, bullet comments) from Bilibili (哔哩哔哩, B站), helping you track what is going viral in China, measure creators and brands on China's biggest youth video platform, and feed Chinese-language video data into research, dashboards and AI pipelines. No Bilibili account, no cookies and no API key.

- 🔎 **Monitor any keyword or brand:** search Bilibili in Chinese or English and get up to 1,000 videos per keyword with views, likes, favorites, danmaku count, comment count, tags, creator and publish date. Filter by length and date window, sort by views, newest, danmaku or favorites.
- 🔥 **Catch trends early:** pull the "popular right now" hot board or the top-100 ranking of any category (gaming, tech, knowledge, music, food, anime and 13 more) in a few seconds.
- 👤 **Benchmark creators (UP主):** get a creator's followers, total likes, video count, level and verification, then every upload newest first.
- 💬 **Read the audience in real time:** danmaku are the comments viewers pin to a specific second of a video. Get each one with the exact video second, text, color, display mode and send time, which is ideal for sentiment analysis and highlight detection.
- 📊 **Full engagement stats:** turn on full details to add coins (Bilibili's tipping signal), shares, likes, tags and part count to every video.

Bilibili has no public data API for outsiders and its site shows one page of 20 results at a time. Bilibili Scraper runs on Apify's cheap datacenter proxy, rotates refused exits automatically, and returns clean JSON, CSV or Excel at **$2.00 per 1,000 results**, a tenth of the leading Bilibili actor.

### What data does Bilibili Scraper extract?

**Videos** (search, trending, video URLs, creator uploads)

- 🎬 Title, description, cover image and video URL (`title`, `description`, `coverUrl`, `url`)
- 🆔 BV id, av id and part id (`bvid`, `aid`, `cid`)
- ▶️ Views, likes, coins, favorites and shares (`views`, `likes`, `coins`, `favorites`, `shares`)
- 💬 Danmaku count and comment count (`danmakuCount`, `commentCount`)
- ⏱ Duration in seconds and publish time in UTC (`durationSeconds`, `publishedAt`)
- 🗂 Category name and id, tags (`category`, `categoryId`, `tags`)
- 👤 Creator name, id, space URL and avatar (`authorName`, `authorId`, `authorUrl`, `authorAvatarUrl`)
- ✅ Original content flag, number of parts, hot board label (`isOriginal`, `partCount`, `recommendReason`)
- 🏅 Rank in the search results, board or upload list (`rank`)

**Creator profiles**

- 👥 Followers, following, total likes received (`followers`, `following`, `totalLikes`)
- 📼 Video count and article count (`videoCount`, `articleCount`)
- ⭐️ Account level, verification and title, 大会员 VIP status (`level`, `isVerified`, `verificationTitle`, `isVip`)
- 📝 Bio and gender when shown (`bio`, `gender`)

**Danmaku (bullet comments)**

- 💬 Comment text and the second of the video it appears at (`text`, `videoTimeSeconds`)
- 🕒 Send time in UTC (`sentAt`)
- 🎨 Color, font size and display mode: scroll, top, bottom (`color`, `fontSize`, `danmakuMode`)
- 🔐 Danmaku id and Bilibili's own anonymised sender hash (`danmakuId`, `senderHash`)

Search, trending and upload rows always carry views, danmaku, comments and creator. Coins, shares and tags on search and upload rows come with **Fetch full video details** turned on.

### How to use Bilibili Scraper

1. Pick what to scrape: search, trending, video details, creators or danmaku.
2. Enter your keywords, video URLs or creator URLs (or pick a trending board).
3. Set the max videos per keyword and, if you like, a total row cap.
4. Click **Start** and wait a few seconds.
5. Download the results as JSON, CSV or Excel, or read them through the API.

### Input

Search two keywords, newest videos over 60 minutes long, September 2026 only:

```json
{
    "mode": "search",
    "searchQueries": ["人工智能", "iPhone 17"],
    "sortBy": "newest",
    "durationFilter": "over60",
    "publishedAfter": "2026-09-01",
    "publishedBefore": "2026-09-30",
    "maxResultsPerSource": 200
}
```

Other modes use the same actor:

```json
{ "mode": "trending", "trendingSource": "game", "fetchFullDetails": true }
{ "mode": "videos", "videoUrls": ["https://www.bilibili.com/video/BV1xx411c7mD", "av170001", "https://b23.tv/xxxxxxx"] }
{ "mode": "creators", "creatorUrls": ["https://space.bilibili.com/946974"], "maxResultsPerSource": 100 }
{ "mode": "danmaku", "videoUrls": ["BV1xx411c7mD"], "maxDanmakuPerVideo": 2000 }
```

### Output

A video row from the hot board:

```json
{
    "type": "video",
    "rank": 1,
    "bvid": "BV1LwHv6LE8t",
    "url": "https://www.bilibili.com/video/BV1LwHv6LE8t",
    "title": "当我不知道怎么办又没有不良嗜好的时候belike",
    "durationSeconds": 42,
    "publishedAt": "2026-10-03T10:12:22Z",
    "category": "搞笑",
    "views": 494205,
    "likes": 62859,
    "coins": 513,
    "favorites": 12027,
    "shares": 2443,
    "danmakuCount": 257,
    "commentCount": 1278,
    "authorName": "戴伟平",
    "authorUrl": "https://space.bilibili.com/598748662",
    "recommendReason": "6万点赞",
    "sourceType": "trending",
    "status": "ok"
}
```

A creator row:

```json
{
    "type": "creator",
    "creatorName": "碧诗",
    "authorUrl": "https://space.bilibili.com/2",
    "followers": 1431211,
    "videoCount": 44,
    "totalLikes": 5090206,
    "level": 6,
    "isVerified": true,
    "verificationTitle": "bilibili创始人（站长）"
}
```

A danmaku row:

```json
{
    "type": "danmaku",
    "bvid": "BV1xx411c7mD",
    "part": 1,
    "videoTimeSeconds": 0.0,
    "text": "2025.8探访古迹",
    "sentAt": "2025-08-20T16:42:52Z",
    "danmakuMode": "scroll",
    "color": "#ffffff"
}
```

The dataset has three ready-made table views in Console: **Videos**, **Creators** and **Danmaku**.

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

One flat price: **$2.00 per 1,000 rows**, whether a row is a video, a creator profile or a danmaku comment. No start fee and no add-on charges for full details.

| Rows | Cost |
|---|---|
| 1,000 | $2.00 |
| 10,000 | $20.00 |
| 100,000 | $200.00 |

The most-used Bilibili actor on the Store charges $20.00 per 1,000 items. Set **Max rows in total** to cap your spend exactly.

### Measured coverage

From QA runs on 2026-10-08 through Apify's datacenter proxy, all at 256 MB memory:

| Run | Rows | Time | Notes |
|---|---|---|---|
| Search, 5 keywords x 1,000 (cloud) | 4,328 | 126 s | 100% of rows with views, likes, favorites, danmaku, comments, creator, date, category |
| Hot board with full details (cloud) | 200 | 30 s | coins, shares, likes, tags, part count on every row |
| Gaming top-100 with full details | 96 | 13 s | tags on every row |
| Creators, 2 accounts (cloud) | 343 uploads + 2 profiles | 35 s | every public upload up to the cap |
| Danmaku, 3 videos (cloud) | 8,695 | 11 s | text, video second and send time on every row |

### Limits

- **Search depth is 1,000 videos per keyword.** That is Bilibili's own cap, and because Bilibili repeats some videos across pages you typically get 800 to 1,000 unique videos (measured: 783 to 996 across five keywords). Use several related keywords or date windows to go deeper.
- **Category rankings are the top 100.** The hot board goes several hundred deep.
- **Danmaku:** Bilibili serves the most recent pool of danmaku per video part (from a few hundred up to several thousand, depending on video length). Very old danmaku on huge videos may not be included.
- **Comment threads are not included.** Bilibili only shows 3 comments per video to visitors who are not logged in, and this actor never logs in or uses cookies. Comment counts are on every video row, and danmaku usually carry far more audience reaction than comments.
- **Category name on video-detail rows:** Bilibili's video endpoint now returns only the numeric category id there, so `category` can be empty while `categoryId` is filled. Search and trending rows carry the name.
- Deleted, private and under-review videos come back as one row with status `unavailable` and Bilibili's reason.

### FAQ

#### Is it legal to scrape Bilibili?

Bilibili Scraper only reads data that Bilibili shows publicly to any visitor without logging in: video pages, rankings, public creator profiles and danmaku. It collects no private data and never signs in. Danmaku senders are only identified by the anonymised hash Bilibili itself publishes. You are responsible for using the data in line with Bilibili's terms and the laws that apply to you, such as GDPR or PIPL.

#### How much does Bilibili Scraper cost?

$2.00 per 1,000 rows, charged per row written. A 100-video keyword search costs $0.20. Apify's free plan credit covers your first few thousand rows.

#### Does it work with English keywords?

Yes. Bilibili matches English and Chinese queries, but most Bilibili content is in Chinese, so the Chinese term (for example 人工智能 for AI, 原神 for Genshin Impact) usually returns far more relevant videos.

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

No account and no cookies. The default Apify proxy is already set and works well. Refused exits are swapped automatically.

#### Why did I get fewer results than expected?

Bilibili stops search at 1,000 results per keyword and shows only matching videos inside your date and length filters. A creator's upload count can include hidden videos that are not public. Rows with status `no_results`, `unavailable` or `invalid_input` explain exactly what happened for each input.

#### Can I use Bilibili Scraper as an API?

Yes. Every run is available through the [Apify API](https://docs.apify.com/api/v2). Start a run, wait for it, and read the dataset in JSON, CSV or Excel.

#### Can I use this in Python?

Yes, with the `apify-client` package:

```python
from apify_client import ApifyClient
run = ApifyClient("<YOUR_TOKEN>").actor("cirkit/bilibili-scraper").call(run_input={"mode": "trending"})
items = ApifyClient("<YOUR_TOKEN>").dataset(run["defaultDatasetId"]).list_items().items
```

#### Can I integrate Bilibili Scraper with other apps?

Yes. Use Apify integrations to send results to Google Sheets, Slack, Zapier, Make, Airbyte or any webhook when a run finishes.

#### How do I monitor Bilibili trends automatically?

Create a schedule in Apify Console (for example every hour for the hot board, or daily for a keyword sorted by newest) and connect a webhook or Google Sheets integration to collect each run.

#### Can I get a field that is not listed?

Open an issue on the actor page with an example video and the field you need.

### You might also like

- [YouTube Search Scraper](https://apify.com/cirkit/youtube-search-scraper)
- [YouTube Transcript Scraper](https://apify.com/cirkit/youtube-transcript-scraper)
- [YouTube Comments Scraper](https://apify.com/cirkit/youtube-comments-scraper)
- [YouTube Shorts Scraper](https://apify.com/cirkit/youtube-shorts-scraper)
- [Google Trends Scraper](https://apify.com/cirkit/google-trends-scraper)

### Changelog

- **0.1** (2026-10-08): first release. Search, trending boards and category rankings, video details, creator profiles and uploads, danmaku.

# Actor input Schema

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

search: videos matching your keywords. trending: the hot board or a category's top 100. videos: full records for specific video URLs. creators: a creator's profile plus their uploads. danmaku: the bullet comments (弹幕) of specific videos, one row per comment.

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

Keywords to search Bilibili for, in Chinese or English (for example 原神, 人工智能, iPhone 17 review). Used in search mode. Each keyword returns up to 1,000 videos.

## `trendingSource` (type: `string`):

Used in trending mode. Popular right now is Bilibili's hot board (several hundred videos). The category options return that category's top-100 ranking.

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

Used in videos and danmaku modes. Accepts bilibili.com/video/BV... links, b23.tv short links, BV ids (BV1xx411c7mD) and av ids (av170001).

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

Used in creators mode. Accepts space.bilibili.com/<id> links or the numeric user id (mid). Returns a profile row and then the creator's uploads, newest first.

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

Search mode only.

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

Search mode only. Filter by duration.

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

Search mode only. Date as YYYY-MM-DD (UTC). Leave empty for no lower bound.

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

Search mode only. Date as YYYY-MM-DD (UTC), inclusive. Leave empty for no upper bound.

## `fetchFullDetails` (type: `boolean`):

Search, trending and creator rows already carry views, danmaku, comments and author. Turn this on to also fill coins, shares, likes, tags, part count and the original-content flag for every video. Slower (two extra requests per video), same price per row.

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

Creators mode only. Push one profile row per creator (followers, following, total likes, video count, level, verification) before their uploads.

## `maxResultsPerSource` (type: `integer`):

Upper limit of videos taken from each search keyword, the trending board, or each creator. Search stops at 1,000 per keyword (Bilibili's own limit) and rankings at 100.

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

Danmaku mode only. Upper limit of bullet comments returned per video, ordered by when they appear in the video.

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

Hard cap on rows written to the dataset across all inputs. You are charged per row, so this is your spend limit. Leave empty for no total cap.

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

Apify's default datacenter proxy works well for Bilibili and is the cheapest option. Refused exits are rotated automatically.

## Actor input object example

```json
{
  "mode": "search",
  "searchQueries": [
    "人工智能",
    "iPhone 17"
  ],
  "trendingSource": "popular",
  "sortBy": "relevance",
  "durationFilter": "any",
  "fetchFullDetails": false,
  "includeCreatorProfile": true,
  "maxResultsPerSource": 20,
  "maxDanmakuPerVideo": 1000,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

Video rows with views, likes, coins, favorites, danmaku and comment counts, creator and publish date.

## `creators` (type: `string`):

Creator rows with followers, total likes, video count, level and verification.

## `danmaku` (type: `string`):

Bullet comment rows with the video second they appear at, text, color and send time.

## `resultsCsv` (type: `string`):

Every row as a downloadable CSV file.

## `full` (type: `string`):

Every field on every row.

# 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",
    "searchQueries": [
        "人工智能",
        "iPhone 17"
    ],
    "maxResultsPerSource": 20,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("cirkit/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",
    "searchQueries": [
        "人工智能",
        "iPhone 17",
    ],
    "maxResultsPerSource": 20,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("cirkit/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",
  "searchQueries": [
    "人工智能",
    "iPhone 17"
  ],
  "maxResultsPerSource": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call cirkit/bilibili-scraper --silent --output-dataset

```

## MCP server setup

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