# Bilibili Scraper (哔哩哔哩) – Videos, Comments & Danmaku (`maged120/bilibili-scraper`) Actor

Bilibili (哔哩哔哩, B站) scraper: search videos by keyword, scrape video links, UP主 uploaders or the popular feed. Views, likes, coins, favorites, tags, top comments and danmaku (弹幕) bullet comment text. No login or cookies. Export to CSV, JSON, Excel or API.

- **URL**: https://apify.com/maged120/bilibili-scraper.md
- **Developed by:** [Maged](https://apify.com/maged120) (community)
- **Categories:** Social media, Videos
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 94.1% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.50 / 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.
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

**Scrape Bilibili (哔哩哔哩) videos at scale — by keyword, video link, uploader or the popular feed.** Get **titles, views, likes, coins, favorites, danmaku and comment counts, shares, tags, durations, publish dates, uploader names and follower counts, plus top comments and danmaku (弹幕) text**, in clean English field names. No login or cookies.

### What does Bilibili Scraper do?

Bilibili Scraper collects public video data from [Bilibili](https://www.bilibili.com), China's largest video community for gaming, anime, tech, education and lifestyle creators. It returns one row per video with **BV ID, title, description, cover image, duration, publish time, views, likes, coins, favorites, danmaku (bullet comments), comments, shares, tags, category and uploader** — and, for uploader links, the **uploader's followers, total videos, total likes and bio**.

Run it on Apify to get an API, scheduling, monitoring, and integrations with Google Sheets, Make, Zapier, Slack and webhooks — no Chinese account or phone number needed.

### Why use Bilibili Scraper?

- **Influencer marketing in China** — find UP主 creators in your niche and compare followers, views and engagement.
- **Brand and trend monitoring** — track what Chinese audiences watch and say about a game, product or topic.
- **Competitor research** — follow rival channels and benchmark their content.
- **Academic and media research** — build datasets of Chinese online video at scale.
- **Content strategy** — see which titles, tags and durations get the most coins and favorites.

### How to scrape Bilibili

1. Click **Try for free**.
2. Add **Search terms**, **Video links**, **Uploader links** — or turn on **Popular videos**.
3. Choose **Max videos** and whether to include full statistics, top comments and danmaku.
4. Click **Start** and export the results to Excel, CSV, JSON or HTML.

### Input

| Field | Description |
|---|---|
| `searchQueries` | Keywords (Chinese or English). Up to 1,000 videos per term. |
| `sortBy` | Relevance, most viewed, newest, most danmaku or most favorited. |
| `videoUrls` | Video links, BV IDs or av numbers. |
| `uploaderUrls` | Uploader (space.bilibili.com) links or user IDs — returns their latest videos. |
| `includePopular` | Adds the current popular feed. |
| `maxVideos` | Cap per search term, uploader and the popular feed. |
| `includeDetails` | Adds coins, shares, exact likes and full descriptions. |
| `includeTopComments` | Adds the hottest public comments of every video. |
| `includeDanmaku` | Adds the danmaku (弹幕 bullet comments) of every video, with time in the video and send time. |
| `maxDanmakuPerVideo` | Cap on danmaku per video (Bilibili shares the most recent ~500 without login). |

```json
{
    "searchQueries": ["原神", "chess"],
    "sortBy": "views",
    "uploaderUrls": ["https://space.bilibili.com/546195"],
    "maxVideos": 100,
    "includeDetails": true
}
```

### Output

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

```json
{
    "bvid": "BV1Df4y1Z7zP",
    "aid": 300678639,
    "title": "「不用词汇书背单词」Episode 676：Chess",
    "url": "https://www.bilibili.com/video/BV1Df4y1Z7zP",
    "coverUrl": "https://i2.hdslb.com/bfs/archive/f1151439b0a3d7219d8ff3aa57c7b2f3fb8accde.jpg",
    "durationSeconds": 150,
    "publishedAt": "2022-07-12T00:30:00+00:00",
    "views": 2181,
    "likes": 16,
    "coins": 4,
    "favorites": 30,
    "danmaku": 3,
    "comments": 1,
    "shares": 2,
    "tags": ["零基础", "单词记忆", "英语单词"],
    "category": "校园学习",
    "authorName": "成都479英语",
    "authorId": 486841899,
    "authorUrl": "https://space.bilibili.com/486841899",
    "source": "search: chess"
}
```

Uploader runs also add `authorFollowers`, `authorVideoCount`, `authorLikes` and `authorBio`. With top comments on, each video gets a `topComments` list (`author`, `text`, `likes`, `replies`, `postedAt`). With danmaku on, each video gets a `danmakuComments` list (`time` in seconds into the video, `text`, `sentAt`).

### Data fields

| Field | Meaning |
|---|---|
| `bvid`, `aid`, `url` | Video identifiers and link |
| `title`, `description`, `tags`, `category` | Content |
| `views`, `likes`, `coins`, `favorites`, `danmaku`, `comments`, `shares` | Engagement |
| `durationSeconds`, `publishedAt`, `coverUrl` | Format and timing |
| `authorName`, `authorId`, `authorUrl`, `authorFollowers` | Uploader |
| `topComments` | Hottest comments |
| `danmakuComments` | Danmaku (bullet comments) text with video time |
| `source` | Which search, uploader or feed the row came from |

Views: **Videos**, **Uploaders** and **Details**.

### How many results will I get?

Up to `maxVideos` rows per search term (Bilibili search tops out at 1,000 per term), per uploader (their full video list), and per popular feed (up to 200). Video links return one row each.

### Tips

- Sort by **Most viewed** to surface viral content first; **Newest** for monitoring.
- Turn off **Include full statistics** for faster, larger keyword scans.
- Schedule a daily run on your competitors' uploader links to track their new uploads.
- Search in Chinese for the best coverage — most Bilibili titles are in Chinese.

### FAQ

**Do I need a Bilibili account?** No. Only publicly available video data is collected.

**Why only a few comments?** Bilibili shows its hottest comments publicly; the actor returns those per video.

**Is it legal?** It collects publicly available data. Use it in line with Bilibili's terms and applicable privacy laws.

**Need subtitles or another field?** Open an issue in the **Issues** tab. If this actor saves you time, a ⭐ review on the Store helps a lot.

# Actor input Schema

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

Keywords to search Bilibili videos for (Chinese or English), e.g. "原神" or "chess".

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

Order of search results.

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

Bilibili video links, BV IDs (BV1Df4y1Z7zP) or av numbers.

## `uploaderUrls` (type: `array`):

Channel links like https://space.bilibili.com/546195 or numeric user IDs. Returns the uploader's latest videos plus follower counts.

## `includePopular` (type: `boolean`):

Also collect the current Bilibili popular (热门) feed.

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

Cap for each search term, uploader and the popular feed. Search returns up to 1,000 per term. 0 = no cap.

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

Adds coins, shares, exact likes and the full description for every video.

## `includeTopComments` (type: `boolean`):

Adds the hottest public comments of each video (author, text, likes, replies).

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

Adds the video's danmaku: the bullet comments shown over the video, each with its time in the video and when it was sent. Bilibili shares the most recent ones (up to about 500 per video) without login.

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

Cap on danmaku saved per video, in video order. 0 = all Bilibili shares.

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

The default works for most runs. Residential proxies help if many requests are refused.

## Actor input object example

```json
{
  "searchQueries": [
    "chess"
  ],
  "sortBy": "relevance",
  "includePopular": false,
  "maxVideos": 50,
  "includeDetails": true,
  "includeTopComments": false,
  "includeDanmaku": false,
  "maxDanmakuPerVideo": 200,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `dataset` (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 = {
    "searchQueries": [
        "chess"
    ],
    "maxVideos": 50,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

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

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

```

## MCP server setup

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