# Bilibili Scraper — Videos, Comments, Creators & Search | B站 (`innolabs/bilibili-scraper`) Actor

Bilibili scraper API: videos by keyword, video details and stats, comments, creator profiles and uploads, popular rankings. No login, JSON/CSV/Excel.

- **URL**: https://apify.com/innolabs/bilibili-scraper.md
- **Developed by:** [Tristan Leroux](https://apify.com/innolabs) (community)
- **Categories:** Social media, Videos
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 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.
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?

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, Comments & Creators

Scrape **Bilibili (哔哩哔哩, B站)** without logging in: search videos by keyword, get full
video statistics (views, likes, coins, favorites, shares, danmaku and comment counts),
tags and uploader, collect comment threads with replies, and pull creator (UP主) profiles
with their latest uploads or the site-wide Popular board. Field names are in English, the
original Chinese text is kept as-is. Export as JSON, CSV or Excel, or pull the data
through the API.

### What does Bilibili Scraper do?

Bilibili Scraper turns China's largest video community into clean, structured data:

- **Keyword search** — enter keywords such as `python tutorial`, `原神` or `iPhone 17 测评`
  and get up to 1,000 videos per keyword, sorted by relevance, views, upload date,
  danmaku, favorites or comments, optionally filtered by video length.
- **Video details** — paste video links (`BV…`, `av…`, mobile and `b23.tv` share links)
  and get title, description, cover, length, publish date, category, tags, parts,
  resolution, honors (e.g. 热门收录) and every engagement counter Bilibili shows:
  views, likes, coins (投币), favorites, shares, danmaku and comments.
- **Comments** — comment threads for every video in the run: text, likes, reply count,
  date, author name, level and VIP status, pinned and "liked by the uploader" flags,
  attached pictures, and (optionally) all replies under each comment. Sort by hot or
  newest.
- **Creators (UP主)** — paste a creator's space link (`space.bilibili.com/<id>`) to get
  their profile (followers, following, total likes, number of videos, level,
  verification, VIP) and their newest or most viewed uploads with full statistics.
- **Popular board** — the videos trending across Bilibili right now (综合热门).
- **Uploader profiles** — one switch adds the profile of every video's uploader to the
  results, which turns a keyword search into a creator (KOL) list.

Search, links and the Popular board can be combined in one run; a video that shows up in
several places is delivered and charged once.

### Use cases

- **Influencer (KOL) discovery** — search your niche, switch on uploader profiles and
  rank creators by followers, likes and the performance of their videos on that topic.
- **Brand and campaign monitoring** — track how videos about your brand or product perform
  (views, coins, favorites, shares) and read what viewers say in the comments.
- **Market research on China** — measure interest in a game, gadget, car or topic by the
  volume and engagement of Bilibili videos, newest first or most viewed first.
- **Competitor and creator analytics** — follow a list of creators, export their latest
  uploads every week and compare growth.
- **Content strategy** — find which titles, lengths, categories and tags get the most
  coins and favorites for a keyword.
- **AI and NLP datasets** — collect Chinese comment threads with likes and reply
  structure for sentiment analysis, topic modelling or LLM training and evaluation.

### How much does it cost?

You pay only for the results you get (pay-per-event). Duplicates and items over your
`maxItems` limit are never charged.

| Event | What you pay for | Free plan | Paid plans (from) |
| --- | --- | --- | --- |
| `video` | One video with its statistics | $2.00 per 1,000 | $1.50 per 1,000 |
| `comment` | One comment or reply | $0.50 per 1,000 | $0.30 per 1,000 |
| `creator` | One creator (UP主) profile | $2.00 per 1,000 | $1.50 per 1,000 |

"Paid plans (from)" is the Gold-and-above price; Bronze and Silver plans sit in between.
Apify also charges a tiny actor-start fee ($0.00005 per run).

Worked examples (Free plan prices):

1. **Keyword research** — 5 keywords × 200 videos with full statistics and tags =
   1,000 videos × $2.00 / 1,000 = **$2.00**.
2. **Comment analysis** — 10 videos with up to 300 comments each (replies included):
   10 × $0.002 + 3,000 × $0.50 / 1,000 = $0.02 + $1.50 = **$1.52**.

The Apify Free plan includes $5 monthly credit, enough for about 2,500 videos or 10,000
comments every month.

### How to use Bilibili Scraper

In Apify Console:

1. Open Bilibili Scraper and click **Try for free**.
2. Enter **Search keywords** (the form is prefilled with `python tutorial`), paste
   **Video and creator URLs**, or tick **Popular videos**.
3. Set **Max videos per source** and, if you like, the search sort order, video length,
   **Include comments** and **Uploader profiles**.
4. Click **Start**. Twenty videos with full details take a few seconds.
5. Open the **Output** tab and export the dataset as JSON, CSV, Excel or HTML.

Through the API:

1. Get your API token in Apify Console → Settings → Integrations.
2. Call the actor with your input JSON (see [Integrations and API](#integrations-and-api)).
3. Read the dataset items from the run.

### Input

Fill in at least one of `searchQueries`, `startUrls` or `popular`.

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `searchQueries` | array | – | Keywords to search, in any language. |
| `startUrls` | array | – | Video links (`bilibili.com/video/BV…`, `av…`, `m.bilibili.com`, `b23.tv`, bare `BV…` ids) and creator links (`space.bilibili.com/<id>`). |
| `popular` | boolean | `false` | Also scrape the Popular board (综合热门). |
| `maxVideosPerSource` | integer | `50` | Videos per keyword, per creator and from the Popular board (1–1,000). |
| `searchOrder` | string | `totalrank` | `totalrank` (relevance), `click` (most viewed), `pubdate` (newest), `dm` (most danmaku), `stow` (most favorited), `scores` (most commented). |
| `searchDuration` | string | `any` | `any`, `under10`, `10to30`, `30to60` or `over60` minutes. |
| `includeVideoDetails` | boolean | `true` | Full statistics (coins, shares…), tags, parts, resolution and honors for every video. Off = faster, lighter rows. |
| `creatorVideos` | boolean | `true` | For creator links, also scrape their uploads. Off = profile only. |
| `creatorVideosOrder` | string | `pubdate` | A creator's newest uploads (`pubdate`) or most viewed (`click`). |
| `includeOwnerProfiles` | boolean | `false` | Add the profile of every video's uploader (once per creator). |
| `includeComments` | boolean | `false` | Scrape the comments of every video in the run. |
| `maxCommentsPerVideo` | integer | `100` | Comments (and replies) per video. |
| `commentsSort` | string | `hot` | `hot` or `newest`. |
| `includeCommentReplies` | boolean | `false` | Also collect the replies under each comment. |
| `maxItems` | integer | `1000` | Hard cap on all output items (videos + comments + creators). |
| `proxyConfiguration` | object | Apify Proxy | Proxy settings. |
| `debug` | boolean | `false` | Log every page and retry. |

Example — the 100 most viewed short videos about a game, with their uploaders' profiles:

```json
{
    "searchQueries": ["原神"],
    "searchOrder": "click",
    "searchDuration": "under10",
    "maxVideosPerSource": 100,
    "includeOwnerProfiles": true
}
```

Example — one video's comment threads plus a creator's 30 latest uploads:

```json
{
    "startUrls": [
        "https://www.bilibili.com/video/BV16X4A6mEJr",
        "https://space.bilibili.com/546195"
    ],
    "maxVideosPerSource": 30,
    "includeComments": true,
    "includeCommentReplies": true,
    "maxCommentsPerVideo": 500,
    "maxItems": 5000
}
```

### Output

Every item has a `type`: `video`, `comment` or `creator`. Examples below come from real
runs on 2026-11-03.

#### Video

```json
{
    "type": "video",
    "bvid": "BV1HC4y1v7gW",
    "aid": 793434948,
    "url": "https://www.bilibili.com/video/BV1HC4y1v7gW",
    "title": "如何在手机上写Python--安卓篇",
    "description": "多角度对比安卓上可以写Python的3个App",
    "coverUrl": "https://i2.hdslb.com/bfs/archive/7a2342b5238249af214da460f1d92aa423ade617.jpg",
    "durationSec": 219,
    "publishedAt": "2024-01-07T15:44:12Z",
    "category": "计算机技术",
    "categoryId": 231,
    "tags": ["新年好物大赏", "计算机", "程序员", "安卓", "编程", "手机", "代码", "Python", "2023热门年度盘点"],
    "views": 146045,
    "likes": 2386,
    "coins": 281,
    "favorites": 2981,
    "shares": 343,
    "danmaku": 128,
    "comments": 134,
    "ownerMid": 17095888,
    "ownerName": "Crossin的编程教室",
    "ownerAvatar": "https://i1.hdslb.com/bfs/face/741adaeec4c5cd7e4fab303b4d667c364ac38c04.jpg",
    "parts": 1,
    "cid": 1398237398,
    "width": 1440,
    "height": 1080,
    "isOriginal": true,
    "honors": [],
    "source": "search",
    "searchQuery": "python tutorial",
    "rank": 1,
    "scrapedAt": "2026-11-03T17:09:52Z"
}
```

#### Comment

```json
{
    "type": "comment",
    "commentId": "319108804017",
    "videoBvid": "BV16X4A6mEJr",
    "videoAid": 117547382869481,
    "videoTitle": "只要那个目标还未达成，我就不会停下",
    "url": "https://www.bilibili.com/video/BV16X4A6mEJr/#reply319108804017",
    "text": "说实话，现在AI发展太快了，照这个形势下去，不过两个月就要到2027年了",
    "likes": 113,
    "replyCount": 12,
    "publishedAt": "2026-11-03T15:15:54Z",
    "isPinned": false,
    "isReply": false,
    "rootId": null,
    "parentId": null,
    "authorMid": 616355791,
    "authorName": "三月七_March7th",
    "authorAvatar": "https://i1.hdslb.com/bfs/face/1d7248e7a83a001e424b7bf8225dee0f88ac3e6b.jpg",
    "authorLevel": 6,
    "authorVip": true,
    "upLiked": true,
    "upReplied": false,
    "pictures": [],
    "scrapedAt": "2026-11-03T17:09:55Z"
}
```

#### Creator

```json
{
    "type": "creator",
    "mid": 546195,
    "name": "老番茄",
    "url": "https://space.bilibili.com/546195",
    "avatar": "https://i0.hdslb.com/bfs/face/bc5ca101313d4db223c395d64779e76eb3482d60.jpg",
    "sign": "新浪微博：_老番茄_",
    "sex": "男",
    "level": 6,
    "followers": 20867677,
    "following": 7,
    "videoCount": 683,
    "articleCount": 0,
    "likes": 196664620,
    "verified": true,
    "verificationTitle": "2025百大UP主、2025年度商业影响力奖UP主、2022年度联合创作奖UP主",
    "vipLabel": "年度大会员",
    "source": "url",
    "scrapedAt": "2026-11-03T17:09:55Z"
}
```

Field notes:

- Counters (`views`, `likes`, `coins`, `followers`…) are the values Bilibili shows at
  `scrapedAt`; schedule runs to build a time series.
- `durationSec` is in seconds; `publishedAt` and `scrapedAt` are UTC (ISO 8601).
- `source` tells where a video came from (`search`, `url`, `creator`, `popular`) and
  `rank` its position in that list; `searchQuery` is set for search results.
- `honors` lists badges such as 热门收录 (featured in Popular) or weekly must-watch
  entries.
- With **Full video details** off, search results have no `coins`, `shares`, `parts` or
  resolution, and creator uploads only `views`, `danmaku`, length and date (`null` for the
  rest).
- `category` (the category name) is filled for videos found by search, the Popular board
  or a creator's uploads; for video links Bilibili only provides `categoryId`.
- Comments: `isReply` marks replies; `rootId` is the thread's top comment and `parentId`
  the comment being answered. `upLiked` / `upReplied` mean the video's uploader liked or
  replied to the comment. `replyCount` is the number of replies under a top comment.
- Creators: `mid` is the user id, `sign` the bio, `likes` the total likes on all their
  content; `source` is `url` (from your link) or `videoOwner` (uploader profiles).

### Integrations and API

Run the actor and get the items back in one call:

```bash
curl -X POST "https://api.apify.com/v2/acts/innolabs~bilibili-scraper/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"searchQueries": ["python tutorial"], "maxVideosPerSource": 50}'
```

Python with [apify-client](https://docs.apify.com/api/client/python):

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")
run = client.actor("innolabs/bilibili-scraper").call(
    run_input={
        "startUrls": ["https://www.bilibili.com/video/BV16X4A6mEJr"],
        "includeComments": True,
        "maxCommentsPerVideo": 300,
    }
)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    if item["type"] == "comment":
        print(item["likes"], item["text"][:80])
```

- **Make, Zapier, n8n** — use the Apify app/node to start the actor and send new videos
  or comments to Google Sheets, Airtable, Notion, Slack or email.
- **Scheduling** — create a schedule in Apify Console (e.g. daily) with search sort
  "Newest" to collect fresh videos for your keywords.
- **Webhooks** — trigger your pipeline when a run finishes.
- **AI agents (MCP)** — connect Claude, Cursor or other MCP clients through the Apify MCP
  server at https://mcp.apify.com and let your agent search Bilibili on demand.

### FAQ

#### Do I need a Bilibili account, cookies or an API key?

No. The scraper only reads what Bilibili shows to visitors who are not logged in. You do
not have to provide any account, cookie or token.

#### Is it legal to scrape Bilibili?

The scraper collects publicly visible data: videos, their statistics, comments and public
profiles. It does not log in or access private data. Comments and profiles contain user
names, which may be personal data under laws such as GDPR or China's PIPL, so make sure
you have a legitimate reason to store them and that your use complies with Bilibili's
terms.

#### How many comments can I get per video?

As many as Bilibili lists for the video, page by page, sorted by hot or newest, up to
**Max comments per video**. The comment counter on a video includes replies and comments
Bilibili has folded or removed, so turn on **Include replies** to get close to it; the
number delivered can still be somewhat lower than the counter.

#### Do I need proxies?

No setup is needed. The default Apify Proxy setting works with Bilibili. When Bilibili
throttles a request the scraper waits and retries automatically.

#### How do I find creators (KOLs) for a topic?

Search your keywords, sort by most viewed if you like, and switch on **Uploader
profiles**. Each uploader is added once with followers, total likes, number of videos and
verification, next to the videos that matched your keywords.

#### What happens if a link fails or a video was deleted?

Each input is processed on its own. A wrong link, a deleted or private video, or a
creator id that does not exist is reported in the run log and in the run's `SUMMARY`
record, and the run continues with the rest; you are not charged for failed items. If
every input fails, the run is marked as failed with the reason.

### Limits

- Keyword search returns at most 1,000 videos per keyword (Bilibili's own limit). Paid
  course cards in search results are skipped.
- Danmaku (bullet comments), subtitles, video or audio downloads, live streams, anime and
  film episodes (番剧/影视) and articles (专栏) are not scraped.
- Some comments are folded or hidden by Bilibili for visitors who are not logged in, so
  the number of comments delivered can be lower than the video's comment counter.
- For video links the category name is not available, only `categoryId`.
- A creator's uploads are read 20 at a time; very large channels take longer, and
  **Max videos per source** caps them at 1,000.
- Statistics are a snapshot at scrape time; the Popular board changes several times a day.

# Changelog

This Actor's version history is a separate document: https://apify.com/innolabs/bilibili-scraper/changelog.md

# Actor input Schema

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

Keywords searched on Bilibili, in any language (e.g. 'python tutorial', '原神', 'iPhone 17 测评'). Each keyword returns up to 'Max videos per source' videos.

## `startUrls` (type: `array`):

Video pages (https://www.bilibili.com/video/BV1884g6mE8K, av123456 links, m.bilibili.com and b23.tv share links, or a bare BV id) and creator pages (https://space.bilibili.com/546195). A creator URL returns the creator's profile and their latest uploads.

## `popular` (type: `boolean`):

Also scrape Bilibili's Popular board (综合热门), the videos trending across the site right now.

## `maxVideosPerSource` (type: `integer`):

How many videos to take from each search keyword, each creator's uploads and the Popular board. Search returns at most 1,000 videos per keyword.

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

Relevance (default), most viewed, newest, most danmaku (bullet comments), most favorited or most commented.

## `searchDuration` (type: `string`):

Keep only search results of this length.

## `includeVideoDetails` (type: `boolean`):

Fetch every video's full statistics (coins, shares, likes, favorites), tags, parts, resolution and honors. Turn off for faster, lighter runs: search results then have no coins or shares, creator uploads only views, danmaku, length and date.

## `creatorVideos` (type: `boolean`):

For creator URLs, also scrape their uploaded videos (up to 'Max videos per source'). Off = profile only.

## `creatorVideosOrder` (type: `string`):

Take a creator's newest uploads or their most viewed ones.

## `includeOwnerProfiles` (type: `boolean`):

Also output the profile (followers, likes, video count, verification) of every video's uploader, once per creator. Useful to find creators (KOLs) by keyword.

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

Scrape the comments of every video: text, likes, reply count, date, author (name, level, VIP), pinned and uploader-liked flags, attached pictures.

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

How many comments (and replies, if enabled) to collect per video.

## `commentsSort` (type: `string`):

Hot (most liked first, Bilibili's default) or newest first.

## `includeCommentReplies` (type: `boolean`):

Also collect the replies under each comment (threads). Replies count towards 'Max comments per video'.

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

Hard cap on dataset items (videos, comments and creators together). The run stops cleanly when reached.

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

Apify Proxy settings. The default datacenter proxy works for Bilibili.

## `debug` (type: `boolean`):

Log every page and request retry.

## Actor input object example

```json
{
  "searchQueries": [
    "python tutorial"
  ],
  "popular": false,
  "maxVideosPerSource": 20,
  "searchOrder": "totalrank",
  "searchDuration": "any",
  "includeVideoDetails": true,
  "creatorVideos": true,
  "creatorVideosOrder": "pubdate",
  "includeOwnerProfiles": false,
  "includeComments": false,
  "maxCommentsPerVideo": 100,
  "commentsSort": "hot",
  "includeCommentReplies": false,
  "maxItems": 1000,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "debug": false
}
```

# Actor output Schema

## `dataset` (type: `string`):

All items produced by the run, one JSON object per 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 tutorial"
    ],
    "maxVideosPerSource": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("innolabs/bilibili-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 tutorial"],
    "maxVideosPerSource": 20,
}

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

```

## MCP server setup

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