# Bilibili Video Scraper — Search & Trending (哔哩哔哩) (`technicaldost/bilibili-video-scraper-search-trending`) Actor

Scrape Bilibili (哔哩哔哩) videos by keyword or from the trending (热门) list: title, views, likes, coins, favorites, danmaku, comments, shares, duration, tags, category, author and publish date. No login. $2 per 1,000 videos.

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

## Pricing

$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 Video Scraper collects public video data from **Bilibili (哔哩哔哩, B站)**, China's largest video platform for young audiences, **without an account, cookies or login**. Search by keyword (Chinese or English) and sort by views, newest, danmaku or favorites, or pull the live **trending (热门) list**. Every video comes with **views, likes, favorites, danmaku (bullet comments), comments, duration, tags, category, author and publish date**; trending videos also include **coins and shares**.

### What you get

- Keyword search with up to 1,000 videos per keyword, sorted by relevance, most viewed, newest, most danmaku or most favorited.
- Duration filter: under 10 minutes, 10–30, 30–60 or over 60 minutes.
- Trending (热门) videos with full stats: views, likes, coins, favorites, shares, danmaku and comments.
- Tags, category, author name and ID, cover image, description and exact publish time (UTC).
- Works in Chinese and English; titles are cleaned of search highlighting.
- Duplicates across keywords are removed, and you pay only for videos you get: $2 per 1,000.

### How to use Bilibili Video Scraper

1. Enter **Keywords** such as `python 教程`, `原神` or `iphone 17 评测`, or leave them empty to get trending videos.
2. Choose **Sort by** and, optionally, a **Duration** filter and how many videos per keyword.
3. Tick **Include trending** to add the current 热门 list.
4. Run the Actor and export the dataset to Excel, CSV or JSON, or schedule it daily.

### Input example

```json
{
  "keywords": [
    "python 教程"
  ],
  "sortBy": "most_viewed",
  "maxVideosPerKeyword": 50,
  "includeTrending": true,
  "maxTrendingVideos": 20
}
```

All fields are described in the **Input** tab.

### Output example

```json
{
  "bvid": "BV1wD4y1o7AS",
  "aid": 712020469,
  "title": "花了2万多买的Python教程全套，现在分享给大家，入门到精通(Python全栈开发教程)",
  "description": "【视频授权发布】最新版Python小白教程，从0开始…",
  "author": "Python_子木",
  "authorId": 612593877,
  "views": 35587428,
  "likes": 1098450,
  "coins": null,
  "favorites": 2570354,
  "danmaku": 250851,
  "comments": 23846,
  "shares": null,
  "durationSeconds": 88861,
  "category": "计算机技术",
  "tags": [
    "Python",
    "编程开发",
    "计算机技术"
  ],
  "publishedAt": "2020-09-07T10:00:00.000Z",
  "coverUrl": "https://i1.hdslb.com/bfs/archive/example.jpg",
  "url": "https://www.bilibili.com/video/BV1wD4y1o7AS",
  "source": "search",
  "searchKeyword": "python 教程",
  "scrapedAt": "2026-10-22T12:00:00.000Z"
}
```

#### Output fields

| Field | Description |
|---|---|
| `bvid` | Bilibili video ID (BV…). |
| `aid` | Numeric video ID (av). |
| `title` | Video title. |
| `description` | Video description. |
| `author` | Uploader (UP主) name. |
| `authorId` | Uploader ID (mid). |
| `views` | Play count. |
| `likes` | Likes. |
| `coins` | Coins given (trending only). |
| `favorites` | Times added to favorites. |
| `danmaku` | Bullet comments (弹幕). |
| `comments` | Comments. |
| `shares` | Shares (trending only). |
| `durationSeconds` | Length in seconds. |
| `category` | Bilibili category (分区). |
| `tags` | Video tags. |
| `publishedAt` | Publish time, ISO 8601 UTC. |
| `coverUrl` | Cover image URL. |
| `url` | Video page URL. |
| `source` | search or trending. |
| `searchKeyword` | Keyword that found the video. |
| `scrapedAt` | When the row was scraped. |

Export results as JSON, CSV, Excel, XML or HTML, or read them with the API.

### Use cases

- Brands and agencies: find the Bilibili creators (UP主) who rank for your product category before outreach.
- Market research: measure interest in games, gadgets, anime or courses in China by views and danmaku.
- Trend monitoring: save the trending list daily to track what goes viral on Bilibili.
- Content strategy: study titles, lengths and tags of the most viewed videos in a niche.
- Datasets for research and AI: Chinese video titles, descriptions, tags and engagement.

### How much does Bilibili Video Scraper cost?

This Actor uses **pay-per-event** pricing: **$0.002 per video** ($2 per 1,000). Platform usage is included. Searches with no results cost nothing.

Set **Maximum cost per run** in the run options to cap your spend; the Actor stops when the limit is reached.

### Use Bilibili Video Scraper with AI agents (MCP)

Give Claude, ChatGPT, Cursor or any MCP client this Actor as a tool through the hosted [Apify MCP server](https://mcp.apify.com):

```bash
claude mcp add --transport http apify "https://mcp.apify.com/?tools=technicaldost/bilibili-video-scraper-search-trending" --header "Authorization: Bearer YOUR_APIFY_TOKEN"
```

Or in a JSON MCP config:

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com/?tools=technicaldost/bilibili-video-scraper-search-trending",
      "headers": { "Authorization": "Bearer YOUR_APIFY_TOKEN" }
    }
  }
}
```

The tool is named `technicaldost--bilibili-video-scraper-search-trending`. Ask your agent, for example, to *"run Bilibili Video Scraper with {"keywords": \["python 教程"], "sortBy": "most_viewed", "maxVideosPerKeyword": 50, "includeTrending": true, "maxTrendingVideos": 20}"*.

### Run Bilibili Video Scraper via API

```bash
curl -X POST "https://api.apify.com/v2/acts/technicaldost~bilibili-video-scraper-search-trending/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"keywords": ["python 教程"], "sortBy": "most_viewed", "maxVideosPerKeyword": 50, "includeTrending": true, "maxTrendingVideos": 20}'
```

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("technicaldost/bilibili-video-scraper-search-trending").call(run_input={"keywords": ["python 教程"], "sortBy": "most_viewed", "maxVideosPerKeyword": 50, "includeTrending": True, "maxTrendingVideos": 20})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('technicaldost/bilibili-video-scraper-search-trending').call({"keywords": ["python 教程"], "sortBy": "most_viewed", "maxVideosPerKeyword": 50, "includeTrending": true, "maxTrendingVideos": 20});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

### Integrations

Schedule runs (daily, hourly) in Apify Console and send results to Google Sheets, Slack, Make, Zapier, n8n, Airbyte or your own webhook.

### FAQ

#### Do I need a Bilibili account or Chinese phone number?

No. The Actor uses Bilibili's public web search and trending pages as a logged-out visitor.

#### How many videos can I get per keyword?

Bilibili's search returns up to 1,000 videos (50 pages of 20) per keyword and sort order. Use several keywords or sort orders to cover more.

#### Why are coins and shares empty for search results?

Bilibili's search results do not include coins and shares. Trending videos include every stat.

#### Can I scrape a specific uploader's videos or comments?

Not in this version. Bilibili protects uploader pages with risk control; search for the uploader's name or topic instead.

#### Does it download videos?

No. It returns video data and links, not video files.

#### Is it legal to scrape this data?

The Actor collects publicly available information only and does not log in or bypass access controls. Use the data in line with the website's terms and the laws that apply to you, especially when processing personal data.

# Actor input Schema

## `keywords` (type: `array`):

Search terms, in Chinese or English. Leave empty to get only trending videos.

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

Order of search results.

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

Only return search results of this length.

## `maxVideosPerKeyword` (type: `integer`):

Up to 1,000.

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

Also save the current trending videos. Always on when no keywords are given.

## `maxTrendingVideos` (type: `integer`):

Up to 1,000.

## Actor input object example

```json
{
  "keywords": [
    "python 教程"
  ],
  "sortBy": "relevance",
  "duration": "any",
  "maxVideosPerKeyword": 50,
  "includeTrending": false,
  "maxTrendingVideos": 50
}
```

# 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 = {
    "keywords": [
        "python 教程"
    ],
    "maxVideosPerKeyword": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("technicaldost/bilibili-video-scraper-search-trending").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 = {
    "keywords": ["python 教程"],
    "maxVideosPerKeyword": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("technicaldost/bilibili-video-scraper-search-trending").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 '{
  "keywords": [
    "python 教程"
  ],
  "maxVideosPerKeyword": 50
}' |
apify call technicaldost/bilibili-video-scraper-search-trending --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,technicaldost/bilibili-video-scraper-search-trending"
        }
    }
}
```

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/dZ0No1b0hdz9eZPsW/builds/6YY2FiI2xRQniJFCN/openapi.json
