# Bilibili Scraper - Videos, Trending & Creators (B站 哔哩哔哩) (`get_anything/bilibili-scraper`) Actor

Scrape Bilibili (哔哩哔哩 / B站): search videos by keyword with views, likes, coins, favorites, danmaku and comments; Trending (热门) feed; hot search words (热搜); creator (UP主) profiles with followers. Optional tags and top comments. No login or cookies.

- **URL**: https://apify.com/get_anything/bilibili-scraper.md
- **Developed by:** [Get Anything](https://apify.com/get_anything) (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 $5.60 / 1,000 videos

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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, Trending & Creators (B站 哔哩哔哩)

Scrape **Bilibili (哔哩哔哩 / B站)**, China's biggest video community:

- 🔎 **Video search** by keyword (Chinese or English): title, UP主 (creator), **views, likes, danmaku (弹幕), comments, favorites**, duration, publish date, category, cover and keywords. Sort by relevance, views, newest, danmaku or favorites. Filter by length.
- 🔥 **Trending (热门)**: the current popular feed, with **coins and shares** and the trending reason.
- 📈 **Hot search words (热搜)**: what China is searching on Bilibili right now.
- 👤 **Creator (UP主) profiles**: followers, following, video count, total likes, level, verification and bio, by name, user ID (mid) or space link.
- 🏷️ **Optional:** each video's tags and its top comments.

No login, no cookies, no API key. Fast HTTP, cheap.

**中文简介：** 采集哔哩哔哩（B站）数据：关键词搜索视频（播放量、点赞、弹幕、评论、收藏、时长、发布时间）、热门视频、B站热搜、UP主资料（粉丝数、投稿数、获赞数、等级、认证）。无需登录、无需 Cookie。

### What you can do with it

- **China market and trend research:** what's popular and rising among Chinese Gen Z, by keyword and category.
- **Influencer (UP主) discovery:** find creators for a topic and compare followers and engagement.
- **Brand and product monitoring:** track videos and danmaku about your brand, game or product in China.
- **Content strategy:** which formats, lengths and topics get the most views, coins and favorites.
- **AI and LLM datasets:** Chinese video titles, descriptions, tags and top comments for analysis.

### Input

| Field | Description |
|---|---|
| `searchKeywords` | Keywords, e.g. `原神`, `iphone 17`, `AI`. |
| `maxResultsPerKeyword` | Default 20. Bilibili returns up to about 1,000 per keyword. |
| `sortBy` | `relevance`, `views`, `newest`, `danmaku`, `favorites`. |
| `duration` | `any`, `under-10`, `10-30`, `30-60`, `over-60` (minutes). |
| `includeTrending` + `maxTrending` | Add the Trending (热门) feed. |
| `includeHotSearches` | Add today's hot search words (热搜). |
| `creators` | UP主 names, mids or `space.bilibili.com/<mid>` links. |
| `includeTagsAndComments` | Add tags + top comments per video (small add-on charge). |

```json
{
  "searchKeywords": ["原神", "iphone 17"],
  "sortBy": "views",
  "maxResultsPerKeyword": 50,
  "includeTrending": true,
  "includeHotSearches": true,
  "creators": ["https://space.bilibili.com/2"]
}
```

### Output

**Video**

```json
{
  "resultType": "video",
  "bvid": "BV1hD4y1X7Rm",
  "url": "https://www.bilibili.com/video/BV1hD4y1X7Rm",
  "title": "《原神》角色演示-「钟离：听书人」",
  "author": "原神",
  "authorUrl": "https://space.bilibili.com/401742377",
  "category": "手机游戏",
  "views": 58757632,
  "likes": 1731677,
  "danmaku": 318933,
  "comments": 417953,
  "favorites": 772079,
  "duration": "7:38",
  "durationSeconds": 458,
  "publishedAt": "2020-11-30T04:00:08+00:00",
  "cover": "https://i1.hdslb.com/bfs/archive/....jpg",
  "keywords": ["米哈游", "miHoYo", "原神", "钟离"],
  "source": "search",
  "searchKeyword": "原神",
  "position": 1
}
```

Trending videos also include `coins`, `shares` and `trendingReason`. With `includeTagsAndComments` on, each video gets `tags` and `topComments` (text, likes, replies, author, IP location, date).

**Creator (UP主)**

```json
{
  "resultType": "creator",
  "mid": 2,
  "name": "碧诗",
  "url": "https://space.bilibili.com/2",
  "followers": 1433704,
  "videos": 44,
  "likes": 5097284,
  "level": 6,
  "verified": true,
  "verifiedTitle": "bilibili创始人（站长）"
}
```

**Hot search**

```json
{ "resultType": "hotSearch", "rank": 1, "keyword": "...", "searchUrl": "https://search.bilibili.com/all?keyword=..." }
```

### Use it from ChatGPT, Claude & AI agents

This Actor works as a tool for AI assistants through the **Apify MCP server**:

- **Claude, ChatGPT, Cursor, VS Code, Windsurf:** add this MCP server URL as a connector and sign in with your Apify account:

  ```
  https://mcp.apify.com/?tools=get_anything/bilibili-scraper
  ```

- **Claude Desktop / Cursor config:**

  ```json
  { "mcpServers": { "apify": { "url": "https://mcp.apify.com/?tools=get_anything/bilibili-scraper" } } }
  ```

- **REST / GPT Actions / LangChain:** `POST https://api.apify.com/v2/acts/get_anything~bilibili-scraper/run-sync-get-dataset-items?token=YOUR_TOKEN`

Then ask, for example: *"What's trending on Bilibili today, and which 原神 videos have the most views this year?"*

### Pricing

Pay per event: per video, per creator profile and per hot search word, plus a small add-on per video when tags + comments are on. See the Pricing tab.

### FAQ

**Do I need a Bilibili account or cookies?** No. Only data Bilibili shows to logged-out visitors.

**Why only the top 3 comments?** Bilibili shows logged-out visitors only the top comments of each video. This Actor doesn't log in.

**Can I get a creator's full upload list?** Not in this version. Bilibili protects that list with risk control. Use keyword search with the creator's name, or the creator profile.

**Does it work outside China?** Yes. It runs on Apify's servers worldwide.

# Actor input Schema

## `searchKeywords` (type: `array`):

Search Bilibili videos by keyword, in Chinese or English, e.g. '原神', 'iphone 17', 'AI'.

## `maxResultsPerKeyword` (type: `integer`):

Maximum videos per keyword (Bilibili returns up to ~1,000). 0 = all.

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

Search result order.

## `duration` (type: `string`):

Only videos of this length.

## `includeTrending` (type: `boolean`):

Add Bilibili's current Trending (热门) feed.

## `maxTrending` (type: `integer`):

How many trending videos to return.

## `includeHotSearches` (type: `boolean`):

Add today's top search words on Bilibili (about 10).

## `creators` (type: `array`):

Creator names, user IDs (mid) or space.bilibili.com links. Returns profile, followers, video count, likes, level and verification.

## `includeTagsAndComments` (type: `boolean`):

Add each video's tags and its top comments (Bilibili shows logged-out visitors the top 3). Charged as a small add-on per video.

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

Usually not needed. If Bilibili limits the IP, enable Apify Proxy.

## Actor input object example

```json
{
  "searchKeywords": [
    "原神"
  ],
  "maxResultsPerKeyword": 10,
  "sortBy": "relevance",
  "duration": "any",
  "includeTrending": true,
  "maxTrending": 10,
  "includeHotSearches": false,
  "includeTagsAndComments": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

One item per video, creator profile or hot search word.

# 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 = {
    "searchKeywords": [
        "原神"
    ],
    "maxResultsPerKeyword": 10,
    "includeTrending": true,
    "maxTrending": 10,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("get_anything/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 = {
    "searchKeywords": ["原神"],
    "maxResultsPerKeyword": 10,
    "includeTrending": True,
    "maxTrending": 10,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("get_anything/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 '{
  "searchKeywords": [
    "原神"
  ],
  "maxResultsPerKeyword": 10,
  "includeTrending": true,
  "maxTrending": 10,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call get_anything/bilibili-scraper --silent --output-dataset

```

## MCP server setup

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