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

Bilibili (哔哩哔哩, B站) data without login: video search, popular board and top-100 rankings, full video stats, comments with replies, danmaku (bullet comments), creator profiles, every upload and a new-items watcher. Pay per result, from $1.50 per 1,000 videos.

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

## Pricing

from $1.05 / 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 & API: Videos, Comments, Danmaku, Trending

Videos, comments, danmaku (弹幕 bullet comments), rankings and creator data from **Bilibili (哔哩哔哩, B站)**, China's biggest video community, as clean JSON, CSV or Excel: search by keyword, pull the popular board, top-100 rankings and weekly must-watch list, full stats per video, whole comment threads with replies, danmaku with their time in the video, creator (UP主) profiles and every upload; no login, no cookie, no browser, no Chinese phone number.

**Try it:** Click Start with the default input: 20 videos for the keyword `DeepSeek` with views, likes, comment and danmaku counts in 4 s for about $0.03 (run on October 21, 2026).

Five of those 20 rows (search mode, relevance order, titles shortened):

| Video | Creator | Views | Likes | Comments | Danmaku | Published |
|---|---|---|---|---|---|---|
| 【Day 0】我是DeepSeek鲸鱼娘，这个B站账号现在归我了 | DeepSeek鲸鱼娘在运营 | 1,670,801 | 98,918 | 19,915 | 611 | 2026-10-19 |
| DeepSeek Harness 首发实测 + 入门教程 | 程序员鱼皮 | 2,452,840 | 102,360 | 6,588 | 2,589 | 2026-08-14 |
| 【黑鸦】AI圈大地震！DeepSeek祭出开源核弹 | 黑鸦Heya | 227,211 | 5,707 | 3,398 | 427 | 2026-10-20 |
| DeepSeek新模型能和GPT-6 Astra 对比实测 | 神烦老狗 | 209,942 | 4,932 | 2,670 | 2,019 | 2026-10-18 |
| DeepSeek 才是真的 OpenAI：看懂其最新开源的推理框架 DeepInfer | code秘密花园 | 12,586 | 603 | 158 | 99 | 2026-10-21 |

**Pricing:** $1.50 per 1,000 videos; add-ons $0.50 per 1,000 video details, $0.50 per 1,000 comments, $0.10 per 1,000 danmaku, $2 per 1,000 danmaku summaries, $1.50 per 1,000 creators; plus $0.00005 per run. Platform usage is included; failed runs, error rows and `no-results` rows are not charged.

Every video row also carries `bvid`, `aid`, URL, description, tags, duration, category, cover and creator ID; turn on `includeComments`, `includeDanmaku` or `includeDetails` to add the comment thread, the danmaku pool or coins, shares and honors for each video, as in the runs below.

### More real examples (October 15, 2026)

Run on Apify on **October 15, 2026 (19:58 UTC)**. Search mode, keyword `iPhone 17`, sorted by most views, 3 videos, with `includeComments` (3 per video) and `includeDanmaku` (summary). It finished in 11 seconds and cost the user $0.015.

| # | Video | Creator | Views | Comments | Danmaku | Top comment (likes) | Danmaku: unique senders of fetched |
|---|---|---|---|---|---|---|---|
| 1 | 外观变了，值得买吗？iPhone 17 Pro\&Air评测 | 影视飓风 | 16,184,830 | 185,051 | 688,585 | 今年换铝合金，导热性能比上代提升20倍。明年换钛合金，硬度比上代提升10倍…… (12,520) | 2,707 of 3,600 |
| 2 | 最薄的iPhone...代价呢？国行iPhone Air上手体验 | 影视飓风 | 6,943,345 | 9,124 | 9,108 | 马上就要开奖了 提前恭喜这100人 (3,249) | 1,566 of 1,800 |
| 3 | 【何同学】最听劝的一代，但是... iPhone 17系列首发体验 | 老师好我叫何同学 | 6,636,613 | 9,867 | 23,520 | 最后一段的猜想才是整个视频最有意思的内容\[点赞] (5,312) | 2,944 of 3,600 |

The creator's own pinned comment comes first in each thread (`isPinned: true`, `isUploader: true`); the table shows the top comment from viewers.

Same day (19:56 UTC), trending mode, the **Tech & digital (科技数码) top-100 ranking**, first 5 with `includeDetails`:

| Rank | Video | Creator | Views | Likes | Coins | Favorites | Published |
|---|---|---|---|---|---|---|---|
| 1 | 2026诺贝尔物理学奖，冰立方中微子 | 比特新语 | 701,590 | 65,945 | 6,133 | 17,459 | 2026-10-11 |
| 2 | 我造了一块会飞的滑板... | 神奇阿宇Ayu | 213,539 | 24,436 | 19,990 | 6,306 | 2026-10-15 |
| 3 | 济南黄河中继台真热闹！走到哪里都有业余无线电爱好者… | BG3ODZ-团长 | 425,966 | 22,558 | 259 | 2,670 | 2026-10-12 |
| 4 | 【睿影红枫人像】这真实真动人 | 华为终端 | 758,604 | 2,454 | 141 | 249 | 2026-10-12 |
| 5 | 一加16上手体验：表现全面的"驯龙高手" | 极客湾Geekerwan | 748,759 | 20,630 | 2,792 | 2,713 | 2026-10-12 |

Row 5 in full:

```json
{
  "type": "video",
  "source": "ranking",
  "input": "ranking:1012",
  "rank": 5,
  "bvid": "BV1gipd6iELS",
  "aid": 117427996329149,
  "url": "https://www.bilibili.com/video/BV1gipd6iELS",
  "title": "一加16上手体验：表现全面的“驯龙高手”",
  "description": "一加16这次搭载了全局165Hz、游戏185Hz的高刷，作为一台性能旗舰，它还搭载了2亿像素的主摄，一起来看看它的表现如何吧！",
  "category": "数码",
  "categoryId": 95,
  "categoryGroup": "科技数码",
  "durationSeconds": 630,
  "publishedAt": "2026-10-12T13:13:32Z",
  "creatorName": "极客湾Geekerwan",
  "creatorId": 25876945,
  "creatorUrl": "https://space.bilibili.com/25876945",
  "creatorFollowers": 5613739,
  "views": 748759,
  "likes": 20630,
  "coins": 2792,
  "favorites": 2713,
  "shares": 2247,
  "danmakuCount": 2255,
  "commentCount": 4821,
  "tags": ["一加16有龙则灵", "一加16", "一加手机", "一加"],
  "coverUrl": "https://i1.hdslb.com/bfs/archive/42c6fb98da5a1a9c6c16df7797af804e03901a00.jpg",
  "parts": 1,
  "pageList": [{"page": 1, "cid": 42699194968, "title": "一加16_v8", "durationSeconds": 630}],
  "cid": 42699194968,
  "resolution": "3840x2160",
  "honors": ["热门收录"],
  "subtitleLanguages": ["zh"],
  "publishLocation": "上海",
  "rankingCategory": "Tech & digital",
  "isPaid": false,
  "scrapedAt": "2026-10-15T19:56:55Z"
}
```

A comment row from the search run:

```json
{
  "type": "comment",
  "input": "iPhone 17",
  "videoBvid": "BV1Enpxz5Ef3",
  "videoUrl": "https://www.bilibili.com/video/BV1Enpxz5Ef3",
  "commentId": "274936130209",
  "rootCommentId": null,
  "isReply": false,
  "text": "今年换铝合金，导热性能比上代提升20倍。明年换钛合金，硬度比上代提升10倍。后年换铝合金，导热性能比上代提升20倍……",
  "likes": 12520,
  "replyCount": 109,
  "postedAt": "2025-09-17T12:21:31Z",
  "authorName": "快门君的糖不甩",
  "authorId": 75164977,
  "authorLevel": 6,
  "isUploader": false,
  "isPinned": false,
  "imageUrls": [],
  "scrapedAt": "2026-10-15T19:58:48Z"
}
```

A danmaku summary row (danmaku mode, `BV1uCptzTEt8`, `danmakuOutput: both`; sample shortened to 4 of 20):

```json
{
  "type": "danmaku-summary",
  "videoBvid": "BV1uCptzTEt8",
  "videoTitle": "【何同学】最听劝的一代，但是... iPhone 17系列首发体验",
  "videoDurationSeconds": 1191,
  "danmakuTotal": 23520,
  "danmakuFetched": 3600,
  "uniqueSenders": 2944,
  "danmakuPerMinute": 181.36,
  "peakMinute": 0,
  "peakMinuteCount": 1915,
  "perMinute": [1915, 817, 71, 33, 17, 44, 37, 41, 32, 29, 49, 26, 27, 22, 54, 31, 47, 113, 122, 73],
  "firstAtSeconds": 0,
  "lastAtSeconds": 1190.756,
  "sample": [
    {"timeSeconds": 29.777, "text": "这一段是溢出屏幕的经费"},
    {"timeSeconds": 208.508, "text": "上高刷是因为功能需要不然苹果还能60帧"},
    {"timeSeconds": 505.599, "text": "发烧且存活温度的世界纪录是46.5度"},
    {"timeSeconds": 1043.922, "text": "这得放弃全部隐私"}
  ]
}
```

One raw danmaku row from the same run: `{"timeSeconds": 333.528, "text": "荣耀90就有", "sentAt": "2026-02-25T13:24:19Z", "mode": "scroll", "fontSize": 25, "color": "#927939", "danmakuId": "2054660843849182208"}`.

### What it does

| Mode | Input | Output |
|---|---|---|
| `search` | keywords (Chinese or English) | videos, with sort (relevance, views, newest, danmaku, favorites, comments), length and publish-date filters; up to 1,000 per keyword |
| `searchCreators` | names | creators matching the name, with followers, video count, level, verification and their latest videos |
| `videos` | URLs, BV IDs, av IDs, b23.tv links | full details: every stat incl. coins and shares, all tags, honors, parts, resolution, subtitle languages, creator followers |
| `comments` | video URLs or IDs | comments in hot or newest order, optionally with every reply |
| `danmaku` | video URLs or IDs (`?p=2` for part 2) | one row per danmaku and/or one summary row per video |
| `trending` | boards | popular board (热门, about 640 videos), top-100 ranking for all of Bilibili or one of 14 categories (排行榜), weekly must-watch (每周必看, any issue), all-time must-watch (入站必刷) |
| `creators` | creator IDs, space.bilibili.com links or names | profile: followers, following, total likes, video count, level, verification, bio, live room |
| `creatorVideos` | creator IDs, links or names | every upload, newest or most viewed first, paged through the creator's whole list |

**Add-ons for any mode that finds videos** (search, trending, video details, creator uploads):

- `includeDetails`: coins, shares, tags, honors, parts, creator followers for every video ($0.50 per 1,000).
- `includeComments`: the comment thread of every video (up to `maxCommentsPerVideo`).
- `includeDanmaku`: the danmaku of every video, as rows or a summary.

**Watcher.** `onlyNew` remembers what earlier runs returned (per `watcherName`) and outputs only new videos, or new comments in comments mode. Skipped items are not charged. Put it on a Schedule to follow a keyword, a ranking, a creator's uploads or the comments under a video.

### Input examples

New videos about a brand from the last 7 days, with their comments:

```json
{"mode": "search", "queries": ["比亚迪", "BYD"], "sortBy": "newest", "publishedAfter": "7 days", "maxResults": 200, "includeComments": true, "maxCommentsPerVideo": 50}
```

Daily rankings for gaming and tech, with full stats:

```json
{"mode": "trending", "boards": ["ranking"], "rankingCategories": ["1008", "1012"], "maxResults": 100, "includeDetails": true}
```

All comments and replies of two videos:

```json
{"mode": "comments", "videos": ["https://www.bilibili.com/video/BV1Enpxz5Ef3", "BV1KoWBzwE7T"], "maxCommentsPerVideo": 2000, "includeReplies": true}
```

Danmaku for sentiment work (raw rows plus a summary per video):

```json
{"mode": "danmaku", "videos": ["BV1uCptzTEt8"], "danmakuOutput": "both", "maxDanmakuPerVideo": 5000}
```

Creator monitoring (profile numbers, then new uploads only):

```json
{"mode": "creators", "creators": ["546195", "https://space.bilibili.com/946974", "极客湾Geekerwan"]}
{"mode": "creatorVideos", "creators": ["946974"], "maxResults": 30, "onlyNew": true, "watcherName": "ysjf-uploads"}
```

### Output

Every row has `type` (`video`, `comment`, `danmaku`, `danmaku-summary`, `creator`, `no-results` or `error`), `input` (the keyword, URL, board or creator it came from) and `scrapedAt`. Video rows also have `source` (`search`, `popular`, `ranking`, `weekly`, `mustWatch`, `creatorVideos`, `video`) and `rank`. The dataset has views for videos, comments, danmaku, danmaku summaries and creators.

What each source fills in: search rows have views, likes, favorites, danmaku and comment counts and the uploader's tags, but no coins or shares; trending rows have every stat; creator-upload rows have views and danmaku only. Turn on `includeDetails` to get every stat on any of them.

Inputs that cannot be read get an `error` row with the reason, and inputs with nothing to return get a `no-results` row. Neither is charged.

### Pricing

Pay per result. Platform usage is included.

| Event | Price | When |
|---|---|---|
| Video | $1.50 per 1,000 | every video row |
| Video details | $0.50 per 1,000 | with `includeDetails`, and always in `videos` mode |
| Comment | $0.50 per 1,000 | every comment or reply |
| Danmaku | $0.10 per 1,000 | every danmaku row |
| Danmaku summary | $2.00 per 1,000 | every summary row (one per video) |
| Creator | $1.50 per 1,000 | every creator row |
| Actor start | $0.00005 | once per run |

Examples: 1,000 search results cost $1.50. The top-100 of 5 rankings with details cost $1.00. 10,000 comments cost $5.00. The full danmaku pool of a popular video (3,600 rows) costs $0.36. The example run above cost $0.015.

### Accuracy and limits

- **Search** returns at most 1,000 videos per keyword; that is Bilibili's own cap. Split broad topics into narrower keywords or date windows (`publishedAfter`/`publishedBefore`).
- **Rankings**: Bilibili moved to new categories in 2025, and most old category rankings stopped updating in March/April 2025. Only rankings that were still live on 2026-10-15 are offered: all of Bilibili plus 14 categories. If a board looks frozen (newest video over 60 days old), the run status says so.
- **Comments**: logged-out access, as on the website. In testing, Bilibili served about 1,200 top-level comments per video in hot order and had not run out. Videos with comments closed return a `no-results` row.
- **Danmaku**: Bilibili keeps a pool of recent danmaku per video part (we saw 1,000 to 6,000, depending on length), not every danmaku ever sent. `danmakuTotal` is Bilibili's lifetime count; compare it with `danmakuFetched`. When `maxDanmakuPerVideo` is lower than the pool, rows are spread over the pool in time order, so they follow where viewers commented.
- **Privacy**: danmaku sender hashes are dropped (they can be reversed to account IDs); summaries only count unique senders. Comment rows carry the public nickname, user ID and level, as shown on the site.
- **Categories** (`category`, `categoryGroup`) and honors are in Chinese, as Bilibili shows them. `categoryId` is Bilibili's old category ID and `categoryIdV2` its 2025 category ID. The video detail API sends only IDs, so for `videos` mode and `includeDetails` the names come from Bilibili's 2025 category tree (31 groups, 205 categories, read from bilibili.com on 2026-10-19). `isOriginal` is true or false when Bilibili marks a video as original (1) or reposted (2), and null for its newer code 3, whose meaning is undocumented.
- **Not covered**: anything that needs an account (private or fan-only videos, AI subtitles text, watch history), live-stream chat, Bilibili Comics and paid anime episodes.

### Reliability

Plain HTTP against the JSON APIs the Bilibili website and app use. Requests are paced (about 4 per second) because Bilibili blocks bursts. Refused requests are retried with backoff and, after repeated refusals, through the Apify datacenter proxy automatically. Bilibili's risk control sometimes refuses the comment and video-detail endpoints from cloud IP ranges while search and rankings still answer (seen on October 21, 2026 from Apify's datacenter IPs); affected videos then come back as `error` rows that are not charged. If that happens, try again later or set a residential proxy in the Proxy field. Before release: 76 unit tests, and 29 cloud runs covering every mode: 28 SUCCEEDED, and one empty-input run failed on purpose with a clear message. A load test returned 2,650 videos in 32 seconds; 600 comments took 15 seconds and 3,800 danmaku 7 seconds.

### FAQ

**Do I need a Bilibili account, cookie or VPN?** No. Everything comes from what Bilibili shows logged-out visitors.

**Can I search in English?** Yes. Bilibili matches English titles and tags, but most content is Chinese, so add the Chinese name too (e.g. `比亚迪` and `BYD`).

**What are BV, av, mid and cid?** `bvid` (BV1...) and `aid` are a video's two IDs; `mid` is a creator's user ID (the number in `space.bilibili.com/<mid>`); `cid` is one part of a multi-part video and is what danmaku belong to.

**How do I monitor something?** Set `onlyNew: true` and a `watcherName`, then schedule the task. The first run returns everything and remembers it; later runs return only what is new. For new comments, use `commentsSort: newest`.

**Why do coins and shares say null on search rows?** The search API does not return them. Turn on `includeDetails`.

**A creator name matched the wrong account.** Names are resolved through Bilibili's creator search: among the matching names, the account with the most followers wins (`matchedBy` says how). Use the numeric ID or the space.bilibili.com link to be exact.

**Is scraping Bilibili legal?** This actor reads public pages that anyone can open without logging in. You are responsible for how you use the data, including Bilibili's terms and data protection rules where you work.

### Changelog

- **0.1.11 (2026-10-21)**: documents Bilibili's cloud-side risk control on the comment and video-detail endpoints (see Reliability). No scraping changes.
- **0.1.10 (2026-10-21)**: first public release on the Apify Store. README leads with a dated DeepSeek search run and the full price list; input prefill unchanged. No scraping changes.
- **0.1.9 (2026-10-19)**: video rows from `videos` mode and `includeDetails` now have category names (they were empty) and a new `categoryIdV2` column with Bilibili's 2025 category ID.
- **0.1 (2026-10-15)**: first release. Modes: search, searchCreators, videos, comments, danmaku, trending (popular, ranking, weekly, mustWatch), creators, creatorVideos. Add-ons: details, comments, danmaku. Watcher for videos and comments.

# Actor input Schema

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

What to scrape. search: videos matching keywords. searchCreators: creators (UP主) matching a name. videos: full details of given videos. comments: comment threads of given videos. danmaku: the bullet comments (弹幕) of given videos. trending: popular board, top-100 rankings, weekly and all-time must-watch lists. creators: creator profiles (followers, likes, video count). creatorVideos: every upload of given creators.

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

Used by 'search' and 'searchCreators'. Chinese or English keywords, one per line, e.g. 原神, iPhone 17, DeepSeek. Bilibili returns at most 1,000 videos per keyword.

## `videos` (type: `array`):

Used by 'videos', 'comments' and 'danmaku'. Video URLs (bilibili.com/video/BV...), BV IDs, av IDs or b23.tv short links. Add ?p=2 to a URL to pick part 2 of a multi-part video for danmaku.

## `creators` (type: `array`):

Used by 'creators' and 'creatorVideos'. Creator IDs (mid, e.g. 546195), space.bilibili.com/<mid> links, or creator names (resolved with Bilibili's creator search; the exact name wins).

## `boards` (type: `array`):

Used by 'trending'. popular: Bilibili's hot board (about 640 videos). ranking: the top-100 ranking per category. weekly: the weekly must-watch issue (每周必看). mustWatch: the all-time must-watch list (入站必刷, ~100 videos).

## `rankingCategories` (type: `array`):

Used by the 'ranking' board. One top-100 list per category; 0 = all of Bilibili. Only categories whose ranking Bilibili still updates are listed (its other category rankings have been frozen since spring 2025).

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

Used by the 'ranking' board. all: every video. original: original uploads only. newcomers: creators new to the ranking.

## `weeklyIssue` (type: `integer`):

Used by the 'weekly' board. 0 (default) = the latest issue. Issues are numbered from 1 (March 2019); e.g. 394 is the week of 2026-10-02.

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

Videos per keyword, board, ranking category or creator (or creators per name search). Search is capped by Bilibili at 1,000 per keyword; rankings at 100; the popular board at about 640.

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

Used by 'search'. Order of the search results.

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

Used by 'search'. Keep only videos of this length.

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

Used by 'search'. Only videos published on or after this date (YYYY-MM-DD, UTC) or within a relative window such as '7 days' or '2 weeks'.

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

Used by 'search'. Only videos published on or before this date (YYYY-MM-DD, UTC) or relative such as '1 day'. Leave empty for up to now.

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

Used by 'creatorVideos'. newest: latest uploads first (the full list, paged). mostViewed: the creator's most-played videos first.

## `includeDetails` (type: `boolean`):

For search, trending and creator uploads: also read each video's page data to add coins, shares, likes, all tags, honors (e.g. 'top 19 on the ranking'), parts, creator follower count and subtitle languages. One extra request per video, charged as 'video-details'. Always on in 'videos' mode.

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

For search, trending, video details and creator uploads: also return each video's comments as 'comment' rows (up to 'Max comments per video'). Always on in 'comments' mode.

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

Comment rows per video, replies included. Bilibili served logged-out visitors about 1,200 top comments per video in our tests and had not run out.

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

hot: Bilibili's popular-comments order (most liked and discussed first). newest: newest first (use this with 'Only new items' to monitor new comments).

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

Also return the replies under each comment (rows with isReply = true and rootCommentId). Replies count toward 'Max comments per video'.

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

For search, trending, video details and creator uploads: also return each video's danmaku (bullet comments). Always on in 'danmaku' mode.

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

Bilibili keeps a pool of recent danmaku per video part (1,000 to 6,000 in our tests). When the pool is larger than this limit, rows are picked evenly through the pool in time order, so they follow where viewers commented instead of stopping after the first seconds.

## `danmakuOutput` (type: `string`):

rows: one row per danmaku (time in video, text, sent at, position, color). summary: one row per video with the danmaku count, unique senders, a per-minute histogram, the peak minute and an even sample. both: both.

## `onlyNew` (type: `boolean`):

Remember what earlier runs returned (per watcher name) and output only videos (or, in comments mode, comments) not seen before. Skipped items are not charged. Use with a Schedule to monitor a keyword, a board, a creator's uploads or a video's comments.

## `watcherName` (type: `string`):

Names the saved 'seen' list so separate monitors do not mix, e.g. 'ev-weekly' or 'brand-comments'. Stored in the key-value store 'bilibili-scraper-state'.

## `maxConcurrency` (type: `integer`):

Requests sent at the same time. Requests are also paced to about 4 per second, because Bilibili blocks bursts. Keep the default unless runs get refused.

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

Not needed: Bilibili answers Apify servers directly. Set a proxy only if your runs are refused.

## `autoProxyFallback` (type: `boolean`):

When Bilibili refuses repeated requests from the run's server, retry through the Apify datacenter proxy automatically (only when no proxy is set above).

## Actor input object example

```json
{
  "mode": "search",
  "queries": [
    "DeepSeek"
  ],
  "boards": [
    "popular"
  ],
  "rankingCategories": [
    "0"
  ],
  "rankingType": "all",
  "weeklyIssue": 0,
  "maxResults": 20,
  "sortBy": "relevance",
  "duration": "any",
  "creatorVideosOrder": "newest",
  "includeDetails": false,
  "includeComments": false,
  "maxCommentsPerVideo": 100,
  "commentsSort": "hot",
  "includeReplies": false,
  "includeDanmaku": false,
  "maxDanmakuPerVideo": 1000,
  "danmakuOutput": "rows",
  "onlyNew": false,
  "watcherName": "default",
  "maxConcurrency": 3,
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "autoProxyFallback": true
}
```

# Actor output Schema

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

No description

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

No description

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

No description

## `creators` (type: `string`):

No description

## `allRows` (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 = {
    "mode": "search",
    "queries": [
        "DeepSeek"
    ],
    "maxResults": 20
};

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

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

```

## MCP server setup

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