# Bilibili Scraper — Trending, Ranking & Video Stats (`hipersoft/bilibili-scraper`) Actor

Scrape Bilibili videos: title, uploader, views, likes, coins, favorites, danmaku, category, duration and cover. Popular feed, category rankings, or video details by BV id.

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

## Pricing

from $0.002 / video scraped

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 — Trending, Rankings, Video Stats & Metadata

**Scrape Bilibili** (哔哩哔哩) into clean JSON, CSV, Excel or XML. This Bilibili scraper extracts **video titles, uploaders, view counts, likes, coins, favorites, danmaku, replies, shares, category, duration, publish date, description and cover images** — from the popular/trending feed, category rankings (top 100), or any video by its BV id. A fast, cheap, no-code alternative to building your own Bilibili data pipeline: no setup, just add inputs and run.

Whether you track China's biggest video platform for creator intelligence, trend research or content analytics, this Bilibili video scraper turns the trending feed and rankings into a structured dataset in one run.

![Bilibili Scraper input — modes and options in the Apify Console](https://api.apify.com/v2/key-value-stores/SUfvnaFLd9z9eBCtV/records/bilibili-scraper-input.png)

### What does the Bilibili Scraper do?

The Bilibili Scraper crawls and extracts public Bilibili video data across three modes: the **popular/trending feed**, **category rankings** (the top 100 for any category), and **video details by BV id**. Point it at what you want and it returns structured data points — views, likes, coins, favorites, danmaku (bullet comments), replies, uploader, category, duration and more — ready for analytics, datasets, LLM pipelines, trend tracking or market research.

### What data can you scrape from Bilibili?

| Group | Fields |
|---|---|
| 📈 **Engagement stats** | view count, like count, **coins**, favorites, **danmaku** (bullet comments), replies, shares |
| 🎬 **Video metadata** | BV id, title, description, category, duration (seconds), publish date, cover image, canonical URL |
| 👤 **Uploader** | uploader name, uploader mid (member id) |
| 🔀 **Modes** | popular/trending feed, category ranking (top 100), video details by BV id |
| 🕒 **Run meta** | collected-at timestamp for every item |

### Use cases

- **Track trending videos** — snapshot the popular feed and category rankings to see what's rising on Bilibili right now.
- **Creator & channel intelligence** — pull uploader names, view counts and engagement to benchmark creators in any niche.
- **Content & market research** — study which formats, categories and topics win views, likes and coins.
- **Build a video dataset** — thousands of videos with views, likes, coins, danmaku and metadata for analytics or ML.
- **Engagement & sentiment signals** — measure danmaku, replies and favorites as audience-response indicators.
- **Competitor monitoring** — watch rankings over time to track share of attention in your category.
- **Recommendation & trend models** — feed structured engagement data into scoring and forecasting pipelines.
- **Academic & market studies** — analyze public video engagement on China's leading video platform.

### How to scrape Bilibili data

1. Click **Try for free / Start** to open the Bilibili Scraper.
2. Choose a **mode** — popular/trending feed, category ranking, or video details by BV id.
3. For ranking mode set the **category id**, or for details mode paste the **BV ids** you want.
4. Set **Max videos** to cap the run, then click **Run**.
5. Download the results as **JSON, CSV, Excel or XML**, or pull them from the API.

### Input

Pick a mode, then set the options for that mode. No login or setup required.

```json
{
  "mode": "popular",
  "maxItems": 200
}
```

Category ranking (top 100):

```json
{
  "mode": "ranking",
  "rankingCategoryId": 0,
  "maxItems": 100
}
```

Video details by BV id:

```json
{
  "mode": "videos",
  "bvids": ["BV1GJ411x7h7", "BV1xx411c7XX"]
}
```

| Field | Type | Description |
|---|---|---|
| `mode` | string | What to scrape: `popular` (trending feed), `ranking` (category top 100), or `videos` (details by BV id). |
| `rankingCategoryId` | integer | For `ranking` mode — the Bilibili category id (`0` = all categories). |
| `bvids` | array | For `videos` mode — the BV ids to fetch, e.g. `BV1xx411c7XX`. |
| `maxItems` | integer | Maximum number of videos to scrape (default 100). |

#### Scrape the popular / trending feed

Set `mode` to `popular` and Bilibili's trending videos are returned with full engagement stats and metadata, up to your `maxItems` cap.

#### Scrape category rankings

Set `mode` to `ranking` and choose a `rankingCategoryId` to pull the top 100 videos for that category (use `0` for all).

#### Scrape video details by BV id

Set `mode` to `videos` and pass the BV ids in `bvids` to fetch full stats and metadata for exactly the videos you want.

### Output

![Bilibili Scraper output — a videos dataset with views, likes, coins and metadata](https://api.apify.com/v2/key-value-stores/SUfvnaFLd9z9eBCtV/records/bilibili-scraper-output.png)

Each video is one dataset item:

```json
{
  "bvid": "BV1xx411c7XX",
  "title": "抵抗者2026实机演示",
  "uploader": "浩汤科技",
  "uploaderMid": 12345678,
  "views": 4693132,
  "likes": 120000,
  "coins": 30000,
  "favorites": 45000,
  "danmaku": 8000,
  "replies": 5400,
  "shares": 2100,
  "category": "游戏",
  "durationSec": 605,
  "publishedAt": "2026-07-28T10:00:00.000Z",
  "description": "全新实机演示，展示核心玩法与画面。",
  "coverImage": "https://i0.hdslb.com/bfs/archive/cover.jpg",
  "url": "https://www.bilibili.com/video/BV1xx411c7XX",
  "collectedAt": "2026-07-30T12:00:00.000Z"
}
```

#### Output schema

| Field | Type | Description |
|-------|------|-------------|
| `bvid` | string | Bilibili BV id of the video. |
| `title` | string | Video title. |
| `uploader` | string | Uploader (creator) display name. |
| `uploaderMid` | integer | Uploader member id (mid). |
| `views` | integer | Total view count. |
| `likes` | integer | Total like count. |
| `coins` | integer | Number of coins given to the video. |
| `favorites` | integer | Number of times the video was favorited. |
| `danmaku` | integer | Danmaku (bullet comment) count. |
| `replies` | integer | Number of comments/replies. |
| `shares` | integer | Number of shares. |
| `category` | string | Video category name. |
| `durationSec` | integer | Video length in seconds. |
| `publishedAt` | string (ISO date) | When the video was published. |
| `description` | string | Video description text. |
| `coverImage` | string (URL) | Cover/thumbnail image URL. |
| `url` | string (URL) | Canonical Bilibili video URL. |
| `collectedAt` | string (ISO date) | Timestamp when the item was collected. |

### Need more social & video data?

Building a wider dataset across Chinese social and video platforms? Pair the Bilibili Scraper with our other Actors:

- [Weibo Scraper](https://apify.com/hipersoft/weibo-scraper) — posts, profiles and engagement from Weibo.
- [Xiaohongshu Scraper](https://apify.com/hipersoft/xiaohongshu-scraper) — notes, creators and stats from RED / Little Red Book.
- [Douban Scraper](https://apify.com/hipersoft/douban-scraper) — movies, books and ratings from Douban.
- [Juejin Scraper](https://apify.com/hipersoft/juejin-scraper) — developer articles, authors and engagement from Juejin.

### FAQ

**Do I need a Bilibili account or API key?**
No. The Bilibili Scraper needs no login and no official API key — just choose a mode, set your inputs and run.

**How many videos can I scrape per run?**
As many as you like. Use `maxItems` to cap the run; the popular and ranking feeds and any list of BV ids let you scale up to thousands of videos.

**Can I scrape trending or ranking videos?**
Yes — set `mode` to `popular` for the trending feed, or `ranking` with a `rankingCategoryId` for the top 100 videos in a category.

**Can I get details for specific videos?**
Yes — set `mode` to `videos` and pass the BV ids in `bvids` to pull full stats and metadata for exactly those videos.

**Can it search by keyword?**
Not currently. This Actor covers the popular feed, category rankings and video details by BV id.

**How does billing work?**
You pay per video you scrape — a simple, cheap pay-per-result price with no monthly minimum.

**What export formats are supported?**
JSON, CSV, Excel and XML, plus webhooks and the Apify API.

**Can I automate or integrate the Bilibili Scraper?**
Yes. The Bilibili Scraper can be connected with almost any cloud service or web app thanks to [integrations on the Apify platform](https://apify.com/integrations). It works with [Make](https://apify.com/integrations/make), [Zapier](https://apify.com/integrations/zapier), [Slack](https://docs.apify.com/platform/integrations/slack), [Airbyte](https://docs.apify.com/platform/integrations/airbyte), [GitHub](https://docs.apify.com/platform/integrations/github), [Google Drive](https://docs.apify.com/platform/integrations/drive) and [many more](https://apify.com/integrations), plus the [Apify API](https://docs.apify.com/api/v2), JavaScript/Python clients and MCP. Or use [webhooks](https://docs.apify.com/platform/integrations/webhooks) to trigger an action whenever a run finishes — get a notification, or kick off another process such as loading your data downstream.

**Is scraping Bilibili legal?**
The Actor collects only public data. You are responsible for how you use it and for complying with Bilibili's terms and applicable laws.

### Related Actors

- [YouTube Scraper](https://apify.com/hipersoft/youtube-scraper) — videos, transcripts, comments and channels.
- [Weibo Scraper](https://apify.com/hipersoft/weibo-scraper) — posts, profiles and engagement.
- [Xiaohongshu Scraper](https://apify.com/hipersoft/xiaohongshu-scraper) — notes, creators and stats.
- [Douban Scraper](https://apify.com/hipersoft/douban-scraper) — movies, books and ratings.

### Notes

Original clean-room implementation. Collects only public Bilibili data; you are responsible for how you use the data and for complying with Bilibili's terms. This is an independent tool and is not affiliated with or endorsed by Bilibili.

# Actor input Schema

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

popular feed, category ranking, or video details by BV id.

## `rankingCategoryId` (type: `integer`):

For ranking mode: Bilibili category id (0 = all).

## `bvids` (type: `array`):

For videos mode: BV ids (e.g. BV1xx...).

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

Maximum videos to scrape.

## Actor input object example

```json
{
  "mode": "popular",
  "rankingCategoryId": 0,
  "bvids": [],
  "maxItems": 100
}
```

# Actor output Schema

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

The scraped results as dataset items.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("hipersoft/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 = {}

# Run the Actor and wait for it to finish
run = client.actor("hipersoft/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 '{}' |
apify call hipersoft/bilibili-scraper --silent --output-dataset

```

## MCP server setup

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