# Bilibili Scraper — Videos, Search & Trending, Cheap (`fabrikit/bilibili-video-scraper`) Actor

Bilibili Scraper for public video metadata: search by keyword, scrape video links, uploader pages, popular and ranking lists. Views, likes, coins, favorites, shares, danmaku and comment counts, tags, uploader and dates. No login. Pay per result, no subscription.

- **URL**: https://apify.com/fabrikit/bilibili-video-scraper.md
- **Developed by:** [Fabrikit](https://apify.com/fabrikit) (community)
- **Categories:** Social media, AI, SEO tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 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.

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, Search & Trending, Cheap

Scrape public **Bilibili** video metadata without a login: keyword search, individual video links, uploader pages, the popular feed and category rankings. Every video comes back as clean JSON with view, like, coin, favorite, share, danmaku and comment counts, tags, uploader, category, duration and publish date. Chinese text is kept exactly as published (UTF-8).

Pay per video saved, nothing else. See *How much does it cost to scrape Bilibili?* below.

### What you get

- Keyword search with sort order (relevance, most played, newest, most danmaku, most favorited), duration filter, date range and optional category.
- Direct video links, BV ids or av ids.
- Uploader pages (space.bilibili.com/mid), best effort.
- Popular feed and top-100 rankings by category.
- Full engagement stats and tags, even for search results.

No comments, no danmaku text and no personal data are collected: only the public uploader name and id shown on each video.

### Who uses Bilibili data

- **Brands and agencies** entering China who need to see which creators and videos drive attention in their category (games, beauty, tech, food).
- **Influencer marketing teams** shortlisting uploaders by views, coins and favorites, which on Bilibili signal engagement better than raw views.
- **Game and anime publishers** tracking launches, trailers and fan content around a title (the default example searches 原神, Genshin Impact).
- **Analysts and researchers** building datasets of Chinese video trends, categories and publishing patterns.
- **AI and recommender projects** that need structured video metadata (titles, descriptions, tags, categories and engagement) in Chinese.

### Key features

- **Five sources in one actor**: keyword search, explicit video links or ids, uploader spaces, the popular feed and the ranking list. Combine them in one run; duplicates are removed by BV id, so a video found twice is saved (and charged) once.
- **Exact stats for search results**: Bilibili's search results only carry partial counts. With **Full stats** on (the default), each video is opened to get likes, coins, shares, favorites and exact view counts.
- **Tags included** by default (`includeTags`).
- **Search filters** that map to Bilibili's own: sort order, duration bucket, published-after / published-before dates, and a category id (`tid`).
- **Category rankings** with `rankingCategoryId` (0 = all, 4 = Games, 3 = Music, 36 = Knowledge, 188 = Tech, 160 = Life, 211 = Food, 217 = Animals).
- **Automatic proxy escalation**: the run starts on Apify datacenter proxy and switches to residential IPs for the rest of the run after repeated blocks.
- **Spending limit respected**: before saving, the actor trims each batch to what your run's maximum charge allows, and `maxItems` caps the total across all sources.
- **Run summary**: a `SUMMARY` record in the key-value store lists videos saved per source, skipped videos, errors and the proxy tier used.

### Input examples

Search:

```json
{ "searchKeywords": ["原神", "AI绘画"], "searchOrder": "click", "durationFilter": "10to30", "publishedAfter": "2026-09-01", "maxItems": 200 }
```

Specific videos and an uploader:

```json
{ "videoUrls": ["https://www.bilibili.com/video/BV1VVpo6gEYg"], "uploaderUrls": ["https://space.bilibili.com/546195"], "searchKeywords": [] }
```

Games ranking:

```json
{ "searchKeywords": [], "mode": "ranking", "rankingCategoryId": 4, "maxItems": 100 }
```

Popular feed right now (this is the "Bilibili popular videos" example task):

```json
{ "mode": "popular", "searchKeywords": [], "maxItems": 50 }
```

Note: `searchKeywords` defaults to `["原神"]`. If you only want videos, uploaders, the popular feed or a ranking, pass `"searchKeywords": []` as in the examples above.

#### Input fields

| Field | What it does |
|---|---|
| `searchKeywords` | Keywords to search. Chinese works best. Up to 1,000 results per keyword (Bilibili's limit). |
| `searchOrder` | `totalrank` (relevance), `click` (most played), `pubdate` (newest), `dm` (most danmaku), `stow` (most favorited). |
| `durationFilter` | `any`, `under10`, `10to30`, `30to60`, `over60` minutes. Keyword search only. |
| `publishedAfter` / `publishedBefore` | Dates (YYYY-MM-DD), inclusive. Keyword search only. |
| `searchCategoryId` | Optional Bilibili category id (`tid`) to restrict keyword search. |
| `videoUrls` | Video links, BV ids or av ids. |
| `uploaderUrls` | Uploader space links or numeric mids. Best effort. |
| `mode` | `none`, `popular` (popular feed) or `ranking` (top 100). |
| `rankingCategoryId` | Category for ranking mode; 0 = all. |
| `maxItems` | Total videos to save across all sources (default 50). |
| `includeTags` | Add the video's tags (default on). |
| `fetchFullStats` | Open each search/uploader result for exact stats (default on). Slower, same price. |
| `proxyConfiguration` | Apify Proxy by default; residential is used automatically when needed. |

### Output example

```json
{
  "bvid": "BV1VVpo6gEYg",
  "aid": 117427861985029,
  "url": "https://www.bilibili.com/video/BV1VVpo6gEYg",
  "title": "【A2O】A2O LITE 'NEON' Official Video",
  "description": "A2O LITE Debut Digital Single 'NEON' ...",
  "uploaderName": "A2O_WORLD",
  "uploaderMid": 670061998,
  "uploaderUrl": "https://space.bilibili.com/670061998",
  "publishedAt": "2026-10-10T09:30:00.000Z",
  "durationSeconds": 223,
  "category": "MV",
  "tags": ["A2O", "MV"],
  "viewCount": 973696,
  "likeCount": 56384,
  "coinCount": 29159,
  "favoriteCount": 18898,
  "shareCount": 15967,
  "danmakuCount": 7455,
  "commentCount": 8192,
  "thumbnail": "https://i0.hdslb.com/bfs/archive/....jpg",
  "searchKeyword": null,
  "source": "url"
}
```

#### Output fields

| Field | Type | Description |
|---|---|---|
| `bvid` | string | Bilibili video id (BV…). Used to de-duplicate. |
| `aid` | number | Legacy numeric av id. |
| `url` | string | Video page URL. |
| `title` | string | Video title, as published. |
| `description` | string | Video description. |
| `uploaderName` | string | Public name of the uploader. |
| `uploaderMid` | number | Uploader's numeric id (mid). |
| `uploaderUrl` | string | Uploader space URL. |
| `publishedAt` | string | Publish time, ISO 8601 (UTC). |
| `durationSeconds` | number | Video length in seconds. |
| `category` | string | Bilibili category name. |
| `tags` | array | Video tags (when `includeTags` is on). |
| `viewCount` | number | Views (plays). |
| `likeCount` | number | Likes. |
| `coinCount` | number | Coins given by viewers. |
| `favoriteCount` | number | Times added to favorites. |
| `shareCount` | number | Shares. |
| `danmakuCount` | number | Number of danmaku (bullet comments). |
| `commentCount` | number | Number of comments. |
| `thumbnail` | string | Cover image URL. |
| `searchKeyword` | string | The keyword that found the video, or `null`. |
| `source` | string | `search`, `url`, `uploader`, `popular` or `ranking`. |

Counts are `null` when Bilibili does not return them for that source (for example, coins and shares in search results when Full stats is off).

### How much does it cost to scrape Bilibili?

| Event | When it is charged |
|---|---|
| Actor start | Once per run (a fraction of a cent) |
| Video result | Per video saved to the dataset |

From 30 October 2026, 1,000 videos cost US$10 on the Apify Free plan; paid Apify plans pay less per video — see the **Pricing** tab for the rate on your plan. Full stats and tags do not cost extra.

You only pay for videos actually saved; `maxItems` and your spending limit are always respected.

### Proxy

The Actor starts on Apify datacenter proxy and switches automatically to residential IPs for the rest of the run if Bilibili blocks it. Keyword search returns at most 1,000 results per keyword (Bilibili limit); use several keywords, date ranges or categories to go deeper.

### FAQ

**Do I need a Bilibili account?** No.
**Can it scrape comments or danmaku?** No, by design.
**Why are some counts lower in search?** Turn on "Full stats" (default) and each video is opened for exact numbers.
**Uploader pages fail sometimes?** Bilibili risk-controls that endpoint; the run keeps the other sources and reports the error in the SUMMARY record.

**How do I get more than 1,000 videos for one keyword?** Bilibili stops at 1,000 results per keyword. Split the search: run the same keyword with different `publishedAfter` / `publishedBefore` windows, duration buckets or category ids, or add related keywords. Duplicates across those searches are removed automatically.

**Can I search in English?** Yes, but most Bilibili content is titled in Chinese, so Chinese keywords return far more relevant results.

**What happens if nothing is found?** If a run saves zero videos, it ends as failed with the reason (for example, no results or blocked requests), so you are not charged for result events and a scheduled run's failure is visible.

**How fast is it?** Ranking runs take seconds. Search with Full stats opens every video, so expect roughly a minute per few dozen videos when residential proxy is needed. Turn off `fetchFullStats` and `includeTags` for the fastest runs.

**Can I monitor a creator or a keyword over time?** Yes. Save the input as a task and schedule it daily or weekly; each run's dataset is a snapshot of views, likes and coins you can compare.

### Use cases

Trend and creator research, competitor and brand monitoring, anime/game/tech content analytics, influencer discovery, datasets for AI and recommender research.

### Is it legal to scrape Bilibili?

This actor only collects video metadata that Bilibili shows publicly to any visitor, without logging in, and it does not collect comments, danmaku text or private account data. Some fields, such as uploader names and ids, can still count as personal data, so laws like the EU GDPR, Chile's Ley 21.719, China's PIPL or the California CCPA may apply to how you store and use them; you are responsible for having a lawful purpose and keeping only what you need. You should also respect Bilibili's terms of service and avoid republishing content you do not have rights to. This is general information, not legal advice.

### Integrations

Run the Bilibili Scraper from the Apify API or the JavaScript and Python clients, trigger other systems with webhooks when a run finishes, or schedule it (hourly, daily, weekly) in Apify Console. It works with n8n, Make and Zapier, and with LangChain and LlamaIndex through their Apify integrations. AI agents in Claude, ChatGPT, Cursor and other MCP clients can find and run it through Apify's MCP server. Download results as JSON, CSV or Excel, or read them from the dataset API.

### Use with AI agents

Use this actor when you need public Bilibili video metadata (titles, uploaders, categories, tags and view/like/coin/favorite/share/danmaku/comment counts) for a keyword, a list of videos, an uploader, the popular feed or a category ranking.

```json
{ "searchKeywords": ["人工智能"], "searchOrder": "click", "maxItems": 20 }
```

Main output fields: `title`, `url`, `bvid`, `uploaderName`, `publishedAt`, `category`, `tags`, `viewCount`, `likeCount`, `coinCount`, `favoriteCount`, `commentCount`. It is pay-per-event: an agent pays a small start fee plus a fixed price per video saved, not for compute time.

### Related actors

- [YouTube Scraper](https://apify.com/fabrikit/youtube-videos-scraper) — the same kind of video metadata for YouTube search, channels and playlists.
- [Google Trends Scraper](https://apify.com/fabrikit/google-trends-scraper) — search interest over time and by region for the topics you find on Bilibili.
- [Google News Scraper](https://apify.com/fabrikit/google-news-scraper) — news coverage of a game, brand or creator.
- [Google Ads Transparency Scraper](https://apify.com/fabrikit/google-ads-transparency-scraper) — see which ads a competitor runs on Google.

#### Ready-made examples

- [Bilibili popular videos right now](https://apify.com/fabrikit/bilibili-video-scraper/examples/bilibili-popular-videos)
- [Most viewed AI videos on Bilibili](https://apify.com/fabrikit/bilibili-video-scraper/examples/bilibili-ai-videos-most-viewed)

### Changelog

- **2026-10-16** — README expanded: input field reference, output field table, more FAQ, legal notes, integrations and example tasks.
- **2026-10-15** — Build 0.1.6: README included in the build; published on the Apify Store. Tiered pricing announced, effective 2026-10-30 (lower per-video price on paid Apify plans).
- **2026-10-13** — Builds 0.1.1–0.1.5: initial release with keyword search, video links, uploader pages, popular feed and rankings; fallback to the legacy ranking list when the current one is blocked; automatic switch to residential proxy after repeated blocks.

### En español

Scraper de metadatos públicos de videos de Bilibili: búsqueda por palabra clave, enlaces de video, páginas de uploader, populares y rankings. Entrega vistas, likes, monedas, favoritos, compartidos, danmaku, comentarios (solo conteos), etiquetas, categoría, duración y fecha. Sin inicio de sesión. Se cobra por video guardado; el precio vigente para tu plan está en la pestaña Pricing.

# Actor input Schema

## `searchKeywords` (type: `array`):

Keywords to search on Bilibili (Chinese works best). Up to 1,000 results per keyword.

## `searchOrder` (type: `string`):

Result order for keyword search.

## `durationFilter` (type: `string`):

Only for keyword search.

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

Keyword search only. Date (YYYY-MM-DD), inclusive.

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

Keyword search only. Date (YYYY-MM-DD), inclusive.

## `searchCategoryId` (type: `integer`):

Optional Bilibili category id to restrict keyword search (e.g. 4 = Games, 36 = Knowledge, 188 = Tech).

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

Video links (bilibili.com/video/BV...), BV ids or av ids to scrape directly.

## `uploaderUrls` (type: `array`):

Uploader space links (space.bilibili.com/123) or numeric mids. Best effort: Bilibili risk-controls this endpoint.

## `mode` (type: `string`):

Add the popular feed or the ranking list.

## `rankingCategoryId` (type: `integer`):

For ranking mode. 0 = all categories, 4 = Games, 3 = Music, 36 = Knowledge, 188 = Tech, 160 = Life, 211 = Food, 217 = Animals.

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

Total number of videos to save across all sources.

## `includeTags` (type: `boolean`):

Add the uploader's video tags.

## `fetchFullStats` (type: `boolean`):

Open each video to get coins, shares, likes and exact counts (search results only carry partial stats). Slower, same price.

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

Starts with Apify datacenter proxy and automatically switches to residential if Bilibili blocks it.

## Actor input object example

```json
{
  "searchKeywords": [
    "原神"
  ],
  "searchOrder": "totalrank",
  "durationFilter": "any",
  "mode": "none",
  "rankingCategoryId": 0,
  "maxItems": 50,
  "includeTags": true,
  "fetchFullStats": true,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `videos` (type: `string`):

All videos collected during the run

# 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 = {
    "searchKeywords": [
        "原神"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("fabrikit/bilibili-video-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 = {
    "searchKeywords": ["原神"],
    "proxyConfiguration": { "useApifyProxy": True },
}

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

```

## MCP server setup

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