# Bilibili Search Scraper - Find Videos by Keyword (`pipiagent/bilibili-search-scraper`) Actor

Search Bilibili (哔哩哔哩, B站) videos by keyword and get title, views, likes, favorites, comments, tags, creator and publish date. Sort by newest or most viewed. English field names. No login needed.

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

## Pricing

$3.00 / 1,000 results

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

Search [Bilibili](https://www.bilibili.com) (哔哩哔哩), China's largest video community, by keyword and export the matching videos with their statistics.

Use it to monitor how a brand, product or topic is covered on Bilibili, to find creators who talk about your category, or to track trends in China.

- **Search like a user, export like an analyst.** Keywords in, a table of videos out.
- **Sort and filter.** Best match, newest, most viewed, and video length.
- **English field names.** Clean JSON with `views`, `likes` and `publishedAt`. Text stays in the original language.
- **No login and no proxy needed.**
- **Low price.** $3 per 1,000 videos.

### How to use it

1. Click **Try for free**.
2. Type your keywords in **Search keywords**. Add the Chinese name of a brand as a separate keyword, it usually finds many more videos.
3. Click **Start**, then download the results as JSON, CSV or Excel.

### Input example

```json
{
    "searchQueries": ["耐克", "Nike"],
    "sortOrder": "pubdate",
    "maxItemsPerQuery": 200,
    "maxItems": 400
}
```

### Output example

```json
{
    "type": "video",
    "bvid": "BV1KwWXzKEcn",
    "aid": 115410787698957,
    "url": "https://www.bilibili.com/video/BV1KwWXzKEcn",
    "title": "AI",
    "durationSeconds": 31,
    "publishedAt": "2025-10-21T06:43:20Z",
    "category": "日常",
    "tags": ["秘书", "AI"],
    "authorId": 417221062,
    "authorName": "AIvbju",
    "authorUrl": "https://space.bilibili.com/417221062",
    "views": 158100,
    "likes": 1528,
    "favorites": 1738,
    "comments": 53,
    "danmakuCount": 17,
    "searchQuery": "AI",
    "scrapedAt": "2026-10-10T13:52:00Z"
}
```

### How much does it cost?

You pay per saved result: **$3.00 per 1,000 videos**. There is no start fee and no monthly rental. Turning on **Add full statistics** does not change the price.

| Run | Results | Cost |
|---|---|---|
| 100 videos for one keyword | 100 | $0.30 |
| 1,000 videos for one keyword | 1,000 | $3.00 |

Set a maximum charge per run in the run options and the Actor stops when it is reached.

### Limits you should know

- **At most 1,000 videos per keyword.** This is Bilibili's own limit. To get more, use several related keywords or different sort orders.
- **Coins and shares need the extra switch.** Search listings do not include them. Turn on **Add full statistics** to add them.
- **Duplicates across keywords are kept.** Each result has a `searchQuery` field that says which keyword found it.

### Related Actors

- [Bilibili Scraper](https://apify.com/pipiagent/bilibili-scraper): video details, creator profiles, uploads, rankings and comments.
- [Bilibili Danmaku Scraper](https://apify.com/pipiagent/bilibili-danmaku-scraper): the on-screen comments of a video, with timestamps.

### FAQ

**Is it legal?** The Actor collects only data that Bilibili shows publicly to every visitor. Results can contain personal data such as usernames. Make sure you have a legitimate reason to process it, as required by the GDPR and similar laws.

**Something is broken or missing?** Open a ticket in the Issues tab. Issues are usually answered within a day.

# Actor input Schema

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

Chinese and English both work, for example "Nike", "耐克" or "AI tutorial". Chinese keywords usually find far more videos.

## `maxItems` (type: `integer`):

Maximum number of results to save in this run. You are only charged for saved results.

## `maxItemsPerQuery` (type: `integer`):

Optional. Limits results for each keyword, so that one keyword does not use up the whole run.

## `sortOrder` (type: `string`):

Order of the search results.

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

Keep only videos of this length.

## `includeDetails` (type: `boolean`):

Opens every video to add coins, shares and exact counts. Makes two extra requests per video, so runs take longer. The price per result stays the same.

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

Optional. The Actor works without a proxy. Turn one on only if runs start failing with blocked requests.

## Actor input object example

```json
{
  "searchQueries": [
    "AI"
  ],
  "maxItems": 100,
  "sortOrder": "totalrank",
  "duration": "any",
  "includeDetails": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Videos saved by the run, one item per video.

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

// Run the Actor and wait for it to finish
const run = await client.actor("pipiagent/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 = { "searchQueries": ["AI"] }

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

```

## MCP server setup

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