# Bilibili Scraper: Videos, Comments, Danmaku, Trends · $0.07/1K (`pomlabs/bilibili-scraper`) Actor

Bilibili without login: search videos and users (date range, Chinese brand names), whole channels, video stats with comments and replies, every danmaku with its second, danmaku reaction profiles, category rankings and Chinese sentiment. From $0.07 per 1,000 videos.

- **URL**: https://apify.com/pomlabs/bilibili-scraper.md
- **Developed by:** [Pom Labs](https://apify.com/pomlabs) (community)
- **Categories:** Social media, Videos, Lead generation
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.04 / 1,000 video 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/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, Trending

Get data from **Bilibili** (哔哩哔哩), China's YouTube, without login and without cookies: **search videos and users by keyword** (date range, length, sort, Chinese brand names added for you), **every video of a channel** with its profile, **full stats of any video** with its **comments and replies**, **every danmaku** (弹幕, the bullet comments that fly over the video) with the second it appears at, a **danmaku reaction profile** of each video, **trending now** and the **top 100 of 18 categories**, and **Chinese sentiment** on titles, comments and danmaku, and **transcripts** from the subtitles (Chinese and Bilibili's AI English translation).

Every search result shows **why it matched your keyword** (`matchedIn`: title, tag, description, author). Titles come clean, without the highlight HTML, and every field has an English name.

### Why this one

- **One field for everything:** keywords, channel links, video links and `popular` in the same list. The input names of other Bilibili scrapers work too (`searchQueries`, `searchTerms`, `videoUrls`, `userIds`, `sortOrder`, `durationFilter`, `commentsSort`, `maxCommentsPerVideo`).
- **Search past the 1,000 cap:** Bilibili stops a keyword at 1,000 results; we re-ask it in date windows to go up to 5,000. Or set `onlyPostsAfter` / `onlyPostsBefore` (a date or "7 days", "3 months").
- **Brands in Chinese:** Chinese users write `耐克`, not "nike". `autoLocalize` (on by default) also searches the Chinese name of 80+ Latin brands and merges the results; `searchAliases` adds your own names.
- **Danmaku, two ways:** every bullet comment as a row (text, second of the video, color, mode, font size, pool, send time, sender hash, weight; filter by time window or words), or one **profile row per video**: count, unique senders, **per-minute timeline**, peak minute, first and last, **the phrases repeated most** and an even sample.
- **Comments with threads, paged:** popular or newest, up to 1,000 a video (36 top comments a page), each with author level, VIP, verified, IP location and likes, plus the replies of each one, paged too (`rootId`, `isThreadReply`).
- **Transcripts (new):** the video's subtitles as text, with every line's start and end second: the uploader's own and Bilibili's AI ones, usually Chinese speech plus an AI English translation.
- **Chinese sentiment, free:** a score from -1 to 1 and positive / neutral / negative on titles, comments and danmaku, by a Chinese model (SnowNLP). No extra charge.
- **Only new videos:** `deltaMode` remembers what this account already got (per `deltaStateKey`, 30 days), for schedules; `followUpComments` re-reads each video once a day or more later and returns only the new comments.
- **Category rankings:** Bilibili's top 100 of animation, music, dance, games, knowledge, tech, sports, cars, life, food, animals, fashion, entertainment, movies and more, with the ranking score.
- **Engagement rate** on every video read in full: (likes + coins + favorites + shares + comments) / views.

### What you get

Video (search, channel, video link, trending, ranking): BV id, aid, link, title, description, author, author id, link and avatar, category, tags, views, likes, coins, favorites, shares, comments, danmaku, length in seconds and as text, publish date and timestamp, cover, resolution, parts with their cid and length, upload location, original or repost, engagement rate; for search: rank, total results and `matchedIn`; for trending: the reason; for rankings: the score.

User (user search): id, link, name, bio, followers, videos, level, verified, live status and room, avatar, 3 latest videos.

Channel (channel query or `mode: user_profile`): id, link, name, bio, followers, following, videos, total likes, level, verified role and title, VIP, gender, birthday and place when public, avatar.

Comment: id, root and parent ids, pinned, author, author id, link, avatar, level, VIP, gender, verified title, text, likes, replies, date, IP location shown by Bilibili, link, sentiment.

Danmaku row: cid, part index and title, second in the video and as text, mode and its label, font size, color (hex and decimal), pool and its label, send time and date, sender hash, danmaku id, weight, text.

Transcript: bvid, title, link, languages, transcript (full text), transcriptLanguage, isAiGenerated, subtitles (each language with every line and its start and end second).

Danmaku profile: danmakuFetched, danmakuTotal, danmakuPoolCapped, danmakuUniqueSenders, danmakuPerMinute, danmakuRateBasisSecs, danmakuPeakMinute, danmakuPeakMinuteCount, danmakuFirstAt, danmakuLastAt, danmakuPerMinuteTimeline, danmakuTopPhrases, danmakuSample, sentiment.

### Use cases

- **Market research in China:** what Chinese viewers watch and say about a product, a game or a brand, with sentiment.
- **Moment-by-moment reactions:** the danmaku timeline shows the second a video made people react, and what they wrote.
- **Influencer discovery:** Bilibili creators by topic, with followers and recent videos.
- **Competitor tracking:** every new video of a channel on a schedule (delta mode), with its numbers and new comments.
- **Trend watching:** the trending list and the category rankings, every day.
- **AI and datasets:** titles, tags, comments and danmaku in Chinese for training and analysis.

### Input examples

Search a brand in the last 30 days, with comments and a danmaku profile:

```json
{"queries": ["nike"], "onlyPostsAfter": "30 days", "order": "views", "maxResults": 20, "includeComments": true, "includeReplies": true, "includeDanmaku": true, "sentimentAnalysis": true}
```

Every danmaku between seconds 30 and 60 of a video:

```json
{"mode": "danmaku", "queries": ["BV1atse6EEfx"], "startSec": 30, "endSec": 60}
```

Top 100 of the tech category:

```json
{"queries": ["popular"], "category": "tech", "maxResults": 100}
```

| Field | What it does |
|---|---|
| `queries` | Keywords, channel links (`https://space.bilibili.com/546195` or `uid:546195`), video links or BV ids, or `popular` |
| `mode` | `search` (default), `video_comments`, `user_profile`, `danmaku`, `popular`, `transcript` |
| `maxResults` | Videos per query, 1 to 5,000 (default 40) |
| `searchType` | `videos` (default) or `users`, for keyword queries |
| `order` | `relevance`, `views`, `newest`, `danmaku`, `favorites`, `comments` |
| `duration` | `any`, `under10`, `10to30`, `30to60`, `over60` (also `short`, `medium`, `long`, `verylong`) |
| `onlyPostsAfter`, `onlyPostsBefore` | Date (2026-11-01) or period (7 days, 3 months) |
| `autoLocalize`, `searchAliases` | Chinese name of the brand, extra names |
| `channelKeyword` | Only the channel videos that match this keyword |
| `category` | With `popular`: the ranking of this category |
| `includeComments`, `sortComments`, `maxComments`, `includeReplies` | Comments, order (`hot`, `time`, `likes`, `all`), how many, replies |
| `includeDanmaku`, `danmakuSampleSize` | Danmaku profile and its sample size |
| `includeDanmakuRows`, `maxDanmakuPerVideo`, `startSec`, `endSec`, `danmakuKeywords` | Every danmaku as a row, with filters |
| `includeSubtitles`, `subtitleLanguages` | Transcript of each video, and which languages |
| `sentimentAnalysis` | Chinese sentiment |
| `deltaMode`, `deltaStateKey`, `followUpComments` | Only new videos and, later, their new comments |

### Output

```json
{
  "type": "video",
  "source": "search",
  "query": "原神",
  "rank": 1,
  "bvid": "BV1izyiztEqo",
  "url": "https://www.bilibili.com/video/BV1izyiztEqo",
  "title": "一国外网友分享自己初次玩原神时的感受引起外网玩家共鸣~",
  "author": "吉祥小草神",
  "authorId": 269091503,
  "category": "日常",
  "tags": ["原神UP主激励计划", "游戏杂谈", "原神"],
  "views": 39302,
  "likes": 970,
  "favorites": 147,
  "comments": 246,
  "danmaku": 22,
  "durationSec": 69,
  "durationText": "1:09",
  "publishedAt": "2026-11-25T01:53:12Z",
  "cover": "https://i0.hdslb.com/bfs/archive/52bcc2ae6ce0435c07ec92d42b69602f274e38c2.jpg",
  "matchedIn": ["title", "tag"],
  "totalResults": 1000,
  "status": "ok"
}
```

Danmaku profile (measured on a video with 93,146 danmaku):

```json
{"type": "danmaku-profile", "bvid": "BV1atse6EEfx", "danmakuFetched": 3600, "danmakuTotal": 93146, "danmakuPoolCapped": true, "danmakuUniqueSenders": 2499, "danmakuPerMinute": 170.62, "danmakuPeakMinute": 17, "danmakuPeakMinuteCount": 1582, "danmakuTopPhrases": [{"text": "新婚快乐", "count": 1124}, {"text": "合影", "count": 793}]}
```

Queries that fail (unknown video, bad link, Bilibili refusing) come as a row with `type: "error"` and the reason, and are not charged.

### Pricing

- **$0.07 per 1,000 videos, users and channels**
- **$0.60 per 1,000 comments**
- **$0.10 per 1,000 danmaku rows**
- **$10 per 1,000 danmaku profiles** (one per video: $0.01)
- **$3 per 1,000 transcripts** (one per video with subtitles: $0.003)

Less on higher Apify plans. Sentiment costs nothing extra. 100 search results: $0.007.

### Notes

- Comments and transcripts are read with our own Bilibili reading account (you need none): it pages the comment list, which a visitor sees only 3 of. If that session is unavailable, the run still returns the pinned comment and the top 3 per list. The total comment count comes in the video row (`totalComments`).
- Bilibili keeps a pool of the latest danmaku per video (up to a few thousand on big videos); `danmakuTotal` is the video's own count and `danmakuPoolCapped` says when the pool holds fewer.
- Sentiment comes from SnowNLP, a model trained on Chinese product reviews: read it as a trend over many comments, not as the truth about one.

# Actor input Schema

## `queries` (type: `array`):

One per line: a keyword (searched in videos, or users with Search type), a channel link (https://space.bilibili.com/546195) or uid:546195, a video link or BV id (BV1izyiztEqo), or the word popular (trending now; pick a Category for its ranking). Up to 20. The input names of other Bilibili scrapers work too (searchQueries, searchTerms, videoUrls, userIds).

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

Optional shortcut. Search reads Queries as usual; Comments returns only the comments of the videos; Channel profile returns only the profile of channel queries; Danmaku returns every bullet comment; Popular returns the trending list or the Category ranking.

## `maxResults` (type: `integer`):

1 to 5,000 videos per query. Past Bilibili's 1,000-result search cap the search is re-asked in date windows (newest first) to go further; a channel gives all its videos.

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

What keyword queries search: videos or users (channels).

## `order` (type: `string`):

Order of the video search results.

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

Only videos of this length (video search).

## `onlyPostsAfter` (type: `string`):

Only videos published after this date (2026-11-01) or within a period (7 days, 3 months, 1 year). Works on search and channel queries.

## `onlyPostsBefore` (type: `string`):

Only videos published before this date (2026-11-20).

## `autoLocalize` (type: `boolean`):

Bilibili users write brands in Chinese: with this on, a Latin brand keyword (nike, starbucks, tesla, pop mart...) is also searched by its Chinese name (耐克, 星巴克, 特斯拉, 泡泡玛特) and the results are merged.

## `searchAliases` (type: `array`):

Other names searched together with each keyword and merged (no duplicates), e.g. a product's Chinese nickname.

## `channelKeyword` (type: `string`):

For channel queries: only the channel's videos that match this keyword.

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

With the query popular (or Mode Popular): Bilibili's top 100 ranking of this category instead of the general popular list.

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

For video queries: also return the top comments (Bilibili shows visitors the pinned and hottest ones).

## `sortComments` (type: `string`):

Popular (Bilibili's own hot ranking, default), newest first, by likes, or both lists merged.

## `maxComments` (type: `integer`):

1 to 1,000 comment rows per video (top comments plus their replies). Paged through Bilibili's popular or newest list, 36 top comments a page.

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

Each top comment's replies as their own rows (rootId, isThreadReply), up to 20 per thread.

## `includeSubtitles` (type: `boolean`):

The video's subtitles as a transcript row: the uploader's and Bilibili's AI subtitles (Chinese speech and its AI English translation on most videos), full text plus each line with its start and end second.

## `subtitleLanguages` (type: `array`):

Only these languages (zh, en, ja...). Empty: all the video has.

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

One row per video describing the bullet comments (弹幕): count, unique senders, per-minute timeline, peak minute, first and last, phrases repeated most and a sample.

## `danmakuSampleSize` (type: `integer`):

How many danmaku, spread along the video, go in the profile's sample (0 to 500).

## `includeDanmakuRows` (type: `boolean`):

Each bullet comment as its own row: text, the second of the video it appears at, color, mode, font size, pool, send time, sender hash, weight.

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

Cap of danmaku rows per video.

## `danmakuMaxParts` (type: `integer`):

Multi-part videos (P1, P2...) keep danmaku per part: how many parts, from the first, are read for the profile and the rows.

## `startSec` (type: `integer`):

Danmaku rows: only from this second of the video.

## `endSec` (type: `integer`):

Danmaku rows: only up to this second of the video.

## `danmakuKeywords` (type: `array`):

Danmaku rows: only those containing one of these words.

## `sentimentAnalysis` (type: `boolean`):

A sentiment score (-1 to 1) and polarity on each video's title and description, each comment and the danmaku profile, by SnowNLP, a Chinese model, at no extra cost.

## `deltaMode` (type: `boolean`):

Return only videos this account has not received in earlier runs with the same State key (kept 30 days). For schedules.

## `deltaStateKey` (type: `string`):

Name of the delta-mode memory, so different schedules do not mix (default: default).

## `followUpComments` (type: `boolean`):

With delta mode and comments: once, between 1 and 7 days after a video was delivered, re-read it and return only the comments posted since (isFollowUp true).

## Actor input object example

```json
{
  "queries": [
    "minecraft"
  ],
  "mode": "search",
  "maxResults": 20,
  "searchType": "videos",
  "order": "relevance",
  "duration": "any",
  "autoLocalize": true,
  "category": "",
  "includeComments": false,
  "sortComments": "hot",
  "maxComments": 20,
  "includeReplies": false,
  "includeSubtitles": false,
  "includeDanmaku": false,
  "danmakuSampleSize": 25,
  "includeDanmakuRows": false,
  "maxDanmakuPerVideo": 5000,
  "danmakuMaxParts": 3,
  "sentimentAnalysis": false,
  "deltaMode": false,
  "followUpComments": false
}
```

# Actor output Schema

## `results` (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 = {
    "queries": [
        "minecraft"
    ],
    "maxResults": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("pomlabs/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 = {
    "queries": ["minecraft"],
    "maxResults": 20,
}

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

```

## MCP server setup

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