# Bilibili Scraper 哔哩哔哩 — Videos, Search, All Comments, No Login (`zinin/bilibili-scraper`) Actor

Scrape Bilibili (哔哩哔哩, B站) without login: keyword search, video stats (views, likes, coins, favorites, shares, danmaku, tags), the popular list and full comment threads — hundreds of comments per video, hot or newest first, with replies. $0.49 per 1,000 rows, no start fee.

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

## Pricing

from $0.34 / 1,000 result delivereds

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, search and full comment threads, no login

Collect public data from [Bilibili](https://www.bilibili.com) (哔哩哔哩, B站), China's largest video community: **keyword search**, **video statistics**, the **Popular list** and **comment threads paged in full**. Paste keywords or video links and run. No login, no cookies, no QR code. Apify proxy is built in and included in the price.

- **$0.49 per 1,000 rows. No start fee.** A row is a video, a comment or a reply. Wrong links, deleted videos and empty searches are free status rows.
- **Comment threads in full, not a 3-comment preview.** Bilibili shows a logged-out visitor only a few comments in the page; this Actor reads the open comment feed and pages through it — 1,199 comments of one video came back in 60 pages in our test on 21 November 2026, with more pages still available. Hot first or newest first, with optional replies (楼中楼).
- **Everything in one run.** Keywords, video links and the Popular list can be mixed in one input, with comments for every video found. No "pick one mode per run".
- **Full statistics.** Views, likes, coins (投币), favorites (收藏), shares, danmaku (弹幕) count, comment count, tags, category, duration, publish time, uploader (UP主).
- **Pay once.** A video found by two keywords is delivered and charged once. An interrupted or resurrected run continues from the dataset and never charges a row twice.
- **Safe on time and budget.** The run stops reading one minute before its time limit and never delivers more rows than your maximum cost per run allows.

Typical uses: Chinese Gen-Z consumer research and brand monitoring, comment and sentiment mining for games, anime, consumer electronics and EV launches, KOL (UP主) shortlists, trend tracking on the Popular list, Chinese-language corpora for AI and NLP.

### Input

| Field | What to put |
|---|---|
| `searchQueries` | Keywords, Chinese or English, one per line. Up to 1,000 videos per keyword (Bilibili's own ceiling). |
| `videoUrls` | Video links, bare BV ids, av numbers or `b23.tv` share links (the whole share text can be pasted). |
| `includePopular` | Add the videos of the Popular page (综合热门). |
| `maxVideosPerQuery` | Videos per keyword and for the Popular list. Default 20. |
| `searchSort` | `relevance`, `views`, `newest`, `danmaku`, `favorites`, `comments` — Bilibili's own orders. |
| `publishedAfter`, `publishedBefore` | Search only, `YYYY-MM-DD`. |
| `videoDetails` | Open every found video to add coins, shares, tags, parts and resolution. Same price per row. Videos given by link are always full. |
| `maxCommentsPerVideo` | `0` = no comments. Otherwise that many top-level comments for **every** video of the run. |
| `commentsSort` | `hot` or `newest`. |
| `includeReplies`, `maxRepliesPerComment` | Replies under each delivered comment as their own rows. |
| `maxItems` | Hard ceiling on charged rows of the whole run. `0` = none. |

Example — 20 videos for a keyword with the 100 hottest comments of each:

```json
{
  "searchQueries": ["原神"],
  "maxVideosPerQuery": 20,
  "maxCommentsPerVideo": 100,
  "commentsSort": "hot"
}
```

Example — every detail and 500 newest comments with replies for two videos:

```json
{
  "videoUrls": ["https://www.bilibili.com/video/BV1rpWjevEip", "BV1xx411c7mD"],
  "maxCommentsPerVideo": 500,
  "commentsSort": "newest",
  "includeReplies": true,
  "maxRepliesPerComment": 10
}
```

A wrong option value is replaced by its default and reported in a free `status` row; the run goes on.

### What you get

#### Video rows (`type: "video"`)

| Field | Meaning |
|---|---|
| `bvid`, `aid`, `url` | The BV id, the numeric av id and the link |
| `title`, `description`, `cover` | As published |
| `durationSeconds`, `publishedAt` | Length and publish time (ISO 8601, UTC) |
| `category` | Bilibili zone name (分区) — on rows found by search |
| `views`, `likes`, `favorites`, `danmaku`, `commentCount` | Counters, as numbers |
| `coins`, `shares` | Coins (投币) and shares — on full rows (`detailed: true`) |
| `tags` | Tag list |
| `authorId`, `authorName`, `authorUrl`, `authorAvatar` | The uploader (UP主) and the link to the space |
| `parts`, `cid`, `width`, `height`, `isOriginal`, `isPaid`, `publishLocation` | On full rows |
| `source`, `searchQuery`, `position` | `search`, `popular` or `url`; the keyword; the place in Bilibili's order |
| `detailed`, `scrapedAt` | Whether the row is a full row; when it was read |

#### Comment and reply rows (`type: "comment"` / `"reply"`)

| Field | Meaning |
|---|---|
| `commentId`, `parentCommentId`, `replyToCommentId` | Thread links: a reply points to its top-level comment and to the comment it answers |
| `videoBvid`, `videoAid`, `videoUrl` | The video the comment belongs to |
| `text`, `likes`, `replyCount` | Text as written, likes, true number of replies under a top-level comment |
| `createdAt`, `timestamp` | Posting time, ISO 8601 (UTC) and epoch milliseconds |
| `ipLocation` | IP region (IP属地) when Bilibili shows it; it is usually hidden from visitors who are not logged in, then `null` |
| `authorId`, `authorName`, `authorUrl`, `authorAvatar`, `authorLevel`, `authorSex` | The commenter |
| `pictures`, `mentions` | Attached pictures and @-mentioned users |
| `isPinned`, `likedByUploader`, `repliedByUploader` | Pinned by the uploader; liked or answered by the uploader |
| `position`, `sort`, `scrapedAt` | Place in the chosen order, the order, when it was read |

#### Status rows (`type: "status"`, free)

One row for every input line that gave nothing, with a plain `message`: `invalid` (not a video link), `dead-link`, `not-found` (deleted or private video), `no-results`, `no-comments`, `comments-closed`, `refused` (Bilibili did not answer after several attempts — run it again later), `option-ignored`.

### Pricing

**$0.49 per 1,000 delivered rows** on the free plan (less on paid Apify plans), one `result-found` event per video, comment or reply row. No start fee, no charge for status rows, compute and proxy included. Use `maxItems` or the maximum cost per run to cap the spend.

| Job | Rows | Cost |
|---|---|---|
| 100 videos for a keyword | 100 | $0.05 |
| 20 videos with 100 comments each | 2,020 | $0.99 |
| 10,000 comments of one viral video | 10,001 | $4.90 |

### Limits, said plainly

- **No uploader (UP主) video lists and no profile rows yet.** Bilibili answers that list to a logged-out visitor only after a browser check; this Actor does not solve checks. Search by the uploader's name instead.
- **No danmaku text, subtitles or video files.** Counters only.
- **Search depth** is 1,000 videos per keyword — Bilibili's own ceiling for everyone.
- **Search rows** have no coins and shares until `videoDetails` is on.
- **Comment order** is Bilibili's: `hot` and `newest`. Replies under a comment are read in full.
- A deleted, private or region-locked video is a free `not-found` row.

### FAQ

**Do I need a Bilibili account or cookies?** No. The Actor reads only what Bilibili shows to a visitor who is not logged in.

**Can I run it on a schedule?** Yes — use an Apify Schedule with `searchSort: "newest"` to follow a keyword, or `includePopular` to snapshot the Popular list daily.

**How do I link comments to videos?** Every comment row carries `videoBvid`; every reply carries `parentCommentId`.

**Is it legal?** The Actor collects publicly available data only. Comments contain personal data (nicknames, IP regions); you are responsible for using them in line with the laws that apply to you, including GDPR and PIPL.

**Something is wrong or a field is missing?** Open an issue on the Issues tab — it is answered within a day.

Looking for RedNote (小红书) comments? See [RedNote Comments Scraper](https://apify.com/zinin/rednote-comments-scraper).

# Changelog

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

# Actor input Schema

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

One keyword per line, Chinese or English: <code>原神</code>, <code>人工智能</code>, <code>iphone 17</code>. Each keyword is its own Bilibili search, up to 1,000 videos per keyword (Bilibili's own ceiling). A video found by two keywords is delivered and charged once.

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

One video per line: a link (<code>https://www.bilibili.com/video/BV1rpWjevEip</code>), a bare BV id, an av number (<code>av2</code>) or a <code>b23.tv</code> share link — the whole share text can be pasted. Each video comes back as a full row with likes, coins, favorites, shares and tags. A line that is not a video becomes a free status row and the rest of the run goes on.

## `includePopular` (type: `boolean`):

Add the videos of Bilibili's Popular page, in its order, up to the limit below.

## `maxVideosPerQuery` (type: `integer`):

Stop each keyword (and the popular list) after this many videos. Only delivered rows are charged.

## `searchSort` (type: `string`):

Bilibili's own search orders.

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

Search only: videos published on or after this date (YYYY-MM-DD, China time).

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

Search only: videos published on or before this date (YYYY-MM-DD, China time).

## `videoDetails` (type: `boolean`):

Search rows already carry views, likes, favorites, danmaku and comment counts. Turn this on to open every found video and add coins, shares, the tag list, parts and resolution. Same price per row; the run is slower (one or two more requests per video). Videos given by link are always full.

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

0 = no comments. Any other number reads that many top-level comments of <b>every</b> video of the run (by link, found by search, from the popular list) — each comment is its own charged row, so this is the main cost lever: 20 videos × 100 comments = 2,020 rows. The feed is paged in full, not cut at a short preview.

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

Bilibili's own comment orders. The comment pinned by the uploader comes first in the hot order.

## `includeReplies` (type: `boolean`):

Add the replies under each delivered comment as their own rows linked by <code>parentCommentId</code>, up to the limit below. A reply is charged like a comment.

## `maxRepliesPerComment` (type: `integer`):

Used when replies are on. Every comment row carries the true <code>replyCount</code> either way.

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

A hard ceiling on charged rows of the run. 0 = no ceiling (the limits above and your maximum cost per run still apply).

## Actor input object example

```json
{
  "searchQueries": [
    "原神"
  ],
  "includePopular": false,
  "maxVideosPerQuery": 20,
  "searchSort": "relevance",
  "videoDetails": false,
  "maxCommentsPerVideo": 0,
  "commentsSort": "hot",
  "includeReplies": false,
  "maxRepliesPerComment": 10,
  "maxItems": 0
}
```

# Actor output Schema

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

API URL of the run's default dataset items.

# 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": [
        "原神"
    ],
    "maxVideosPerQuery": 20,
    "maxCommentsPerVideo": 0,
    "maxRepliesPerComment": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("zinin/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": ["原神"],
    "maxVideosPerQuery": 20,
    "maxCommentsPerVideo": 0,
    "maxRepliesPerComment": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("zinin/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": [
    "原神"
  ],
  "maxVideosPerQuery": 20,
  "maxCommentsPerVideo": 0,
  "maxRepliesPerComment": 10
}' |
apify call zinin/bilibili-scraper --silent --output-dataset

```

## MCP server setup

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