# Bilibili Scraper: Videos, Search, Danmaku & Creators (`axlymxp/bilibili-scraper`) Actor

Scrape Bilibili (B站) videos without login: keyword search with date filters, video URLs, a creator's complete uploads, popular, rankings, weekly and trending searches. Views, likes, tags, danmaku and top comments. Pay only for results.

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

## Pricing

from $5.00 / 1,000 dataset items

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: Videos, Search, Danmaku & Creators

Extract video data from **Bilibili (哔哩哔哩, B站)**, China's largest video community for anime, gaming, tech and
lifestyle, without an account or cookies. Search by keyword with date and length filters, scrape any video URL, pull
a creator's **complete** upload list, or read the popular, top-100 ranking, weekly must-watch and trending-search
boards. Each video row can include its tags, danmaku (弹幕, the bullet comments that scroll over the video) and top
comments.

Built for China social-listening, influencer marketing and AI dataset work: schedule it with
**"Only new videos since the last run"** to get just the new videos for your keywords every day.

### What you get

| Field | Description |
| --- | --- |
| `bvid`, `aid`, `url` | Video ids and link |
| `title`, `description` | Title and full description |
| `coverUrl` | Thumbnail |
| `durationSec`, `publishedAt` | Length in seconds, publish time (UTC, ISO 8601) |
| `category`, `tags` | Bilibili category and video tags |
| `creator` | `mid`, `name`, `faceUrl`, `url` of the uploader (UP主) |
| `stats` | `views`, `likes`, `coins`, `favorites`, `shares`, `comments`, `danmaku` |
| `parts` | Every part of a multi-part video: `cid`, `title`, `durationSec` |
| `isOriginal`, `isCooperation` | Original upload vs re-upload, joint upload |
| `rank` | Position in the search results or board |
| `danmaku` | Optional: `timeSec`, `text`, `sentAt`, `mode`, `color` |
| `topComments` | Optional: top 3 comments (`author`, `text`, `likes`, `publishedAt`, `ipLocation`) with up to 20 `replies` each |
| `sourceType`, `source`, `scrapedAt` | Which mode / keyword produced the row, and when |

In **Trending searches** mode each row is a hot keyword instead: `rank`, `keyword`, `displayText`, `searchUrl`.

### Modes

| Mode | Input | Returns |
| --- | --- | --- |
| Keyword search | `searchQueries`, `sortBy`, `durationFilter`, `publishedAfter` / `publishedBefore` | up to ~1,000 videos per keyword (Bilibili's own cap; ~750-1,000 after duplicates) |
| Video URLs / BV ids | `videoUrls` (bilibili.com/video links, b23.tv links, BV or av ids) | one row per video |
| Creator uploads | `creatorIds` (UID or space.bilibili.com link) | every upload of the creator, newest first |
| Popular now (综合热门) | — | the current popular feed |
| Top-100 ranking (排行榜) | `rankingCategory` (all, music, game, tech, food, …) | up to 100 videos |
| Weekly must-watch (每周必看) | — | the latest weekly issue |
| Trending searches (热搜) | — | the hot search keywords right now |

### Use cases

- **Brand and market research in China**: track what Chinese viewers say about your product or category, with
  date-ranged keyword search, danmaku and top comments.
- **Influencer marketing**: list a creator's full catalog with views and danmaku per video before you book them;
  pair with our *Bilibili Creator Finder* to discover creators by niche.
- **Trend monitoring**: daily snapshots of the popular feed, category rankings and hot searches.
- **AI and research datasets**: Chinese video titles, descriptions, tags and danmaku text at scale.

### Example input

```json
{
    "mode": "search",
    "searchQueries": ["iPhone 17 评测"],
    "sortBy": "newest",
    "publishedAfter": "2026-09-01",
    "maxItems": 200,
    "includeDanmaku": true,
    "maxDanmakuPerVideo": 50,
    "onlyNewSinceLastRun": true
}
```

### Example output

```json
{
    "bvid": "BV12hHr6UEqc",
    "aid": 117381087170734,
    "url": "https://www.bilibili.com/video/BV12hHr6UEqc",
    "title": "舟友的酒",
    "durationSec": 31,
    "publishedAt": "2026-10-04T05:57:16Z",
    "category": "同人·手书",
    "tags": ["可爱", "明日方舟", "朋友的酒", "阿米娅"],
    "creator": {"mid": 107716290, "name": "疚刃", "url": "https://space.bilibili.com/107716290"},
    "stats": {"views": 1733849, "likes": 204644, "coins": 16570, "favorites": 56198, "shares": 18396, "comments": 4607, "danmaku": 255},
    "isOriginal": true,
    "sourceType": "popular",
    "rank": 1,
    "danmaku": [{"timeSec": 0.0, "text": "根本没有这样的兔子", "sentAt": "2026-10-04T14:14:59Z", "mode": 5, "color": "#e70012"}],
    "scrapedAt": "2026-10-06T02:16:30Z"
}
```

### Scheduling and integrations

Create a task per keyword, turn on **Only new videos since the last run**, and schedule it daily: each run returns
only videos the previous runs have not delivered, and skipped videos are not charged. Send results to Google Sheets,
Slack, a webhook or your database with Apify integrations, or call the actor from the API.

### Use with AI assistants (MCP)

The actor works as a tool in the Apify MCP server, so Claude, ChatGPT or Cursor can call it directly: "find the
newest Bilibili videos about our product and summarise the danmaku".

### FAQ

**Do I need a Bilibili account or cookies?** No. Everything is fetched as a logged-out visitor.

**Why only the top 3 comments?** Bilibili shows visitors who are not logged in the top 3 comments of a video and the
first 20 replies of each. The actor never logs in, so that is what it returns.

**How many search results can I get?** Bilibili stops search at 1,000 results per keyword, and its pages repeat
some videos and mix in paid-course cards, which the actor removes. Expect roughly 750-1,000 unique videos per keyword
(766 for 美食 "food" in our October 2026 test). Use several keywords, date ranges or sort orders to cover more.

**Are titles translated?** No, text is returned as published (mostly Chinese). Chinese keywords find far more
videos than English ones.

**Is it legal?** The actor only reads publicly visible data. You are responsible for how you use it, including any
personal data, under the laws that apply to you.

**Something broke?** Open an issue on the Issues tab; errors are also reported to the developer automatically.

# Actor input Schema

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

Search by keyword, scrape specific videos, pull a creator's complete upload list, or read one of Bilibili's boards.

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

Keyword search mode. Each keyword is searched and paginated separately (Bilibili caps search at 1,000 videos per keyword). Chinese keywords match far more videos than English ones.

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

Keyword search mode: Bilibili's own ranking options.

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

Keyword search mode: only videos of this length.

## `publishedAfter` (type: `string`):

Keyword search mode. Date like 2026-10-01 (UTC).

## `publishedBefore` (type: `string`):

Keyword search mode. Date like 2026-10-06 (UTC).

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

Video URLs mode: https://www.bilibili.com/video/BV…, b23.tv short links, BV ids or av ids.

## `creatorIds` (type: `array`):

Creator uploads mode: numeric UID (mid) or https://space.bilibili.com/<uid>. Returns every upload, newest first.

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

Top-100 ranking mode.

## `maxItems` (type: `integer`):

Total rows to return across all keywords / creators.

## `fetchDetails` (type: `boolean`):

Full description, likes, coins, shares, favorites, video parts and original/re-upload flag for every search, board and upload row (one extra request per video).

## `includeTags` (type: `boolean`):

Adds the video's tags (one extra request per video).

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

Adds the danmaku lines of the video's first part, ordered by video time. Bilibili serves a sample per part (about 300 for short videos, more for long ones).

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

Cap on danmaku lines per video when danmaku is included.

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

Adds the top 3 comments with up to 20 replies each. This is the most Bilibili shows to visitors who are not logged in; the actor does not use any account.

## `onlyNewSinceLastRun` (type: `boolean`):

For scheduled monitoring: skip videos that an earlier run with the same input already returned (you are not charged for skipped videos).

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

Apify Proxy rotates the IP when Bilibili rate-limits a session.

## Actor input object example

```json
{
  "mode": "search",
  "searchQueries": [
    "原神",
    "iPhone 17 评测"
  ],
  "sortBy": "relevance",
  "durationFilter": "any",
  "videoUrls": [
    "https://www.bilibili.com/video/BV1GJ411x7h7",
    "BV1FhHW6dENg"
  ],
  "creatorIds": [
    "290526283",
    "https://space.bilibili.com/546195"
  ],
  "rankingCategory": "all",
  "maxItems": 100,
  "fetchDetails": true,
  "includeTags": true,
  "includeDanmaku": false,
  "maxDanmakuPerVideo": 100,
  "includeTopComments": false,
  "onlyNewSinceLastRun": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

// Run the Actor and wait for it to finish
const run = await client.actor("axlymxp/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("axlymxp/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 axlymxp/bilibili-scraper --silent --output-dataset

```

## MCP server setup

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