# Bilibili Search Scraper for Videos and Creators (`arjun_code/bilibili-search-scraper`) Actor

Search Bilibili videos and creators by keyword. Filter by date and duration, sort by relevance, views, newest, danmaku, or favorites, and export detailed video metrics, tags, categories, author data, creator account fields, and ranked results. No login required.

- **URL**: https://apify.com/arjun\_code/bilibili-search-scraper.md
- **Developed by:** [Arjun AI](https://apify.com/arjun_code) (community)
- **Categories:** Videos, Social media, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $6.50 / 1,000 detailed video results

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Bilibili Search Scraper for Videos and Creators

Search Bilibili (哔哩哔哩 / B站) videos and creator or UP主 accounts by keyword, then export clean, ranked records for content research, creator discovery, trend monitoring, and data analysis. The Actor preserves Bilibili's search ordering, verifies selected video filters, and does not require a Bilibili account or API key.

Choose one result type per run:

- **Videos:** search by keyword, filter by publication date and duration, sort by relevance, views, publication time, danmaku, or favorites, then enrich every result with public video details and engagement metrics.
- **Creators:** find Bilibili accounts by keyword and filter or rank them by account type, verification, followers, or user level.

### Why use this Actor?

- **Two focused search modes:** output contains only video records or only creator records in a run.
- **Bilibili ordering with reliable filters:** sorting stays on Bilibili's search endpoint. Selected publication-date and duration filters are also verified while paging, because Bilibili can ignore those two native parameters when they are combined.
- **Detailed video metrics:** receive views, likes, coins, favorites, shares, danmaku, comments, tags, category, duration, and author identity when public.
- **Useful creator discovery fields:** receive followers, video count, level, verification, profile description, creator status, and live-room information when available.
- **Clean ranked output:** every successful record includes its source keyword and rank.
- **Visible empty and failed outcomes:** a keyword that returns nothing or cannot be processed creates a structured Dataset status row instead of leaving the Dataset silently empty.
- **No account required:** the Actor extracts metadata that Bilibili exposes publicly.
- **Responsible request pacing:** requests are serialized, lightly spaced, and retried only once for temporary network, server, or rate-limit failures.

### Input

#### Common settings

| Field | Type | Default | Description |
|---|---|---:|---|
| `searchQueries` | string array, 1–10 items | `["人工智能"]` | One or more keyword phrases. The limit applies separately to every keyword. |
| `searchType` | `videos` or `users` | `videos` | Select one consistent result type for the run. The UI labels `users` as **Creators**. |
| `maxResultsPerQuery` | integer, 1–50 | `5` | Maximum successful records returned for each keyword. The maximum run size is 500 successful records. |

#### Video-only settings

These values are ignored when `searchType` is `users`.

| Field | Options | Default | What it does |
|---|---|---|---|
| `videoSortBy` | `relevance`, `mostViewed`, `newest`, `mostDanmaku`, `mostFavorited` | `relevance` | Uses Bilibili's server-side video result order. |
| `videoUploadDate` | `any`, `lastDay`, `lastWeek`, `lastSixMonths` | `any` | Limits results by Bilibili publication time and verifies the returned timestamps. |
| `videoDuration` | `any`, `under10Minutes`, `10To30Minutes`, `30To60Minutes`, `over60Minutes` | `any` | Uses Bilibili's duration buckets and verifies the returned duration. |

#### Creator-only settings

These values are ignored when `searchType` is `videos`.

| Field | Options | Default | What it does |
|---|---|---|---|
| `userType` | `all`, `creators`, `regular`, `verified` | `all` | Limits results to all users, UP creators, regular users, or verified users. |
| `userSortBy` | `relevance`, `mostFollowers`, `fewestFollowers`, `highestLevel`, `lowestLevel` | `relevance` | Uses Bilibili's creator-search ordering. |

### Quick-start examples

#### Search videos

```json
{
  "searchQueries": ["人工智能"],
  "searchType": "videos",
  "maxResultsPerQuery": 5,
  "videoSortBy": "mostViewed",
  "videoUploadDate": "lastSixMonths",
  "videoDuration": "over60Minutes"
}
```

#### Find creators

```json
{
  "searchQueries": ["人工智能"],
  "searchType": "users",
  "maxResultsPerQuery": 5,
  "userType": "verified",
  "userSortBy": "mostFollowers"
}
```

### How to run it

1. Add one or more values under **Search keywords**.
2. Select **Videos** or **Creators** under **Result type**.
3. Adjust only the filter section for the selected result type.
4. Click **Start**.
5. Open the **Output** tab to review the ranked table or export the Dataset as JSON, CSV, Excel, XML, or JSONL.

### Real output samples

The following selected values came from real public Bilibili lookups on September 3, 2026. Live metrics can change after the sample is recorded.

#### Video record

```json
{
  "recordType": "video",
  "bvid": "BV1qZSLBYEpa",
  "aid": 115626794420560,
  "cid": 34332936080,
  "title": "【整整600集】清华大学196小时讲完的AI人工智能从入门到精通全套教程，全程干货无废话！学完变大佬！这还学不会，我退出IT圈！机器学习-深度学习-opencv",
  "description": "课程涵盖基础概念、算法原理、实践应用，从零开始，深入浅出。通过实例演示，掌握神经网络、决策树、支持向量机等关键技术。适合初学者和进阶者，助您快速提升技能，开启智能时代新篇章。立即观看，开启您的AI学习之旅！",
  "url": "https://www.bilibili.com/video/BV1qZSLBYEpa",
  "thumbnailUrl": "https://i0.hdslb.com/bfs/archive/886e0ea5bd30fdd9ddb66eb5ce108b1a3193d450.jpg",
  "durationSeconds": 195568,
  "durationText": "54:19:28",
  "publishedAt": "2025-11-28T10:20:16Z",
  "categoryId": 231,
  "categoryName": "计算机技术",
  "viewCount": 1023601,
  "likeCount": 24025,
  "coinCount": 19099,
  "favoriteCount": 60224,
  "shareCount": 11470,
  "danmakuCount": 8113,
  "commentCount": 14142,
  "authorMid": 1741962246,
  "authorName": "IT界扛霸子",
  "authorUrl": "https://space.bilibili.com/1741962246",
  "authorAvatarUrl": "https://i0.hdslb.com/bfs/face/330a8ac40ac349d550961219984ba2fc269661ab.jpg",
  "tags": ["IT", "计算机", "AI", "人工智能", "编程", "机器学习"],
  "searchQuery": "人工智能",
  "searchRank": 1,
  "scrapedAt": "2026-09-03T07:18:53.345216Z"
}
```

#### Creator record

```json
{
  "recordType": "user",
  "mid": 11515399,
  "name": "极逸人工智能",
  "profileUrl": "https://space.bilibili.com/11515399",
  "avatarUrl": "https://i0.hdslb.com/bfs/face/4a51c264c47b3c759f3efabf51532900e6ac503d.jpg",
  "description": "SOON二测现已圆满结束，感谢全体创作者的鼎力支持与宝贵反馈，我们会继续打磨产品，敬请期待后续版本。",
  "followerCount": 67441,
  "videoCount": 178,
  "level": 6,
  "gender": "male",
  "isCreator": true,
  "isVerified": true,
  "verificationType": "organization",
  "verificationDescription": "极逸人工智能科技有限公司",
  "isLive": true,
  "liveRoomId": 7397397,
  "liveRoomUrl": "https://live.bilibili.com/7397397",
  "searchQuery": "人工智能",
  "searchRank": 2,
  "scrapedAt": "2026-09-03T07:17:02.787817Z"
}
```

### Output fields

#### `recordType: "video"`

| Group | Fields |
|---|---|
| IDs and links | `bvid`, `aid`, `cid`, `url` |
| Content | `title`, `description`, `thumbnailUrl`, `tags` |
| Time | `durationSeconds`, `durationText`, `publishedAt`, `publishTimestamp` |
| Category | `categoryId`, `categoryName`, `categoryV2Id`, `categoryV2Name` |
| Engagement | `viewCount`, `likeCount`, `coinCount`, `favoriteCount`, `shareCount`, `danmakuCount`, `commentCount` |
| Author | `authorMid`, `authorName`, `authorUrl`, `authorAvatarUrl` |
| Search context | `searchQuery`, `searchRank`, `scrapedAt` |

#### `recordType: "user"`

| Group | Fields |
|---|---|
| Identity | `mid`, `name`, `profileUrl`, `avatarUrl`, `description` |
| Account | `followerCount`, `videoCount`, `level`, `gender`, `isCreator` |
| Verification | `isVerified`, `verificationType`, `verificationDescription` |
| Live room | `isLive`, `liveRoomId`, `liveRoomUrl` |
| Search context | `searchQuery`, `searchRank`, `scrapedAt` |

Fields remain `null` when Bilibili does not expose a value. For example, a newer category ID can be present while its text label is absent. The Actor does not invent values or convert missing metrics to zero.

### Empty-result and error rows

The Dataset receives a `searchStatus` record when a keyword has no matching public results or a search request fails:

```json
{
  "recordType": "searchStatus",
  "status": "noResults",
  "searchType": "users",
  "searchQuery": "zzzz_no_such_bilibili_user_9f4c2a8d6e1b",
  "searchRank": null,
  "errorCode": "NO_SEARCH_RESULTS",
  "message": "No matching public Bilibili users were found.",
  "scrapedAt": "2026-09-03T07:18:00.635519Z"
}
```

Video search can also return `videoLookupError` when a ranked search hit is found but its detail request fails. These status and error rows make failures observable and do not trigger a successful-result billing event.

The default Key-Value Store record named `OUTPUT` contains totals and per-keyword statuses for the complete run. It also reports `requestCount`, `retryCount`, `blockedResponseCount`, `proxyFallbackCount`, and `videoDetailCacheHits`. These operational totals are not added to normal Dataset records.

### Run through the Apify API

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/arjun_code~bilibili-search-scraper/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "searchQueries": ["人工智能"],
    "searchType": "videos",
    "maxResultsPerQuery": 5,
    "videoSortBy": "relevance",
    "videoUploadDate": "any",
    "videoDuration": "any"
  }'
```

### Pricing

This Actor uses pay-per-event pricing. You pay for successful results, while visible status and lookup-error records do not trigger a result charge.

| Event | Free | Bronze | Silver | Gold, Platinum, Diamond |
|---|---:|---:|---:|---:|
| Detailed video result | $8.00 / 1,000 | $7.50 / 1,000 | $7.00 / 1,000 | $6.50 / 1,000 |
| Creator result | $4.00 / 1,000 | $3.75 / 1,000 | $3.50 / 1,000 | $3.25 / 1,000 |
| Actor start | $0.00005 / run | $0.00005 / run | $0.00005 / run | $0.00005 / run |

At the Free-plan rate, the default five-result run costs about **$0.04005 for videos** or **$0.02005 for creators**. Fifty results cost about $0.40005 or $0.20005 respectively. Platform usage is included in the event price under the current Store configuration.

Billing event names:

- `bilibili-video-result` — one successfully saved and enriched video record.
- `bilibili-creator-result` — one successfully saved creator record.
- `apify-actor-start` — the small run-start charge.
- `searchStatus` and `videoLookupError` rows do not trigger a successful-result event; only the run-start charge can remain when no successful result is returned.

The Actor honors the user's maximum event-charge limit and stops adding paid results when that limit is reached. If the same video appears under multiple input keywords, each ranked Dataset result is a separate paid result. Store pricing can change, so the Actor's **Pricing** tab remains the source of truth.

### FAQ

#### Is a Bilibili account or API key required?

No. This Actor searches metadata that Bilibili exposes publicly. It does not access private, member-only, or account-specific data.

#### Are video filters applied to creator searches?

No. `videoSortBy`, `videoUploadDate`, and `videoDuration` are ignored for creator searches. Creator filters are likewise ignored for video searches.

#### Does sorting happen after scraping?

No. The Actor sends the selected sorting to Bilibili and preserves that order in `searchRank`; it does not locally re-rank results. Date and duration are validated during discovery. When both filters are selected, the Actor keeps the date filter and sorting on Bilibili, then checks duration while paging because Bilibili can otherwise ignore the combined filter parameters.

#### Why does video search take longer than creator search?

Creator records come directly from search results. Every video result receives one additional detail lookup so the Dataset can include full engagement counts, tags, description, category, and author metadata.

#### How does the Actor limit request frequency?

Search pages and video-detail calls run sequentially with a small randomized interval. Temporary network and server errors receive at most one delayed retry. HTTP 429 respects `Retry-After` when available, while explicit risk-control responses stop immediately instead of creating a rapid retry loop. Repeated BV IDs found under different keywords reuse details already fetched during the same run.

The maximum 500-result capacity is intended for controlled batch work, not the fastest interactive response. For faster runs, start with 5–20 results per keyword.

#### Can one run return videos and creators together?

No. Select one type per run to keep the Dataset schema predictable. Run the Actor twice when you need both datasets.

#### How many results can one run return?

You can submit up to 10 unique keywords and request up to 50 results per keyword, for a maximum of 500 successful records in one run. The default is 5 results per keyword. Split larger collection jobs into multiple runs to keep runtime and cost predictable.

#### Does this Actor download video or audio files?

No. It extracts public metadata only.

#### What is danmaku?

`danmakuCount` is the public count of time-synchronized on-screen comments associated with a video. `commentCount` is the count for the conventional comment section.

### Support

Use the Actor's **Issues** tab and include the run ID, a public example keyword, the selected result type and filters, and the relevant status or log message. Never post an Apify token or account credentials.

### Legal notice

This Actor is an independent data extraction tool and is not affiliated with, endorsed by, or sponsored by Bilibili. Use it only for lawful purposes and in accordance with applicable terms, privacy rules, and regulations. You are responsible for how you use and store the collected data.

# Actor input Schema

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

Add up to 10 keyword phrases, one per line. The result limit applies independently to each keyword.

## `searchType` (type: `string`):

Return one consistent result type per run.

## `maxResultsPerQuery` (type: `integer`):

Maximum number of successful video or creator records returned for each keyword. A run can return up to 500 successful records across 10 keywords.

## `videoSortBy` (type: `string`):

Choose Bilibili's server-side ordering for video search results.

## `videoUploadDate` (type: `string`):

Limit videos by publication time. The Actor sends this filter to Bilibili and verifies each returned timestamp. Ignored for creator searches.

## `videoDuration` (type: `string`):

Limit videos by duration. The Actor sends this filter to Bilibili and verifies each returned duration. Ignored for creator searches.

## `userType` (type: `string`):

Filter Bilibili accounts by their public account classification.

## `userSortBy` (type: `string`):

Sort creators by relevance, follower count, or Bilibili user level.

## Actor input object example

```json
{
  "searchQueries": [
    "Python"
  ],
  "searchType": "videos",
  "maxResultsPerQuery": 5,
  "videoSortBy": "relevance",
  "videoUploadDate": "any",
  "videoDuration": "any",
  "userType": "all",
  "userSortBy": "relevance"
}
```

# Actor output Schema

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

Ranked video, creator, empty-result, and lookup-error records in the default Dataset.

## `summary` (type: `string`):

Run totals, per-keyword status, request counts, retries, blocks, network fallbacks, and detail-cache hits from the OUTPUT record.

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

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

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

```

## MCP server setup

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