# Bilibili Scraper & API: Search, Videos, Comments, Danmaku (`quarra/bilibili-scraper`) Actor

Bilibili scraper for videos with full stats, comments and replies, danmaku (弹幕), creators and their articles. Search with sort, dates, length and category, paste video or creator links, or read the trending lists. Optional full English translation. No login needed.

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

## Pricing

from $10.00 / 1,000 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?

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, Danmaku, Creators

Collect Bilibili (哔哩哔哩, B站) data in bulk, without an account, cookies or API key: search results, full video
details, every comment with its replies, danmaku (弹幕), creators with their videos and articles, trending lists and
hot searches. Tick **Translate to English** to get an English version next to every Chinese text. Export as JSON, CSV
or Excel, or read it through the Apify API.

**$10 per 1,000 results** (videos, comments, creators, articles, hot searches), **$1 per
1,000 danmaku**, plus a small start fee per run. Inputs not found and inputs that fail are not charged.

### What you can get

| Source | What comes back |
|---|---|
| Search terms | Videos (or creators, or articles) matching each term, with Bilibili's filters: sort, publication dates, video length, category. **Past Bilibili's 1,000-result cap** for videos: the run reads on, newest first. |
| Video links | One full record per video: views, likes, coins, favorites, shares, danmaku and comment counts, tags, category, parts, upload region, original or repost. |
| Creators | The profile (followers, level, verification, video and article counts), then the creator's videos and/or articles, newest first. |
| Trending | Popular now (综合热门), the ranking top 100 (排行榜) in 32 categories, for all videos, original works or newcomers, Must-watch (入站必刷) and hot searches (热搜). |
| Comments (option) | Every comment of each video, pinned first, each followed by its replies if you ask: text, likes, date, author with level and VIP status, pictures, liked or answered by the creator. |
| Danmaku (option) | The comments that fly over the video, with the second of the video where they show, the date, mode, color and part. |
| Related videos (option) | The videos Bilibili shows next to each video you give. |

### How deep it goes

Measured on 15 October 2026:

| Run | Delivered | Time |
|---|---|---|
| One video, BV1SMJC6sE6R (2,647 comments announced), all comments with replies and all danmaku | 1 video, 1,777 comments and replies, 601 danmaku, no duplicate | 1 min 53 s |
| Search « iPhone 17 », 1,150 videos asked (past Bilibili's 1,000 cap), Full video details off | 1,150 videos, no duplicate | 49 s |
| Search « 原神 », 5 videos with comments, replies and danmaku | 5 videos, 150 comments (97 replies, 3 pinned), 236 danmaku | 52 s |

Comments come page after page; the replies under a comment are read with it, so a thread stays together. The
counter Bilibili shows under a video also counts comments it folds away or hides from visitors, so a video announcing
2,647 comments has fewer to deliver.

### Quick start

1. Type a few **Search terms** (原神, iPhone 17…), or paste **Videos** or **Creators**, or pick a **Trending list**.
2. Tick **Comments** and/or **Danmaku** if you want them, and set the limits.
3. Click **Start** and read the results in the run's **Output** tab: one table for videos, one for comments, one for
   danmaku, and one each for creators, articles and trending searches.

Like any Apify Actor, it can also be run and read through the Apify API, scheduled, and connected to webhooks, Make,
Zapier, n8n or Apify's MCP server for AI agents.

### Inputs

- **Search terms**, one per line, and **Search for**: videos, creators or articles.
- **Videos**: any of
  - a video link: `https://www.bilibili.com/video/BV1SMJC6sE6R` (with `?p=2` or other parameters, it works too)
  - a share link from the app: `https://b23.tv/…`, or the whole share text
  - a BV ID (`BV1SMJC6sE6R`) or an av number (`av2`)
- **Creators**: a channel link (`https://space.bilibili.com/946974`), a b23.tv share link, or the numeric user ID.
  **From each creator, get**: videos, articles, or both.
- **Trending lists**: popular, ranking, must-watch, hot searches. The ranking follows the category and its type: all
  videos, original works only (原创), or newcomers (新人).
- **Search filters**: sort (relevance, most viewed, newest, most danmaku, most favorited, most commented, most
  followers for creators), published after / before (a date, or a duration like `7 days`), video length, category.
  Dates also apply to creators' lists.
- **Max results per search, creator or list** (20 by default).
- **Full video details** (on by default): opens each video's page for coins, shares, favorites, tags, category and
  parts. Off: the fields of the search or list only, faster and with the same price per record.
- **Comments**, **Max comments per video**, **Comments order** (top or newest), **Replies**, **Max replies per
  comment**.
- **Danmaku**, **Max danmaku per video**. **Related videos**.
- **Translate to English** (paid option): see below.
- **Max results**: total records the run delivers, all types together, counted exactly.

A line that is not a Bilibili link or ID gets an error record that says why, free; a creator link in **Videos** is
pointed to **Creators**. The same video given several times, in several forms, is read and charged once.

Example, through the API:

```json
{
  "searchQueries": ["原神"],
  "sortBy": "newest",
  "publishedAfter": "7 days",
  "maxResultsPerSource": 200,
  "includeComments": true,
  "maxCommentsPerVideo": 100,
  "maxItems": 10000
}
```

### Output

Every record has a `type`: `video`, `comment`, `danmaku`, `creator`, `article`, `hotSearch`, or `error` (free). Real
records from 15 October 2026:

A video:

```json
{
  "type": "video",
  "videoId": "BV1SMJC6sE6R",
  "aid": "117442944697936",
  "url": "https://www.bilibili.com/video/BV1SMJC6sE6R",
  "title": "《最有耐心の杀手》",
  "description": null,
  "coverUrl": "https://i0.hdslb.com/bfs/archive/75069b48e67ab49d01a0bd665fbcdb79ac48949b.jpg",
  "durationSeconds": 111,
  "publishedAt": "2026-10-15T04:07:09Z",
  "category": "语言类小剧场",
  "categoryGroup": "小剧场",
  "categoryId": "2155",
  "tags": [
    "发现《年轮说》",
    "配音小剧场",
    "搞笑",
    "八嘎"
  ],
  "author": {
    "id": "3493260618106936",
    "name": "伤心欲茄222",
    "url": "https://space.bilibili.com/3493260618106936",
    "avatarUrl": "https://i1.hdslb.com/bfs/face/1f0cb64d9b62da7db7e6e020b78b6872dbffe55c.jpg"
  },
  "views": 1638179,
  "likes": 126338,
  "coins": 2326,
  "favorites": 5851,
  "shares": 2698,
  "danmakuCount": 669,
  "commentCount": 2647,
  "parts": [
    {
      "partId": "42755231574",
      "title": "《最有耐心の杀手》",
      "durationSeconds": 111
    }
  ],
  "isOriginal": null,
  "copyrightType": 3,
  "uploadLocation": null,
  "detailLevel": "full",
  "status": "ok",
  "input": "BV1SMJC6sE6R",
  "sourceType": "video",
  "scrapedAt": "2026-10-15T17:32:07.734Z"
}
```

A reply to a comment of that video:

```json
{
  "type": "comment",
  "status": "ok",
  "commentId": "320756653104",
  "videoId": "BV1SMJC6sE6R",
  "videoUrl": "https://www.bilibili.com/video/BV1SMJC6sE6R",
  "videoTitle": "《最有耐心の杀手》",
  "text": "不好笑就别笑",
  "likes": 11,
  "replyCount": null,
  "publishedAt": "2026-10-15T04:37:16Z",
  "isReply": true,
  "rootCommentId": "317107373521",
  "parentCommentId": "317107373521",
  "author": {
    "id": "26189986",
    "name": "-吃螃蟹不吐螃蟹皮--",
    "url": "https://space.bilibili.com/26189986",
    "level": 6,
    "isVip": true,
    "avatarUrl": "https://i1.hdslb.com/bfs/face/c7be45956bc393f058f98bacbc7078005b78f0f4.jpg"
  },
  "pictures": [],
  "likedByCreator": false,
  "repliedByCreator": false,
  "isPinned": false,
  "position": 2,
  "input": "BV1SMJC6sE6R",
  "sourceType": "video",
  "scrapedAt": "2026-10-15T17:32:27.746Z"
}
```

A danmaku of that video:

```json
{
  "type": "danmaku",
  "status": "ok",
  "danmakuId": "2222528856009992960",
  "videoId": "BV1SMJC6sE6R",
  "videoUrl": "https://www.bilibili.com/video/BV1SMJC6sE6R",
  "partId": "42755231574",
  "text": "首位",
  "videoTimeSeconds": 0.637,
  "postedAt": "2026-10-15T04:08:05Z",
  "mode": "scrolling",
  "color": "#ffffff",
  "fontSize": 25,
  "userHash": "c6697d23",
  "input": "BV1SMJC6sE6R",
  "sourceType": "video",
  "scrapedAt": "2026-10-15T17:33:58.515Z"
}
```

Fields that need a word of explanation:

- `detailLevel`: `full` when the record comes from the video's own page; `search` or `list` when it has only the
  fields of the list it came from (with **Full video details** off, or when Bilibili did not serve the page at that
  moment: the run summary says how many).
- `uploadLocation`: the province or country Bilibili shows for the upload (IP属地). Bilibili gives it in its lists
  (search, related videos, rankings); a video given by its link alone may not have it.
- `isOriginal`: original work (自制) or repost (转载); `copyrightType` is the raw type, where Bilibili now also uses a
  third value (3) for many recent videos.
- `category`, `categoryGroup`, `categoryId`: Bilibili's category (in Chinese), its top-level group and its number.
- Comments: `isReply`, `rootCommentId` (the top comment of the thread) and `parentCommentId` (the comment it answers)
  rebuild the threads; `position` is the comment's rank in the order read; `likedByCreator` and `repliedByCreator`
  are the creator's own reactions.
- Danmaku: `videoTimeSeconds` is the moment of the video where it shows; `userHash` is the hash Bilibili gives for the
  sender, not an account.
- `rank`: position in the search, list or ranking; `input` and `sourceType` say where each record comes from.
- `status`: `ok` (delivered, charged). A video, creator or link that does not exist gets a record with `status`
  `notFound`, free. An input that fails gets an `error` record, free: `error` says why, `retryable` says if a later run
  may work.

The run summary (counts per input, notes, why the run stopped) is the `OUTPUT` record of the run's key-value store.

### English translation (optional)

Tick **Translate to English** (`translateToEnglish: true`) and each record comes with its texts in English, next to the
original: `titleTranslation` and `descriptionTranslation` for videos, `translation` for comments and danmaku,
`bioTranslation` for creators, `titleTranslation` and `summaryTranslation` for articles. The original always stays, so
you can check a phrase or quote it in Chinese. The translation is made by a large language model, in full, never
summarized.

- It is charged only when all the texts of a record are translated (`translationStatus: "ok"`). Otherwise you get the
  record as usual, `translationStatus: "failed"` with the reason in `translationError`, and the translation is not
  charged.
- Texts already in English, and texts with only Bilibili emoticons such as `[doge]`, are not translated and not charged
  (`translationStatus: "notNeeded"`).
- Names of people, games and places can come out in more than one English spelling: when one matters, check it
  against the Chinese.
- Translations do not count toward **Max results**.

### Pricing

Pay per event:

| Event | Price |
|---|---|
| Result: a video, comment, reply, creator, article or hot search | $10 per 1,000 |
| Danmaku | $1 per 1,000 |
| English translation (option) | $2 per 1,000 records translated |
| Run start | $0.005 per GB of memory (1 GB minimum; $0.005 at the default 512 MB) |

Never charged: inputs not found, error records, duplicates (a video found by two searches is delivered once). Set
**Maximum cost per run** in the run options and the run stops before going over it.

### Limits

- Bilibili serves 1,000 results per search. For videos the run goes past it by reading on newest first; for creators
  and articles, 1,000 is the most a search gives.
- Bilibili's article search ignores publication dates. With dates, the run looks through the newest articles for your
  words, keeps those of your dates and sorts them itself (by views, comments or favorites); articles older than what
  that search reaches are not found this way (a creator's articles can be read by dates). The run says how far back
  it looked.
- Danmaku: you get what Bilibili shows a visitor, which for most videos is the whole track; the oldest danmaku of very
  busy videos are kept by Bilibili for signed-in users only.
- Comments Bilibili folds away or hides from visitors are not collected; the counter under a video includes them.
- Bilibili has no ranking for Anime and News, and its search has no filter for the newer categories (AI, Outdoors,
  Fitness, Parenting, Health, Relationships, Hobbies, Life tips, Short dramas, Vlog): the run says so in its summary and
  reads all categories. Anime series rankings (番剧) list series, not videos, and are not collected.

### FAQ

**Do I need a Bilibili account or cookies?** No.

**Can I get every comment of a video?** Yes: set **Max comments per video** high enough and tick **Replies** for the
replies too.

**What if the run is restarted by the platform (migration or reboot)?** It resumes where it was: records already in
the dataset are not delivered or charged again.

**Is it legal?** It collects public data shown to any visitor of Bilibili. Check the rules that apply to your use of
the data, especially for personal data. With Translate to English, the texts are sent to a language-model service that
does not keep them to train its models.

**Is anything different on Apify's free plan?** The English translation option is available on paid Apify plans only; on the free plan the run collects everything else as usual and charges nothing for translation.

**Does the Actor send anything to Quarra?** Only when a run fails or runs out of time: the Actor, its build, the error type, the line of our code where it happened, and the memory and time the run was given, so we can fix it fast. Never your input, your results, your account or the run ID.

# Actor input Schema

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

One per line, in Chinese or any language Bilibili understands (原神, iPhone 17, 机器人). Each term returns up to 'Max results per search, creator or list' of the type picked below.

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

What the search terms look for.

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

One per line: a video link (https://www.bilibili.com/video/BV1SMJC6sE6R), a b23.tv share link (the whole share text from the app works too), a BV ID or an av number. Each video gives one full record, then its comments and danmaku if you ask for them.

## `creatorUrls` (type: `array`):

One per line: a channel link (https://space.bilibili.com/946974), a b23.tv share link or a numeric user ID. Each creator gives its profile, then its videos and/or articles (below).

## `creatorContent` (type: `array`):

What to list from each creator in 'Creators', up to 'Max results per search, creator or list' of each.

## `trending` (type: `array`):

Bilibili's own trending lists. The ranking follows 'Category' and 'Ranking type'.

## `sortBy` (type: `string`):

Order of the search results. 'Most danmaku' is for videos, 'Most followers' for creators; a sort that does not apply falls back to relevance.

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

Videos and articles published on or after this date: 2026-10-01, 2026-10-01T08:00:00Z, or a duration back from now like '7 days' or '12 hours'. Applies to searches and creators' lists.

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

Videos and articles published on or before this date (same formats).

## `duration` (type: `string`):

Video searches only.

## `category` (type: `string`):

Filters video searches and picks the ranking list. Bilibili has no ranking for Anime and News, and its search cannot filter by AI, Outdoors, Fitness, Parenting, Health, Relationships, Hobbies, Life tips, Short dramas or Vlog: the run then says so and reads all categories.

## `rankingType` (type: `string`):

Which ranking to read when 'Ranking' is in the trending lists.

## `maxResultsPerSource` (type: `integer`):

Videos, creators or articles per search term, per creator (videos and articles each) and per trending list. Bilibili serves 1,000 results per search; for videos, the scraper goes past that by reading the rest newest first.

## `fullVideoDetails` (type: `boolean`):

Open each video's page for everything: coins, shares, favorites, tags, category, parts, original or repost. Off: only the fields the search or list shows (faster).

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

Add the comments of every video scraped (related videos excepted): text, likes, date, author with level, pinned, liked or answered by the creator, pictures.

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

Comments per video, replies included.

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

Order in which comments are read.

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

Add the replies under each comment, right after it, with the comment they answer.

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

Replies read under each comment.

## `includeDanmaku` (type: `boolean`):

Add the danmaku of every video scraped (related videos excepted), the comments that fly over the video: text, second of the video, date, mode, color, part. You get what Bilibili shows a visitor; older danmaku that Bilibili keeps for signed-in users are not included.

## `maxDanmakuPerVideo` (type: `integer`):

Danmaku per video, all parts together.

## `includeRelatedVideos` (type: `boolean`):

For each video in 'Videos': add the videos Bilibili shows next to it, up to 'Max results per search, creator or list'.

## `translateToEnglish` (type: `boolean`):

Add an English translation next to the original, which is always kept: title and description of videos, text of comments and danmaku, bio of creators, title and summary of articles. Paid option, charged per record translated, only when the translation is complete. Records already in English, or with only emoji, are not translated and not charged. Available on paid Apify plans only.

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

Total number of records delivered by the run (videos, comments, danmaku, creators, articles, hot searches), counted exactly.

## Actor input object example

```json
{
  "searchQueries": [
    "原神"
  ],
  "searchType": "videos",
  "creatorContent": [
    "videos"
  ],
  "sortBy": "relevance",
  "duration": "any",
  "category": "all",
  "rankingType": "all",
  "maxResultsPerSource": 10,
  "fullVideoDetails": true,
  "includeComments": false,
  "maxCommentsPerVideo": 100,
  "commentsSort": "top",
  "includeReplies": false,
  "maxRepliesPerComment": 20,
  "includeDanmaku": false,
  "maxDanmakuPerVideo": 1000,
  "includeRelatedVideos": false,
  "translateToEnglish": false,
  "maxItems": 100
}
```

# Actor output Schema

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

Every record with all its fields, and free records for inputs not found and errors.

## `overview` (type: `string`):

A table of every record.

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

A table of the video records.

## `comments` (type: `string`):

A table of the comment records.

## `danmaku` (type: `string`):

A table of the danmaku records.

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

Counts per input, why the run stopped, and errors.

# 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": [
        "原神"
    ],
    "maxResultsPerSource": 10,
    "maxItems": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("quarra/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": ["原神"],
    "maxResultsPerSource": 10,
    "maxItems": 100,
}

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

```

## MCP server setup

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