# Bilibili Search Scraper - B站 Videos & Comments (`seemuapps/bilibili-search-scraper`) Actor

Scrape Bilibili (哔哩哔哩) videos by keyword with views, likes, danmaku, favorites, tags and uploader, plus top comments. Sort and filter by date.

- **URL**: https://apify.com/seemuapps/bilibili-search-scraper.md
- **Developed by:** [Seemu Scraping](https://apify.com/seemuapps) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 96.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.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 Search Scraper - B站 Videos & Comments

Search Bilibili (哔哩哔哩, B站, China's YouTube) by keyword and export every matching video with views, likes, danmaku (bullet comments), comments, favorites, tags, category and uploader, plus each video's top comments if you want them. Sort by relevance, most viewed, latest, most danmaku or most saved, and filter by length and publish date. No login and no Bilibili account needed.

### What you get

One row per video (`type: "video"`):

- **Video**: BV ID, title, description, URL, cover image, duration, publish time, tags and category
- **Engagement**: views, likes, danmaku count, comment count and favorites
- **Uploader**: name, ID (mid), channel URL and avatar

With **Include comments** on, one row per comment (`type: "comment"`):

- Comment text, likes, reply count, time, pinned flag and attached images
- Commenter name, ID, channel URL, Bilibili level and avatar

### Use cases

- **Market research in China**: see which videos and creators lead a topic, game or product category on Bilibili
- **Gen Z and gaming insights**: Bilibili is where young Chinese audiences discuss games, anime, tech and lifestyle
- **Influencer discovery**: find uploaders with the most viewed and most saved videos for a keyword
- **Audience feedback and sentiment**: export the top comments on any topic's leading videos
- **Content strategy**: compare titles, lengths and tags of the best-performing videos

### How to use

1. Enter one or more **Search keywords**
2. Choose **Sort by**, and optionally a **Duration** and publish date range
3. Set **Max videos per keyword** (Bilibili returns up to 1,000 per search)
4. Turn on **Include comments** to also collect top comments for each video
5. Run the actor and export from the **Dataset** tab as JSON, CSV or Excel

### Output example

```json
{
  "type": "video",
  "videoId": "BV1X6Yx62Eoa",
  "aid": 117240510881154,
  "url": "https://www.bilibili.com/video/BV1X6Yx62Eoa",
  "title": "父母以为的事",
  "description": null,
  "coverUrl": "https://i0.hdslb.com/bfs/archive/558d31996107c48b100f0cea092….jpg",
  "durationSeconds": 34,
  "publishedAt": "2026-09-09T10:07:43.000Z",
  "views": 4456331,
  "likes": 281345,
  "danmaku": 182,
  "comments": 2809,
  "favorites": 12161,
  "tags": ["新人", "UP主原创剧场", "原神", "Vlog"],
  "category": "日常",
  "authorName": "西维西师傅",
  "authorId": "102805877",
  "authorUrl": "https://space.bilibili.com/102805877",
  "keyword": "原神",
  "rank": 1,
  "scrapedAt": "2026-10-28T23:38:24.930Z"
}
```

Comment row:

```json
{
  "type": "comment",
  "commentId": "3762650119",
  "videoId": "BV1hD4y1X7Rm",
  "videoUrl": "https://www.bilibili.com/video/BV1hD4y1X7Rm",
  "text": "“被钟离先生缠上了，可就什么办法也没有了”\n我无所谓！",
  "likes": 49218,
  "replyCount": 93,
  "createdAt": "2020-11-30T04:00:20.000Z",
  "isPinned": false,
  "imageUrls": [],
  "authorName": "磁爆步兵54",
  "authorId": "3443416",
  "authorUrl": "https://space.bilibili.com/3443416",
  "authorLevel": 6
}
```

### FAQ

**Do I need a Bilibili account or cookies?** No.

**What is danmaku?** Bullet comments: the messages viewers send that fly across the video while it plays. `danmaku` is how many a video has.

**Which comments do I get?** The top comments, ordered the way Bilibili ranks them (most liked and most replied first), including the pinned comment.

**How do I get only the video rows?** Leave **Include comments** off, or filter the dataset by `type`.

# Actor input Schema

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

What to search for on Bilibili, one keyword per line. Chinese keywords return the most results.

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

Result order, same as the sort menu on Bilibili search.

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

Only videos of this length.

## `publishedAfter` (type: `string`):

Only videos published on or after this date (YYYY-MM-DD).

## `publishedBefore` (type: `string`):

Only videos published on or before this date (YYYY-MM-DD).

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

How many videos to collect for each keyword. Bilibili returns up to 1,000 results per search.

## `includeComments` (type: `boolean`):

Also collect each video's top comments (most liked first), as separate rows with type comment.

## `maxCommentsPerVideo` (type: `integer`):

How many comments to collect per video when Include comments is on.

## Actor input object example

```json
{
  "keywords": [
    "原神"
  ],
  "sortBy": "relevance",
  "duration": "any",
  "maxVideosPerKeyword": 50,
  "includeComments": false,
  "maxCommentsPerVideo": 20
}
```

# Actor output Schema

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

One row per video (type video): BV id, title, description, views, likes, danmaku, comments, favorites, duration, tags, category, publish time and uploader. With comments on, one row per comment (type comment): text, likes, reply count, time and commenter.

# 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": [
        "原神"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("seemuapps/bilibili-search-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 = { "keywords": ["原神"] }

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

```

## MCP server setup

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