# Bilibili Scraper - Videos, Channels & Stats (`scrapewise/bilibili-scraper`) Actor

Scrape Bilibili (哔哩哔哩) videos by keyword, a creator's full channel uploads, video URLs or trending: views, likes, coins, favorites, shares, danmaku, comments count, tags, duration and date. HTTP only, no login. US$ 3 per 1,000 videos; failed videos are free.

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

## Pricing

$3.00 / 1,000 video delivereds

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Bilibili Scraper: Videos, Channels & Stats

Scrape **Bilibili (哔哩哔哩)** videos by keyword, a creator's full channel uploads, a list of video URLs or the trending board, with views, likes, coins, favorites, shares, danmaku, comment count, tags, duration and publish date. For brand monitoring, influencer (KOL / UP主) research, gaming and anime market research, and Chinese content datasets.

### Why this one

- **US$ 3 per 1,000 videos.** Full stats and tags included, no start fee, no monthly fee.
- **Full channel uploads.** `user_videos` reads the channel's own upload list page by page (hundreds of videos, newest first), not just the ~20 a name search finds.
- **Failed videos never fail your run and are free.** Removed, private or invalid videos come back as an item with a stable `errorCode` and are not charged.
- **Drop-in replacement.** Same input names (`mode`, `searchQuery`, `videoUrls`, `userIds`, `maxResults`, `sortOrder`, `durationFilter`, `pubtimeBegin`, `pubtimeEnd`) and same output names (`bvid`, `viewCount`, `coinCount`, `authorMid`...) as the most used Bilibili scraper, so you can switch without changing your integration.
- **HTTP only, no login, no browser.** Fast and cheap runs.

### Use cases

- Track how a game, brand or product launch performs on Bilibili: every video for a keyword with views, coins and danmaku, sorted by newest or most viewed.
- Vet creators before a campaign: pull a channel's full upload history and compare likes, coins and favorites per video.
- Build a dataset of trending Chinese videos with tags and categories for research or AI.

### Input

```json
{
  "mode": "search",
  "searchQuery": "原神",
  "sortOrder": "click",
  "durationFilter": "any",
  "pubtimeBegin": "2026-01-01",
  "maxResults": 100
}
```

| mode | Needs | Returns |
|---|---|---|
| `search` | `searchQuery` (and optional `searchQueries`) | videos for each keyword, up to 1,000 per keyword (Bilibili's limit) |
| `user_videos` | `userIds`: `546195` or `https://space.bilibili.com/546195` | the channel's uploads, newest first |
| `video_detail` | `videoUrls`: video URLs, b23.tv links, `BV...` or `av...` ids | one item per video |
| `popular` | nothing | Bilibili's trending board |

`includeDetails` (on by default) opens each video from search, channel and trending lists to add coins, shares and tags. `maxResults` is per keyword or per channel.

Other scrapers' field names also work: `urls`, `startUrls`, `bvids`, `channelUrls`, `mids`, `keywords`, `maxItems`.

### Output

One item per video. Real item from a `search` run for 原神:

```json
{
  "type": "video",
  "bvid": "BV1LprnBWE7H",
  "aid": 115891941543896,
  "title": "桑多涅桑多涅桑多涅桑多涅？——哥伦比娅",
  "url": "https://www.bilibili.com/video/BV1LprnBWE7H",
  "thumbnailUrl": "https://i2.hdslb.com/bfs/archive/4c5eb629fa46637bc54de8124a5f2a4acc8287bf.jpg",
  "duration": 288,
  "durationFormatted": "4:48",
  "viewCount": 8685932,
  "likeCount": 666361,
  "coinCount": 114159,
  "favoriteCount": 204362,
  "shareCount": 23196,
  "danmakuCount": 1665,
  "replyCount": 7078,
  "authorName": "鼎芸",
  "authorMid": 33739137,
  "channelUrl": "https://space.bilibili.com/33739137",
  "publishDate": "2026-01-14T06:23:51+00:00",
  "publishTimestamp": 1768371831,
  "category": "同人·手书",
  "tags": ["原神少女上线", "搞笑", "绘画", "手书", "哥伦比娅", "桑多涅"],
  "pages": 1,
  "source": "search:原神",
  "error": null,
  "errorCode": null,
  "scrapedAt": "2026-09-13T01:28:10+00:00"
}
```

`authorName` and `authorMid` are the public channel that uploaded the video. No commenter or viewer data is collected.

Items that could not be delivered have `error` and `errorCode` filled in and **are not charged**:

| errorCode | Meaning |
|---|---|
| `VIDEO_NOT_FOUND` | The video was removed or never existed |
| `VIDEO_NOT_VISIBLE` / `VIDEO_UNDER_REVIEW` | Private or still in review |
| `INVALID_VIDEO_ID` / `INVALID_CHANNEL_ID` | The input is not a video or channel |
| `CHANNEL_NOT_FOUND` / `CHANNEL_UNAVAILABLE` | The channel does not exist or hides its uploads |
| `NO_RESULTS` | The keyword or channel returned no videos |
| `BLOCKED` | Bilibili blocked every retry; run again |

The run itself only fails when nothing was delivered and Bilibili blocked the requests.

#### Subtitles (optional)

`includeSubtitles` adds a `subtitles` array when Bilibili serves subtitles without login. Bilibili now hides most subtitles, including its AI subtitles, behind login, so most videos come back with `subtitleStatus: "LOGIN_REQUIRED"` or `"NONE"`. It costs nothing extra.

### Pricing

**US$ 3.00 per 1,000 videos delivered, no monthly fee.** One charge = one video with its stats, whatever the mode. Failed items are free. 30 videos cost US$ 0.09.

### How to use

- **Console:** pick a mode, fill the field, click Start, download JSON, CSV or Excel.
- **API:** `POST https://api.apify.com/v2/acts/scrapewise~bilibili-scraper/run-sync-get-dataset-items?token=YOUR_TOKEN` with the input above as the body.
- **Schedule:** run daily with `sortOrder: "pubdate"` to follow new videos for a keyword or channel.
- **Integrations:** n8n, Make, Zapier and Google Sheets through the Apify integrations.

### Limitations

- Bilibili search returns at most 1,000 videos per keyword (50 pages). Use several keywords or date ranges for more.
- The `popular` board has about 100 videos at any moment; schedule it to follow what trends over time.
- Paid courses listed on a channel have no public video page; they come back with `errorCode: "DETAILS_UNAVAILABLE"` and the list data, free.
- Videos from `user_videos` may have an empty `category`: Bilibili no longer returns the category name for channel uploads.
- Comments, danmaku text and user profiles are not collected.
- Something broke? Open an issue on the Actor page. Issues are answered within 12 hours.

This Actor collects only public data and respects the site's terms.

# Actor input Schema

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

What to scrape. Same mode names as other Bilibili scrapers, so you can switch without changing your integration.

## `searchQuery` (type: `string`):

Keyword for 'search' mode. Chinese (原神) and English (minecraft) both work.

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

Extra keywords for 'search' mode. Each keyword gets up to 'Max results' videos; duplicates across keywords are removed.

## `sortOrder` (type: `string`):

How Bilibili sorts search results.

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

Filter search results by video length.

## `pubtimeBegin` (type: `string`):

YYYY-MM-DD, China time. Leave empty for no filter.

## `pubtimeEnd` (type: `string`):

YYYY-MM-DD, China time, inclusive. Leave empty for no filter.

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

For 'video\_detail' mode: bilibili.com/video URLs, b23.tv short links, BV ids (BV1P4YX63Eej) or av ids (av117257959120137).

## `userIds` (type: `array`):

For 'user\_videos' mode: the creator's numeric id (mid) or channel URL (space.bilibili.com/546195). Returns the full upload list, newest first, up to 'Max results' per channel.

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

Search, channel and trending lists do not include coins, shares or tags. When on, each video is opened to add them. Same price.

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

Adds the video's subtitles when Bilibili serves them without login. Bilibili now hides most subtitles (including AI subtitles) behind login, so expect this to be empty for most videos; 'subtitleStatus' tells you why. Same price.

## `maxResults` (type: `integer`):

Maximum videos per keyword or per channel. For 'video\_detail' and 'popular' it is the run total. Bilibili search stops at 1,000 results per keyword.

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

Apify datacenter proxy is the default and works for Bilibili. Blocked requests are retried on a new IP.

## Actor input object example

```json
{
  "mode": "search",
  "searchQuery": "minecraft",
  "sortOrder": "totalrank",
  "durationFilter": "any",
  "videoUrls": [
    "https://www.bilibili.com/video/BV1P4YX63Eej"
  ],
  "userIds": [
    "546195"
  ],
  "includeDetails": true,
  "includeSubtitles": false,
  "maxResults": 30,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

No description

## `resultsCsv` (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 = {
    "mode": "search",
    "searchQuery": "minecraft",
    "videoUrls": [
        "https://www.bilibili.com/video/BV1P4YX63Eej"
    ],
    "userIds": [
        "546195"
    ],
    "maxResults": 30,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapewise/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",
    "searchQuery": "minecraft",
    "videoUrls": ["https://www.bilibili.com/video/BV1P4YX63Eej"],
    "userIds": ["546195"],
    "maxResults": 30,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("scrapewise/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",
  "searchQuery": "minecraft",
  "videoUrls": [
    "https://www.bilibili.com/video/BV1P4YX63Eej"
  ],
  "userIds": [
    "546195"
  ],
  "maxResults": 30,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call scrapewise/bilibili-scraper --silent --output-dataset

```

## MCP server setup

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