# Bilibili 哔哩哔哩 Scraper: Videos, Danmaku, Comments & UP主 (`ragequit/bilibili-scraper`) Actor

Scrape Bilibili (哔哩哔哩, B站) without login: search, video stats, creator (UP主) profiles and uploads, popular and ranking lists, comments and danmaku reaction profiles. Mix keywords, videos and creators in one run. Fast HTTP, no browser.

- **URL**: https://apify.com/ragequit/bilibili-scraper.md
- **Developed by:** [ragequit.wtf](https://apify.com/ragequit) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.75 / 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/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 does Bilibili Scraper do?

**Bilibili Scraper** extracts public data from [Bilibili](https://www.bilibili.com) (哔哩哔哩, B站), China's largest video community for Gen Z: **video search results**, **video stats** (views, likes, coins, favorites, shares, comments, danmaku), **creator (UP主) profiles and latest uploads**, the **popular feed** and **ranking boards**, **top comments with their reply threads**, and **danmaku reaction profiles** that show how the audience reacted minute by minute.

It works as a **Bilibili API**: no Bilibili account, login, cookie or API key needed. Run it from Apify Console, schedule it, or call it through the Apify API.

### Why use this Bilibili scraper?

- 🧩 **Everything in one run.** Mix keywords, video links, creators and trending lists in a single input; there is no "one mode per run".
- 📈 **Full video stats.** Views, likes, coins, favorites, shares, comment and danmaku counts, duration, category and publish time.
- 💬 **Danmaku reaction profiles.** Danmaku (弹幕) are the comments that scroll over a video at a specific second. One row per video gives you the total, unique senders, danmaku per minute, the peak minute, and a sample of texts spread across the whole video, so you see which moments got the strongest reaction.
- 👤 **Creator intelligence.** Followers, total likes, video count, level and verification for any UP主, plus their latest videos.
- 🔔 **Monitoring.** Switch on *Only new videos* and schedule the Actor to get just the new videos for a keyword, creator or ranking.
- 💸 **Low, transparent pricing.** Full video stats from $2.50 per 1,000, and each kind of row is priced separately, so you only pay for what you ask for.

Typical uses: **China market research** and brand monitoring, **KOL / influencer discovery** and vetting, **gaming, anime and entertainment analytics**, **trend spotting**, competitor content tracking, and Chinese-language **NLP and sentiment** datasets.

### What data can I extract from Bilibili?

| Row type | Main fields |
| --- | --- |
| `video` | `title`, `bvid`, `url`, `views`, `likes`, `coins`, `favorites`, `shares`, `comments`, `danmakuCount`, `durationSeconds`, `publishedAt`, `category`, `creatorName`, `creatorId`, `thumbnailUrl`, `source` |
| `danmaku` | `totalDanmaku`, `uniqueSenders`, `perMinute`, `peakMinute`, `peakCount`, `sample` (second + text) |
| `comment` | `text`, `likes`, `replyCount`, `authorName`, `publishedAt`, `parentCommentId` |
| `creator` | `name`, `followers`, `following`, `videoCount`, `totalLikes`, `level`, `verified`, `bio`, `url` |

Every row has `resultType`, so you can filter by kind. The Output tab has separate views for videos, comments, danmaku profiles and creators.

### How to scrape Bilibili

1. Click **Try for free** to open the Actor in Apify Console.
2. Add **search keywords** (Chinese works best, for example 原神 or 人工智能), **video links**, **creator links** (space.bilibili.com/...), or pick a **trending list**.
3. Choose the **extra data** you want: full stats, danmaku profiles, comments, creator profiles.
4. Click **Start**, then download the results as JSON, CSV, Excel or HTML, or fetch them through the API.

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

Pay-per-event pricing, with platform usage and proxies included. You pay per row, by type, and higher Apify plans pay less:

| Row type | Free plan | Bronze | Silver | Gold |
| --- | --- | --- | --- | --- |
| Video (with full stats) | $2.50 / 1,000 | $2.25 | $2.00 | $1.75 |
| Creator profile | $3.00 / 1,000 | $2.70 | $2.40 | $2.10 |
| Comment | $1.00 / 1,000 | $0.90 | $0.80 | $0.70 |
| Danmaku reaction profile | $10.00 / 1,000 videos | $9.00 | $8.00 | $7.00 |

For example, 1,000 search results with full stats cost **$2.50** on the Free plan. Adding a danmaku profile for each video adds **$10**, and one profile row summarizes thousands of danmaku.

### Input

See the **Input** tab for all options. Example:

```json
{
    "searchQueries": ["原神", "人工智能"],
    "creators": ["https://space.bilibili.com/946974"],
    "trendingLists": ["ranking"],
    "rankingCategory": "tech",
    "maxVideosPerSearch": 100,
    "includeDanmaku": true,
    "includeComments": true
}
```

- **Creators** need the numeric ID or profile link; channel names are not supported.
- **Search order**: most relevant, most viewed, newest, most danmaku or most favorited; you can also filter by video length.
- **Ranking boards** are available for all categories (gaming, tech, knowledge, music, anime and more).

### Output

You can download the dataset in various formats such as **JSON, HTML, CSV, or Excel**.

Video:

```json
{
    "resultType": "video",
    "bvid": "BV1xx411c7mD",
    "url": "https://www.bilibili.com/video/BV1xx411c7mD",
    "title": "Example video title",
    "publishedAt": "2026-10-19T09:06:21.000Z",
    "durationSeconds": 90,
    "category": "单机游戏",
    "creatorId": 123456,
    "creatorName": "ExampleCreator",
    "views": 38540,
    "likes": 274,
    "coins": 4,
    "favorites": 31,
    "shares": 17,
    "comments": 235,
    "danmakuCount": 20,
    "source": "search",
    "sourceValue": "原神",
    "position": 1
}
```

Danmaku reaction profile:

```json
{
    "resultType": "danmaku",
    "bvid": "BV1xx411c7mD",
    "title": "Example video title",
    "totalDanmaku": 7200,
    "uniqueSenders": 4100,
    "perMinute": [120, 340, 95],
    "peakMinute": 1,
    "peakCount": 340,
    "sample": [{ "second": 4.9, "text": "example danmaku" }]
}
```

### Tips

#### Why do I only get 3 top comments per video?

Bilibili shows logged-out visitors the top 3 comments of each video. The Actor collects those plus the full reply threads under them (set *Replies per top comment*). For the broad audience reaction, use **danmaku profiles**: they cover the video's whole danmaku pool, often thousands of messages.

#### Can I track a creator or keyword over time?

Yes. Turn on **Only new videos (monitoring)** and create a **schedule** in Apify Console. The first run returns everything; later runs return only videos that are new for each keyword, creator or list. Use a different *Monitoring store name* for each monitor.

#### How do I keep runs cheap?

Set the **max videos** limits to what you need, and only enable comments, danmaku profiles and creator profiles when you need them, since each is a separately priced row. You can also set a **maximum cost per run** in the run options; the Actor stops cleanly when it is reached. Turning off **Full video stats** makes runs faster when search-level numbers are enough (views, likes, comments, danmaku and favorites are already in search results).

### FAQ, disclaimers and support

#### Is it legal to scrape Bilibili?

This Actor collects publicly visible data that Bilibili shows to logged-out visitors. Comments and creator profiles include public user names and IDs. Our Actors are ethical and do not extract any private user data, such as email addresses, gender, or location. They only extract what the user has chosen to share publicly. We therefore believe that our Actors, when used for ethical purposes by Apify users, are safe. However, you should be aware that your results could contain personal data. Personal data is protected by the GDPR in the European Union and by other regulations around the world. You should not scrape personal data unless you have a legitimate reason to do so. If you're unsure whether your reason is legitimate, consult your lawyers.

This Actor is an independent tool and is not affiliated with or endorsed by Bilibili.

#### How do I use it through the API?

Open the **API** tab for ready-to-use code in Python, JavaScript and cURL, or call it through the [Apify API](https://docs.apify.com/api/v2). It also works as a tool for AI agents through the Apify MCP server.

#### Something does not work. Where can I get help?

Open an issue in the **Issues** tab with a link to your run. Issues are usually answered within a day, and feature requests are welcome.

# Actor input Schema

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

Keywords to search Bilibili videos for. Chinese works best (原神, 人工智能, 华为), English also works.

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

Bilibili video links or IDs, e.g. https://www.bilibili.com/video/BV1xx411c7mD, BV1xx411c7mD or av170001.

## `creators` (type: `array`):

Creator IDs (mid) or profile links like https://space.bilibili.com/946974. Returns the creator's profile and latest videos. Channel names are not supported.

## `trendingLists` (type: `array`):

Popular: the current popular feed (综合热门). Ranking: the top-100 ranking board for the category below.

## `rankingCategory` (type: `string`):

Category of the ranking board.

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

How search results are sorted.

## `searchDuration` (type: `string`):

Only return videos of this length in searches.

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

Bilibili returns up to 1,000 results per keyword.

## `maxVideosPerCreator` (type: `integer`):

Latest videos to collect from each creator. 0 returns only the creator profile.

## `maxTrendingVideos` (type: `integer`):

The ranking board has 100 videos; the popular feed has a few hundred.

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

Add likes, coins, shares and exact counts to videos found by search or on creator pages (one extra request per video). Videos from URLs and trending lists always have full stats.

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

For each video, add one row summarizing its danmaku (弹幕, the comments scrolling over the video): total count, unique senders, danmaku per minute, the peak minute, and a sample of texts spread across the whole video.

## `danmakuSampleSize` (type: `integer`):

How many danmaku texts to include in each profile, spread evenly over the video. 0 for numbers only.

## `includeComments` (type: `boolean`):

Add the video's top comments and their reply threads, one row per comment. Bilibili shows logged-out visitors the top 3 comments of each video, so expect up to 3 top-level comments plus their replies.

## `maxRepliesPerComment` (type: `integer`):

Replies to collect under each top comment. 0 for top comments only.

## `includeCreatorProfiles` (type: `boolean`):

Also add a profile row (followers, video count, total likes, verification) for the creator of each video found. Creators you list above always get a profile.

## `onlyNewVideos` (type: `boolean`):

Return only videos not seen in earlier runs, per keyword, creator and list. The first run returns everything and remembers it; scheduled runs then return just new videos. Seen videos are kept in a named key-value store in your account.

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

Name of the key-value store that remembers seen videos. Use a different name for each separate monitor.

## `maxConcurrency` (type: `integer`):

How many videos to process at the same time.

## `maxRetries` (type: `integer`):

How many times to retry a request on a new IP when Bilibili's risk control blocks it.

## `residentialFallback` (type: `boolean`):

Start on cheap datacenter IPs and move to Apify residential proxies for the rest of the run if Bilibili blocks them. Only applies when you use Apify datacenter proxies.

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

Apify datacenter proxies work for most data; creator pages may need the residential fallback.

## Actor input object example

```json
{
  "searchQueries": [
    "原神"
  ],
  "trendingLists": [],
  "rankingCategory": "all",
  "searchOrder": "totalrank",
  "searchDuration": "any",
  "maxVideosPerSearch": 50,
  "maxVideosPerCreator": 30,
  "maxTrendingVideos": 50,
  "includeVideoDetails": true,
  "includeDanmaku": false,
  "danmakuSampleSize": 25,
  "includeComments": false,
  "maxRepliesPerComment": 10,
  "includeCreatorProfiles": false,
  "onlyNewVideos": false,
  "monitorStoreName": "bilibili-monitor",
  "maxConcurrency": 4,
  "maxRetries": 6,
  "residentialFallback": true,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

Dataset with one row per video, comment, danmaku profile and creator

# 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 = {
    "searchQueries": [
        "原神"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

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

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

```

## MCP server setup

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