# Bilibili Scraper - Videos, Views, Likes, Danmaku & Trending (`pink_comic/bilibili-scraper`) Actor

Scrape Bilibili videos by keyword, trending list or URL: title, uploader, views, likes, coins, favorites, danmaku, comments, tags, duration and date. No login.

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

## Pricing

from $2.00 / 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.

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, Views, Likes, Danmaku & Trending

Scrape **Bilibili (哔哩哔哩)**, China's largest video community, by keyword, from the **trending (popular) list**, or by video URL. Every row has the BV ID, URL, title, description, uploader (name, ID, space URL), category, **views, likes, favorites, danmaku (bullet comments), comments**, tags, duration and publish time; full stats add **coins, shares, publish location and original/repost flag**. Uses Bilibili's public web API with a visitor session. **No login, no cookies to supply, no Chinese phone number.**

### Why this Bilibili scraper

- **10x cheaper.** $0.002 per video. Other Bilibili actors charge $0.01-$0.12 per video.
- **Keyword search with real filters.** Sort by relevance, views, newest, danmaku or favorites; filter by duration. Up to 1,000 videos per keyword.
- **Trending list.** Bilibili's current popular videos with full stats and the trending reason.
- **Clean English field names.** Ready for spreadsheets, BI tools and LLMs.
- **Reliable.** Automatic visitor-cookie refresh and backoff on Bilibili's risk control.

### Use cases

- **China market and trend research**: what is popular now and which topics are growing.
- **Brand and product monitoring**: track mentions of your brand or product on Bilibili by keyword, newest first.
- **KOL / creator discovery**: find uploaders by topic, ranked by views and engagement.
- **Gaming, anime and tech insights**: Bilibili is the main hub for these communities in China.
- **AI agents and RAG**: structured Chinese video metadata for analysis or translation.

### Input examples

Keyword search (default):

```json
{ "searchQueries": ["minecraft"], "maxResults": 50 }
```

Newest videos for two keywords, 10-30 minutes long:

```json
{ "searchQueries": ["原神", "iPhone 17"], "sortBy": "date", "duration": "medium", "maxResultsPerInput": 200, "maxResults": 400 }
```

Trending videos plus full stats for specific videos:

```json
{ "trending": true, "videoUrls": ["https://www.bilibili.com/video/BV18YWq6UENE"], "maxResults": 200 }
```

### Sample output

```json
{
  "bvid": "BV18YWq6UENE",
  "aid": 117608200347579,
  "url": "https://www.bilibili.com/video/BV18YWq6UENE",
  "title": "這MC模組會讓你看見最嚇人的畫面？我後悔下載來玩了..😨🙏【Minecraft 我的世界】",
  "authorName": "阿浪哥ahlangge",
  "authorId": 478867697,
  "authorUrl": "https://space.bilibili.com/478867697",
  "category": "单机游戏",
  "views": 5765,
  "likes": 463,
  "coins": 116,
  "favorites": 266,
  "shares": 7,
  "danmaku": 131,
  "comments": 34,
  "tags": ["Minecraft", "我的世界", "MC 生存"],
  "duration": "17:29",
  "durationSeconds": 1049,
  "publishedAt": "2026-11-14T10:00:00Z",
  "isOriginal": true,
  "thumbnail": "https://i1.hdslb.com/bfs/archive/5d018f6cadd16026f371c5d5e179efc2d19661f9.jpg",
  "input": "https://www.bilibili.com/video/BV18YWq6UENE",
  "inputType": "video",
  "scrapedAt": "2026-11-14T17:39:54Z"
}
```

| Field | Description |
|---|---|
| bvid, aid, url, title, description, thumbnail | Video basics |
| authorName, authorId, authorUrl, authorAvatar | Uploader |
| views, likes, favorites, danmaku, comments | Engagement |
| coins, shares, publishLocation, isOriginal, parts | Full stats (details on, trending, or video URLs) |
| category, tags, duration, durationSeconds, publishedAt | Metadata |
| input, inputType | What produced the row |

### Pricing

Pay per event: **$0.002 per run start + $0.002 per video**. 50 videos ≈ $0.10, 1,000 videos ≈ $2. Set a max charge on the run to cap spend; the actor stops at your budget.

### FAQ

**Do I need a Bilibili account?** No. The actor uses a temporary visitor session, the same as an anonymous browser.

**How many videos per keyword?** Bilibili search returns up to 1,000 videos (50 pages) per keyword. Use several keywords, sorts or duration filters for more.

**Does it get comments or danmaku text?** Counts are included. Comment and danmaku text are not included yet.

**Is it legal?** The actor collects publicly available video metadata without logging in. Use the data in line with applicable laws and Bilibili's terms.

# Actor input Schema

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

Bilibili search keywords (Chinese or English), e.g. 'minecraft', '原神', 'iPhone 17'.

## `trending` (type: `boolean`):

Also scrape Bilibili's current popular/trending list (up to ~1,000 videos).

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

Bilibili video links or IDs (BV... or av...) to get full stats for.

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

Search result order.

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

Search video length filter.

## `includeVideoDetails` (type: `boolean`):

Open each search result to add coins, shares, exact category, publish location and original/repost flag (slower, same price). Always on for Video URLs.

## `maxResultsPerInput` (type: `integer`):

Cap per keyword / trending. Bilibili search returns up to 1,000 videos per keyword. 0 = use Max results.

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

Maximum videos in total. Default 50 = about $0.10.

## Actor input object example

```json
{
  "searchQueries": [
    "minecraft"
  ],
  "trending": false,
  "sortBy": "relevance",
  "duration": "any",
  "includeVideoDetails": false,
  "maxResultsPerInput": 0,
  "maxResults": 50
}
```

# Actor output Schema

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

All records from this run in the default dataset, shown with the Overview table view.

# 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": [
        "minecraft"
    ],
    "maxResults": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("pink_comic/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": ["minecraft"],
    "maxResults": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("pink_comic/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": [
    "minecraft"
  ],
  "maxResults": 50
}' |
apify call pink_comic/bilibili-scraper --silent --output-dataset

```

## MCP server setup

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