# Bilibili (B站) Trending Discovery Scraper (`foxlabs/bilibili-trending-scraper`) Actor

Discover what is trending on Bilibili (哔哩哔哩) right now — no login, no account, no cookies, no API key.

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

## Pricing

$0.50 / 1,000 trending videos

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 (B站) Trending Discovery Scraper

Discover **what is trending on Bilibili (哔哩哔哩 / B站) right now** — the videos, creators and categories rising across the site's hot boards — with **no login, no account, no cookies and no API key**.

### 🔥 What is it — and when should you use it?

Bilibili is China's largest long-form video community, and its hot boards are where Chinese youth culture, tech, gaming, knowledge and entertainment trends surface. This Actor reads those live trending boards and returns a clean, de-duplicated list of trending videos with their full engagement economics — views, likes, **coins (投币)**, **favorites (收藏)**, shares, comments and danmaku — plus the creator and category, with **no login, no account pool and no fragile anti-bot games**. Use it for trend research, content ideation, creator discovery and competitive monitoring.

It is a **discovery** tool. It does **not** do keyword search, region rankings, video detail/comments/subtitles or user profiles — those sit behind Bilibili's login / wbi-signature wall, and this Actor deliberately stays on the keyless surface instead of pretending to reach them.

### 🤖 Use with AI agents

The Actor is **pay-per-event** and built to be agent-friendly: zero required input, one clean output row per video, and a machine-readable result. Point any MCP-enabled assistant (Claude, ChatGPT, Cursor) at it on the Apify MCP server, or call it directly via the Apify API. Billing is per delivered video, so an agent pays only for what it collects; runs that deliver nothing are free.

### 📋 Overview

| | |
|---|---|
| **Source** | api.bilibili.com public trending boards (`popular`, `popular/precious`) |
| **Auth** | None — no login, cookie, account, API key or signature |
| **Method** | Pure HTTP over a rotating Apify proxy exit (no browser) |
| **Output** | One row per unique trending video |
| **Billing** | Pay per delivered unique video |

### ✨ Features

- 🔓 **Keyless** — no login, no account, no cookies, no wbi signature.
- 🎯 **Zero-config** — run it with no input at all and get the live hot board + the curated must-watch list.
- 📊 **Full engagement economics** — views, likes, **coins**, **favorites**, shares, comments and danmaku, every value a real integer (measured 100% fill).
- 🔁 **Deep, deduplicated sweep** — walks the hot board page by page and dedupes by `bvid` (measured: 400 videos, 0 duplicates).
- 🧱 **Reliable** — rotates a fresh exit per request; a single risk-controlled exit is retried, not fatal.
- 🧭 **Honest scope** — never returns empty "search" or "comment" columns it cannot fill.

### 🎬 Quick Start

```json
{ "feeds": ["popular", "precious"], "maxResults": 500 }
```

Or run it with **empty input** — it sweeps every trending board by default.

### 🚀 Getting Started (3 steps)

1. Pick one or both **Feeds** (or leave empty for all).
2. Set **Max results** (unique videos). Keep the default Apify proxy on.
3. Run — videos stream into the dataset as they are found.

### 📥 Input

| Field | Type | Description |
|---|---|---|
| `feeds` | array | `popular` (sitewide hot board, deep) and/or `precious` (curated must-watch). Empty = all. |
| `maxResults` | integer | Hard cap on unique videos. Default `500`. |
| `maxPages` | integer | Max pages walked per feed. Default `500`. |
| `maxRunSeconds` | integer | Optional soft time budget (0 = none). |
| `proxyConfiguration` | object | Defaults to Apify Proxy (datacenter); switch to residential only if risk-controlled. |

### 📤 Output

```json
{
  "bvid": "BV1kMxM6FECM",
  "aid": 117500000000000,
  "url": "https://www.bilibili.com/video/BV1kMxM6FECM",
  "title": "旗舰手机芯片大横评：苹果高通发哥玄戒谁最强？",
  "description": "本期横评覆盖……",
  "durationSeconds": 1180,
  "feed": "popular",
  "category": "手机",
  "categoryV2": "手机",
  "categoryTop": "数码",
  "authorMid": 325352,
  "authorName": "极客湾Geekerwan",
  "authorAvatar": "https://i0.hdslb.com/bfs/face/....jpg",
  "viewCount": 1213253,
  "likeCount": 159638,
  "coinCount": 198153,
  "favoriteCount": 52210,
  "shareCount": 12044,
  "replyCount": 7781,
  "danmakuCount": 9123,
  "historyRank": 1,
  "publishedAt": "2026-10-25T09:00:00.000Z",
  "pubLocation": "广东",
  "cover": "http://i0.hdslb.com/bfs/archive/....jpg",
  "shortLink": "https://b23.tv/BV1kMxM6FECM",
  "recommendReason": "15万点赞",
  "scrapedAt": "2026-10-27T18:20:11.004Z"
}
```

Download the dataset as JSON, CSV, Excel or HTML.

### 🧱 Data table

| Field | Description |
|---|---|
| `bvid` / `aid` | Video ids (`bvid` is the unique key). |
| `url` | Direct video URL. |
| `title` / `description` | Video title and description. |
| `durationSeconds` | Length in seconds. |
| `feed` | Trending board it came from (`popular` / `precious`). |
| `category` / `categoryV2` / `categoryTop` | Bilibili's three-level category. |
| `authorMid` / `authorName` / `authorAvatar` | The creator (UP主). |
| `viewCount` / `likeCount` / `coinCount` / `favoriteCount` / `shareCount` / `replyCount` / `danmakuCount` | Full engagement economics. |
| `historyRank` | Historical hot-board rank (if any). |
| `publishedAt` / `pubLocation` | Publish time (ISO) and location. |
| `cover` / `shortLink` | Cover image and short link. |
| `recommendReason` | Why Bilibili surfaced it (e.g. "15万点赞"). |
| `scrapedAt` | Collection time (ISO). |

### 🧠 How it works

Bilibili serves its trending boards as plain public JSON (`/x/web-interface/popular` and `/popular/precious`). The Actor fetches them over a rotating Apify proxy exit with a browser-like header set, reads `data.list[]`, and maps each video to a unified row. No browser, no cookie, no login request. The login / wbi-signature endpoints (keyword search, region ranking, video detail, comments, subtitles, user profile) are never contacted.

### 🧪 Data quality — measured

Measured on a 400-video `popular` sweep plus the full 98-video `precious` list (2026-10-27):

- **Uniqueness:** 400 / 400 videos unique (0 duplicates); 98 / 98 for precious.
- **Field fill:** bvid, title, author, views, likes, coins, favorites, shares, replies, danmaku, category, publish time, cover, duration all **100%**; publish location 99.5%.
- **Meaningful engagement:** view count median ≈ 534,000; **every** video has ≥ 10,000 views and none have 0 — these are genuinely trending videos, not noise.
- **Stability:** page 1 vs page 2 share 0 ids — the hot board paginates deterministically, so a deep sweep brings new videos without repeats.

### ⏱️ Performance — measured

The `popular` board returned 400 unique videos with **0 blocked exits and 0 read failures**; the `precious` list returns its full 98 in one page. The hot board paginates until it reports no more pages, so your `maxResults` cap is the practical limit.

### 💼 Use cases

- **Trend monitoring** — track what is rising on Bilibili daily per category.
- **Content ideation** — mine high-engagement titles, formats and categories.
- **Creator discovery** — find the UP主 behind trending videos.
- **Competitive / market research** — watch a category's momentum via coins/favorites, Bilibili's strongest quality signals.

### 🔗 Integration

Schedule it, connect it to Make / Zapier / n8n, or call the Apify API and push videos into a sheet, warehouse or dashboard. Each run's summary is written to the `SOURCE_REPORT` key-value record.

### 📊 Pricing

**Pay per delivered unique video.** A run that delivers nothing is not charged. See the Actor's pricing panel for the current per-video rate. Collecting the whole hot board is a single, inexpensive run.

### ❓ FAQ

- **Does it need my Bilibili login or cookies?** No. It never logs in and never asks you for an account, cookie or proxy of your own.
- **Can it do keyword search, region rankings, comments or subtitles?** No — those are login / wbi-signature gated and out of scope by design.
- **Do I need a residential proxy?** No. Bilibili's trending JSON is reachable over the default Apify datacenter proxy; switch to residential only if an exit gets risk-controlled.

### 🐛 Troubleshooting

- **A run returned nothing:** an exit may have been risk-controlled — just run again (the exit rotates), or switch to a residential proxy.
- **Fewer videos than expected:** the hot board has a finite depth; raise `maxResults` only up to what the board carries, and add the `precious` feed.

### 🚧 What it does not do

Keyword search, region rankings, video detail, comments, subtitles and user-profile details are **not** provided — they require Bilibili's login / wbi-signature API. This Actor is for trending **discovery** and will not return empty columns it cannot fill.

### ⚖️ Is it legal to scrape Bilibili trending data?

The Actor reads only publicly served, non-personal trending data that Bilibili renders to any visitor. Use the data in line with Bilibili's terms and applicable law; do not use it to store personal data without a lawful basis.

### 🤝 Support & contact

Questions or a custom need (another board, a different field)? Open an issue on the Actor's Issues tab.

### Changelog

See `CHANGELOG.md`.

# Changelog

This Actor's version history is a separate document: https://apify.com/foxlabs/bilibili-trending-scraper/changelog.md

# Actor input Schema

## `feeds` (type: `array`):

Which Bilibili trending boards to pull from. Leave empty for all. 'popular' is the live sitewide hot board (deep, paginated); 'precious' is the curated must-watch list (入站必刷).

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

Hard cap on delivered trending videos (deduplicated by bvid across the whole run). The sweep walks each board page by page until this cap, no more pages, or the curated list ends.

## `maxPages` (type: `integer`):

How many pages to walk per feed at most. Each page of the hot board returns ~20 videos. The run stops early on Max results or when the board reports no more pages.

## `maxRunSeconds` (type: `integer`):

Optional soft deadline. The run stops sweeping after this many seconds even if Max results is not reached. 0 means no time limit (only Max results / Max pages apply).

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

Defaults to Apify Proxy (datacenter, free on your plan) with a fresh exit per request. Bilibili's trending JSON is reachable without residential IPs; switch to residential only if a datacenter exit gets risk-controlled.

## Actor input object example

```json
{
  "feeds": [
    "popular",
    "precious"
  ],
  "maxResults": 500,
  "maxPages": 500,
  "maxRunSeconds": 0,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `sourceReport` (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 = {
    "feeds": [
        "popular",
        "precious"
    ],
    "maxResults": 500,
    "maxPages": 500,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("foxlabs/bilibili-trending-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 = {
    "feeds": [
        "popular",
        "precious",
    ],
    "maxResults": 500,
    "maxPages": 500,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("foxlabs/bilibili-trending-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 '{
  "feeds": [
    "popular",
    "precious"
  ],
  "maxResults": 500,
  "maxPages": 500,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call foxlabs/bilibili-trending-scraper --silent --output-dataset

```

## MCP server setup

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