# Bilibili Video & Trend Data – B站 Stats, Comments & Danmaku (`realletoangt/bilibili-scraper`) Actor

Monitor public Bilibili (哔哩哔哩, B站) video data: views, likes, coins, tags, UP主 creator profiles, comments, danmaku (弹幕) insights and public subtitles. Keyword, trending and creator modes. No login. Unofficial, not affiliated with Bilibili.

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

## Pricing

$10.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

## Bilibili Video & Trend Data: Stats, Comments, Danmaku & UP主 Channels (B站 / 哔哩哔哩)

> **Unofficial tool.** Not affiliated with, endorsed by, or sponsored by Bilibili. The name is used only to describe compatibility.

Monitor public video data and trends on **Bilibili (哔哩哔哩, B站)**, China's leading video community for Gen Z, gaming, anime, tech and lifestyle content. Search videos, track creators (UP主), measure engagement, and analyse comments and danmaku (弹幕). No Bilibili account or cookies needed. Export to Excel, CSV or JSON, or use the API.

**Built for** marketers and brand teams, influencer/KOL researchers, China-market analysts and data scientists.

### What you get

- 🎬 **Video data:** title, description, category, tags, duration, publish date, cover and URL.
- 📊 **Engagement:** views, likes, coins (投币), favorites, shares, danmaku and comment counts.
- 👤 **Creator (UP主) profiles:** followers, total likes, video count, level and verification, plus the creator's latest videos.
- 💬 **Comments (评论):** text, likes, reply count, date and whether the creator replied.
- ⚡ **Danmaku (弹幕) insights:** danmaku per minute and the peak moment, plus optional raw lines with timestamps.
- 📝 **Subtitles (字幕):** included when the uploader has published them publicly.
- 🔥 **Trending:** videos from Bilibili's popular board (热门).

### Use cases

- **Influencer / KOL discovery and vetting:** compare creators' followers and per-video engagement before a campaign.
- **Brand and campaign monitoring:** track videos mentioning your brand or product, and how audiences react.
- **China market and trend research:** see what's rising in gaming, anime (二次元), beauty, tech and other categories.
- **Content strategy:** find which topics, lengths and formats get the most views, coins and favorites.
- **Sentiment and NLP:** build Chinese-language datasets from comments and danmaku.
- **Audience-reaction analysis:** the danmaku-per-minute curve shows the exact moments viewers react.

### Quick start

1. Add **search keywords** (e.g. `原神`, `iPhone 17`, `美妆`), **video URLs**, and/or **creator (UP主) URLs**. You can also tick **Popular**.
2. Choose **Max videos**, plus comments, danmaku or subtitles if you need them.
3. Click **Start**, then export from the **Output** tab. Use the **Videos**, **Comments**, **Danmaku** and **Channels** views to see each type of item.

### Input example

```json
{
  "searchKeywords": ["原神"],
  "channelUrls": ["https://space.bilibili.com/670061998"],
  "maxVideos": 50,
  "searchOrder": "click",
  "maxComments": 20,
  "includeDanmaku": true
}
```

| Field | What it does |
|---|---|
| `searchKeywords` | Search terms (Chinese or English) |
| `videoUrls` | Video URLs or BV ids |
| `channelUrls` | Creator space URLs or user ids |
| `scrapePopular` | Include the popular board |
| `maxVideos` | Videos per keyword, creator or popular board (default 20) |
| `searchOrder` | Relevance, most viewed, newest, most danmaku, most favorited |
| `includeDetails` | Coins, shares and full tags (on by default) |
| `maxComments` | Comments per video (0 = none); `commentSort` sets hot or newest |
| `includeDanmaku` / `maxDanmakuLines` | Danmaku summary and optional raw lines |
| `includeSubtitles` | Public subtitles when available |

### Output example

```json
{"type":"video","bvid":"BV1FhpX6GE1i","url":"https://www.bilibili.com/video/BV1FhpX6GE1i","title":"【原神】判测胜券本征 活动攻略/预测/原神7.1","category":"手机游戏","tags":["原神7.1","游戏攻略","原神"],"uploader":{"mid":431073645,"name":"你的影月月"},"stats":{"views":696655,"likes":26723,"coins":2005,"favorites":3368,"shares":1084,"danmaku":355,"comments":6638},"publishedAt":"2026-10-12T04:21:36.000Z"}
{"type":"channel","mid":670061998,"name":"A2O_WORLD","followers":84686,"videoCount":186,"likes":443246,"verified":"A2O Entertainment官方账号","url":"https://space.bilibili.com/670061998"}
{"type":"comment","bvid":"BV1yopq6uE7c","commentId":"316953484897","text":"…","likes":110,"replyCount":7,"postedAt":"2026-10-13T11:33:48.000Z","isUploaderReply":false}
{"type":"danmaku","bvid":"BV1yopq6uE7c","totalLoaded":95,"peakMinute":0,"peakCount":33,"perMinute":[{"minute":0,"count":33}]}
```

View counts are always in `stats.views`.

### Pricing

You pay only for results: **$10 per 1,000 results** ($0.01 each). Each video, comment, creator profile or danmaku summary counts as one result. For example, 100 videos with 20 comments each = 2,100 results ≈ $21. Apify's free monthly credit is enough to try it.

### FAQ

**Do I need a Bilibili account?**
No. The Actor works without login or cookies.

**How many videos can I get per keyword?**
Up to 1,000. That is Bilibili's own search limit.

**How are a creator's videos found?**
Through Bilibili search, filtered to that creator and sorted newest first. Very small creators, or those with hidden videos, may return fewer videos than their profile shows.

**Are subtitles always available?**
No, only subtitles the uploader has published publicly. Auto-generated (AI) subtitles are not available without login.

**Is the danmaku complete?**
Bilibili shows visitors a sample of each video's danmaku. That is reliable for reaction curves and sentiment, but it is not the full history.

**Why does a run take a few minutes?**
Requests are paced so that runs stay reliable. Large jobs simply take longer. You can add a proxy if you need more speed.

**Are commenter names included?**
Off by default. Turn on `includeCommenterNames` if your use case needs them.

**Legal note**
This is an unofficial, independent tool, not affiliated with, endorsed by, or sponsored by Bilibili. It collects publicly visible data only, with no login, and commenter names are off by default. You are responsible for using it in line with Bilibili's terms of service and applicable laws (including privacy laws if you enable comments). Keep request volumes reasonable.

*Keywords: Bilibili data, Bilibili trends, 哔哩哔哩数据, B站视频数据, B站评论采集, 弹幕分析, UP主数据, KOL 数据, 中国社交媒体数据, Chinese video data.*

# Actor input Schema

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

Video search terms (Chinese or English), e.g. 原神, 美妆, iPhone 17.

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

e.g. https://www.bilibili.com/video/BV1xx411c7mD or just BV1xx411c7mD.

## `channelUrls` (type: `array`):

e.g. https://space.bilibili.com/670061998 or 670061998. Returns the channel profile and its latest videos.

## `scrapePopular` (type: `boolean`):

Include videos from Bilibili's popular board.

## `maxVideos` (type: `integer`):

Per keyword, channel or popular board (search is capped by Bilibili at 1,000).

## `searchOrder` (type: `string`):

Order of keyword search results.

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

Coins, shares, full tags, cid, parts. One extra request per video.

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

0 = no comments.

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

Which comments to fetch first.

## `includeCommenterNames` (type: `boolean`):

Off by default (data minimisation). User IDs and avatars are never collected.

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

Per-video danmaku item: count, per-minute curve and peak minute. Sender IDs are never collected.

## `maxDanmakuLines` (type: `integer`):

Also include up to N raw danmaku lines (time + text) in the danmaku item.

## `includeSubtitles` (type: `boolean`):

Uploader-provided subtitles when publicly available (AI-generated subtitles need login and are not returned).

## `requestDelayMs` (type: `integer`):

Bilibili rate-limits aggressively; lower values risk HTTP 412.

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

Usually not needed. Use Apify Proxy or your own proxyUrls if you hit HTTP 412.

## Actor input object example

```json
{
  "searchKeywords": [
    "原神"
  ],
  "scrapePopular": false,
  "maxVideos": 20,
  "searchOrder": "totalrank",
  "includeDetails": true,
  "maxComments": 0,
  "commentSort": "hot",
  "includeCommenterNames": false,
  "includeDanmaku": false,
  "maxDanmakuLines": 0,
  "includeSubtitles": false,
  "requestDelayMs": 1200,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Videos, comments, danmaku and channel items.

## `comments` (type: `string`):

Dataset in the comments view.

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

Dataset in the danmaku view.

## `channels` (type: `string`):

Dataset in the channels view.

# 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": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("realletoangt/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": False },
}

# Run the Actor and wait for it to finish
run = client.actor("realletoangt/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": false
  }
}' |
apify call realletoangt/bilibili-scraper --silent --output-dataset

```

## MCP server setup

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