# Bilibili Pro Scraper (`habit.zhou/bilibili-pro-scraper`) Actor

Four-mode Bilibili scraper: keyword search, video detail by BV/AID, user profile + uploads, popular feed. Returns title, description, author, plays, danmaku, likes, favorites, duration, publish time, cover. No login. For China video trends, KOL research, AI training data.

- **URL**: https://apify.com/habit.zhou/bilibili-pro-scraper.md
- **Developed by:** [Seller Aim](https://apify.com/habit.zhou) (community)
- **Categories:** Social media, Videos, AI
- **Stats:** 4 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 search / list 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/platform/actors/running/actors-in-store#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 Pro Scraper

Full-featured **Bilibili / 哔哩哔哩** scraper. Four modes, one Actor, clean structured JSON. No login, no cookies, no broken-token surprises.

Built for serious workloads — China-video research, UP creator discovery, AI training pipelines harvesting Chinese UGC, brand-watch dashboards, ML datasets of long-form Chinese video metadata.

### What does this Actor do?

Pick a mode, give it inputs, get a dataset:

- **Keyword search** — search Bilibili by keyword. Six sort options (comprehensive ranking, most played, newest, most danmaku, most favorited, most commented).
- **Video detail by BV / AID** — paste a `BV1xxxxxxxxx` code, an `av…` numeric ID, or a full `bilibili.com/video/...` URL; get title, description, UP info, plays, danmaku, likes, favorites, replies, cover, publish time, and (optional) top comments.
- **User profile + uploads** — fetch a UP's profile (avatar, bio, level, top banner) and their recent uploaded videos with pagination.
- **Popular / trending feed** — the public "Popular" feed (com\_popular). Surfaces what's blowing up across the entire platform right now.

Each video returns a flat, schema-validated JSON row that's downloadable as JSON, CSV, Excel, HTML, or XML — and queryable via the Apify REST API for pipeline integration.

### Why use Bilibili Pro Scraper?

- **No cookies, no breakage.** Other Bilibili actors in the store ask the user for a logged-in `SESSDATA` cookie that expires within days. Customers end up with a stream of 412/-352 errors and 1.5★ reviews. We use a maintained backend surface that stays stable.
- **Four modes in one Actor.** Search, detail, user, popular — pick a mode per run; no juggling separate Actors.
- **Full-field output.** Title, description, UP name + uid, plays, danmaku, likes, favorites, replies, duration, publish time, cover URL, tags — all in one row.
- **AI training-ready.** Chinese-language UGC video metadata, clean JSON, deduplicable by `bvid`. Drop straight into a vector DB, an LLM fine-tune set, or a trend classifier.
- **Marketing dashboards.** Schedule keyword runs hourly and build a real-time pulse of any brand, product, or category on China's largest Gen-Z video platform.

### How to use

1. Open the Actor and click **Try for free**.
2. In the Input tab, pick a **Scrape mode** (search is the default).
3. Fill the inputs for your mode:
   - **search**: keywords, optional sort (`searchOrder`)
   - **videos**: BV codes / AV IDs / Bilibili URLs in `videoIds`
   - **user**: numeric UIDs in `userIds` (find in `space.bilibili.com/<uid>`)
   - **popular**: nothing required
4. Set **Max items per input** (default 50).
5. Click **Save & Start**. Results stream into the dataset live.
6. Download or stream the dataset; schedule the run under the **Schedules** tab.

### Input

| Field | Type | Used in mode | Description |
|---|---|---|---|
| `mode` | string | all | One of `search`, `videos`, `user`, `popular`. |
| `keywords` | array<string> | search | Search queries; Chinese or English. |
| `searchOrder` | enum | search | `totalrank` / `click` / `pubdate` / `dm` / `stow` / `scores`. |
| `videoIds` | array<string> | videos | BV codes, AV IDs, or full bilibili.com URLs. |
| `userIds` | array<string> | user | Numeric Bilibili UIDs. |
| `maxItemsPerInput` | integer (1–1000) | all | Cap per input. Default 50. |
| `fetchComments` | boolean | videos | Fetch up to 20 top comments per video. Extra cost. |

JSON example — keyword search:

```json
{
    "mode": "search",
    "keywords": ["AI编程", "Claude"],
    "searchOrder": "click",
    "maxItemsPerInput": 100
}
```

### Output

```json
{
    "bvid": "BV1xx411c7mD",
    "aid": "170001",
    "title": "Claude Code 完全入门指南",
    "description": "从安装到 Hooks 全流程演示。",
    "author": "AI研究室",
    "authorUid": "12345678",
    "authorPic": "https://i0.hdslb.com/bfs/face/abc.jpg",
    "cover": "https://i0.hdslb.com/bfs/archive/cover.jpg",
    "videoUrl": "https://www.bilibili.com/video/BV1xx411c7mD",
    "duration": "12:34",
    "plays": 482915,
    "danmaku": 2841,
    "likes": 39201,
    "favorites": 12480,
    "comments": 1832,
    "publishedAt": "2026-04-10T08:15:00.000Z",
    "typeName": "科技",
    "tags": ["AI", "编程", "Claude"],
    "keyword": "AI编程",
    "searchOrder": "click",
    "scrapedAt": "2026-05-22T13:45:00.000Z"
}
```

#### Output fields

| Field | Description |
|---|---|
| `bvid` | Bilibili BV code (use as canonical ID). |
| `aid` | Numeric AV ID (legacy). |
| `title` | Video title. |
| `description` | Video description / synopsis. |
| `author` | UP display name. |
| `authorUid` | Numeric UID — pair with `mode: "user"` to drill in. |
| `authorPic` | UP avatar URL. |
| `cover` | Cover image URL. |
| `videoUrl` | Public deep link. |
| `duration` | Video length. |
| `plays` | Total view count. |
| `danmaku` | Danmaku (bullet comment) count. |
| `likes` | Like count. |
| `favorites` | Favorite count. |
| `comments` | Reply / comment count. |
| `publishedAt` | ISO 8601 publish time. |
| `typeName` | Bilibili category name. |
| `tags` | Tags inferred from search metadata. |
| `userProfile` | UP profile object (user mode only). |
| `topComments` | Top 20 comments (videos mode with `fetchComments` only). |
| `scrapedAt` | ISO 8601 timestamp of scrape. |

### Pricing

**$4.99 per 1,000 results.** Each video returned counts as one result. `videos` mode with `fetchComments=true` returns richer rows but is billed at the same rate.

#### Free vs. paid Apify plans

Apify free-plan users get **2 sample runs capped at 10 results each** so you can verify the data shape and quality before committing. Further runs from free accounts are blocked with an upgrade prompt — this Actor relies on a paid backend, so we can't subsidise unlimited free use. Any Apify paid plan ($49/month and up — see [Apify pricing](https://apify.com/pricing)) unlocks unlimited runs at the rate above.

#### Cost estimates

| Goal | Items / run | Mode | Est. cost / run |
|---|---|---|---|
| Quick scan of one keyword | 50 | search | ~$0.20 |
| Category round-up | 500 | search | ~$2.00 |
| UP deep dive | 200 uploads | user | ~$0.80 |
| Daily brand monitoring | 1,000 | search | ~$4.00 / day |

Apify also charges a small compute fee (typically $0.01-0.05 per minute of run time).

### Tips

- **Schedule, don't poll.** Bilibili rotates the popular feed every few hours; scheduling daily / 6-hourly delivers the right cadence vs cost.
- **Deduplicate by `bvid`.** Sequential runs overlap; merge and dedupe on `bvid`.
- **Pair user + videos modes.** Use `mode: "user"` to find prolific UPs, then drill into each top video with `mode: "videos"` + `fetchComments`.
- **Pair `searchOrder: "pubdate"`** with hourly scheduling for real-time keyword monitoring.
- **Don't enable `fetchComments` unless you need them.** Each comment-bearing video takes an extra request.

### FAQ

**Q: Why is this Actor different from the other Bilibili scrapers on the Store?**
A: Most existing actors depend on a customer-provided `SESSDATA` cookie that expires in days. We don't ask for one. We've engineered around stable backend surfaces so the Actor stays usable across cookie expiries.

**Q: Will this break when Bilibili changes their API?**
A: Possibly. Our team maintains the backend; we patch usually within 24-72 hours of a backend change. Bug reports via the Issues tab.

**Q: Is scraping Bilibili legal?**
A: We pull only publicly-accessible content — what any visitor can see without an account. Your usage is your responsibility; comply with your jurisdiction's law and Bilibili's Terms of Service.

**Q: Can I get my data via API?**
A: Yes. Every Apify run exposes a stable [REST API](https://docs.apify.com/api/v2) for inputs, datasets, and run status. Plug into n8n, Make, Zapier, or your own pipeline.

**Q: How do I find a user's UID?**
A: Open the UP's profile on `space.bilibili.com`; the URL ends with `/<uid>` — that number is the UID.

**Q: How fast are runs?**
A: Search: ~3 seconds per page (~42 videos). User: ~2 seconds per page. Video detail: ~1 second per video. Popular: ~2 seconds per page.

**Q: I need a richer integration or higher-volume contract.**
A: Reach out via Apify chat. Custom endpoints and SLAs available on request.

# Actor input Schema

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

What to pull from Bilibili.

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

Search queries. Chinese or English both work.

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

Sort criterion for search results.

## `videoIds` (type: `array`):

BV1xxxxxxxxx codes or numeric AIDs. Full https://www.bilibili.com/video/BV... URLs also accepted.

## `userIds` (type: `array`):

Numeric Bilibili user IDs (uid). Find them in the profile URL: space.bilibili.com/<uid>.

## `maxItemsPerInput` (type: `integer`):

Cap per keyword / user. Each item returned is one billed result.

## `fetchComments` (type: `boolean`):

When on, fetches up to 20 top comments per video (videos mode only). Extra cost per video.

## Actor input object example

```json
{
  "mode": "search",
  "keywords": [
    "AI"
  ],
  "searchOrder": "totalrank",
  "videoIds": [],
  "userIds": [],
  "maxItemsPerInput": 50,
  "fetchComments": false
}
```

# Actor output Schema

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

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

# Run the Actor and wait for it to finish
run = client.actor("habit.zhou/bilibili-pro-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": [
    "AI"
  ]
}' |
apify call habit.zhou/bilibili-pro-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=habit.zhou/bilibili-pro-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/wHaKUYWw0wucJgOBy/builds/Wtu9UYB3jW79CxYo2/openapi.json
