# Bilibili Scraper (`tplugge/bilibili-scraper`) Actor

Scrape Bilibili (哔哩哔哩) videos by keyword, video URL, creator or the popular board: views, likes, coins, favorites, shares, danmaku, comments, tags, plus creator followers and likes. No login, no cookies.

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

## Pricing

from $8.00 / 1,000 result scrapeds

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

Scrape Bilibili (哔哩哔哩), China's largest video community: search videos by keyword, read any
video, pull a creator's (UP主) profile and latest uploads, or grab the popular board (热门). Every
video comes with views, likes, coins, favorites, shares, danmaku and comment counts, tags, length,
publish date and creator. No login, no cookies, no API key.

The scraper talks to Bilibili's web API with signed requests (WBI), the same way bilibili.com does
in the browser, through Apify residential proxies in China. No browser, so runs are fast and cheap.

### What you can use it for

- **China market research:** see which products, brands and topics Chinese viewers watch and
  discuss, and how much.
- **Influencer (KOL) discovery:** find creators by keyword and compare followers, likes and
  upload activity.
- **Competitor and brand monitoring:** track videos about your brand or category every day.
- **Trend tracking:** take a daily snapshot of the popular board.
- **AI datasets:** collect titles, descriptions and tags of Chinese video content.

### Input

| Field | Description | Default |
|---|---|---|
| `searchQueries` | Keywords, one per line. Chinese keywords find more | |
| `maxResultsPerSearch` | Videos per keyword, up to 1,000 | 40 |
| `searchOrder` | `totalrank` relevance, `click` views, `pubdate` newest, `dm` danmaku, `stow` favorites | totalrank |
| `searchDuration` | `"0"` any, `"1"` under 10 min, `"2"` 10 to 30 min, `"3"` 30 to 60 min, `"4"` over 60 min | `"0"` |
| `videoUrls` | Video URLs or BV ids | |
| `creatorUrls` | Creator pages `https://space.bilibili.com/<uid>` or UIDs | |
| `maxVideosPerCreator` | Latest uploads per creator, 0 for the profile only | 30 |
| `popular` | Add the popular board | false |
| `maxPopularVideos` | Videos from the popular board | 50 |
| `includeDetails` | Complete statistics for every video (coins, shares, likes of uploads) | false |

Use at least one of `searchQueries`, `videoUrls`, `creatorUrls` or `popular`.

```json
{
    "searchQueries": ["原神", "iPhone 17"],
    "maxResultsPerSearch": 100,
    "searchOrder": "click",
    "creatorUrls": ["https://space.bilibili.com/401742377"],
    "popular": true,
    "includeDetails": true
}
```

### Output

Every row has a `type`: `video` or `creator`. `source` tells where a video came from (`search`,
`video`, `creator`, `popular`).

A video from a search:

```json
{
    "type": "video",
    "bvid": "BV12Kpxz9Eyb",
    "url": "https://www.bilibili.com/video/BV12Kpxz9Eyb",
    "aid": 115218906681877,
    "title": "「小白」iPhone17全面测评：你想看的都在这了！",
    "description": "关注微信公众号：小白测评 每晚发车不见不散",
    "coverUrl": "https://i0.hdslb.com/bfs/archive/49063e3093ee62c90813f7a852aff3b92cd31454.jpg",
    "durationSeconds": 1188,
    "publishedAt": "2025-09-17T12:00:00.000Z",
    "category": "数码",
    "tags": ["数码", "小白测评", "iPhone17", "苹果手机", "A19芯片"],
    "views": 2085669,
    "likes": 52865,
    "coins": null,
    "favorites": 11819,
    "shares": null,
    "danmaku": 12092,
    "comments": 5834,
    "authorName": "小白测评",
    "authorId": 8969156,
    "authorUrl": "https://space.bilibili.com/8969156",
    "source": "search",
    "searchQuery": "iPhone 17",
    "position": 1
}
```

With `includeDetails`, `coins` and `shares` are filled as well.

A creator:

```json
{
    "type": "creator",
    "creatorId": 401742377,
    "name": "原神",
    "url": "https://space.bilibili.com/401742377",
    "bio": "原神官方账号",
    "followers": 20863470,
    "following": 60,
    "videoCount": 740,
    "articleCount": 0,
    "totalLikes": 285732645,
    "level": 6,
    "isVerified": true,
    "verifiedTitle": "原神官方账号",
    "avatarUrl": "https://i2.hdslb.com/bfs/face/e63bacc8b9e68f59f401cc41728a99262ba661a3.jpg",
    "gender": null
}
```

Export the results as JSON, CSV, Excel or HTML, or pull them through the Apify API, n8n, Make
or Zapier.

### Pricing

You pay per row in the dataset (video or creator), see the pricing tab. Proxy traffic and
`includeDetails` cost nothing extra. Keywords that find nothing cost nothing.

### Limits

- Bilibili shows at most 50 pages of 20 videos per keyword, so 1,000 videos. Split broad topics
  into several keywords.
- Comments and danmaku text are not included: without a login Bilibili shows only the top three
  comments of a video.
- Bilibili blocks datacenter IPs. Keep the default residential proxy in China.

### FAQ

**Do I need a Bilibili account or cookie?** No.

**Why Chinese keywords?** Bilibili's audience searches in Chinese. `原神` finds far more than
`Genshin Impact`.

**How fresh is the data?** Every run reads live numbers from Bilibili.

# Actor input Schema

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

One keyword per line. Chinese keywords find far more videos, e.g. "原神" instead of "Genshin".

## `maxResultsPerSearch` (type: `integer`):

Bilibili returns 20 videos per page and at most 1,000 per keyword.

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

How Bilibili ranks the search results.

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

Only videos of this length.

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

Video pages or BV ids, e.g. https://www.bilibili.com/video/BV1BqhB6nEdN

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

Creator pages or numeric UIDs, e.g. https://space.bilibili.com/401742377. Returns the profile plus the latest uploads.

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

Newest uploads first. 0 returns the profile only.

## `popular` (type: `boolean`):

Add the videos currently on Bilibili's popular board.

## `maxPopularVideos` (type: `integer`):

How many videos to take from the popular board.

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

Search and creator results lack some numbers (coins, shares, and likes for creator uploads). Switch on to fetch the complete statistics for each video. One extra request per video, same price per row.

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

Bilibili blocks datacenter IPs. Keep the default: Apify residential proxy in China.

## Actor input object example

```json
{
  "searchQueries": [
    "原神"
  ],
  "maxResultsPerSearch": 40,
  "searchOrder": "totalrank",
  "searchDuration": "0",
  "maxVideosPerCreator": 30,
  "popular": false,
  "maxPopularVideos": 50,
  "includeDetails": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "CN"
  }
}
```

# Actor output Schema

## `videos` (type: `string`):

All video rows.

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

Creator rows.

# 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,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "CN"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("tplugge/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,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "CN",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("tplugge/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,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "CN"
  }
}' |
apify call tplugge/bilibili-scraper --silent --output-dataset

```

## MCP server setup

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