# Bilibili Scraper: Videos, Creators, Comments & Danmaku (`nice_dev/bilibili-videos-scraper`) Actor

Scrape Bilibili (哔哩哔哩): videos by keyword, link, creator, collection or trending list, with exact counts, creator profiles, comments, danmaku and subtitles. Export to JSON, CSV or Excel.

- **URL**: https://apify.com/nice_dev/bilibili-videos-scraper.md
- **Developed by:** [Nice Dev](https://apify.com/nice_dev) (community)
- **Categories:** Social media, Videos, MCP servers
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.02 / 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

### 📺 What is Bilibili Videos Scraper?

**Bilibili Videos Scraper** extracts **videos from [Bilibili](https://www.bilibili.com) (哔哩哔哩)**: **title, views, likes, coins, favorites, shares, danmaku and comment counts, tags, publication date and creator**, from a keyword search, video links, creators, collections, the Top 100 rankings or the Popular lists. On request it adds **comments and replies, danmaku (弹幕) with a summary, subtitles, chapters, background music, creator profiles, contacts from creator bios, creator posts (动态) and public favorites**. It works as a **Bilibili API alternative**: run it on a schedule, call it from your code, or plug it into Make, Zapier or n8n.

Type a **keyword** (`原神`, `minecraft`), paste video or creator links, or pick a ranking, click **Start**, and download the results in JSON, CSV or Excel. No Bilibili account needed for videos, creators, rankings, replies and danmaku, and it is **fast: about 100 videos of a search in 15 seconds**.

### 📋 What data can you extract from Bilibili?

One row per result, 125 fields. Each row says what it is (video, comment, danmaku, creator profile, post or hot search keyword):

| Category | What you get |
| --- | --- |
| 🎬 **Videos** | title, link, BV and av ids, cover, length, publication date, tags, category (zone) and main zone, paid or co-created — `《原神》过场动画-「遗赠」` |
| 📊 **Video stats** | views (播放), likes, coins, favorites, shares, danmaku and comment counts, engagement rate, current and best all-site rank, badges — `719916 views` |
| 🧾 **Full video page** | parts (分P) with their resolution, original or repost, rights, b23.tv short link, first frame, the text posted with the upload, the notice under the video, co-creators, collection (合集) |
| 👤 **Creators (UP主)** | UID, name, avatar and page on the video rows; profile rows with followers, following, uploads, posts, total likes, level, verification, VIP, live room, bio, birthday, school |
| 📇 **Contacts from bios** | e-mails, phone numbers, links and WeChat, Weibo, QQ, Douyin, RedNote, YouTube… handles written in a creator's bio |
| 💬 **Comments and replies** | text, likes, replies, date, author level and VIP, pinned, liked or answered by the creator, pictures, emotes, IP region (with your cookie) |
| 🌠 **Danmaku (弹幕)** | text, second of the video, send time, color, mode, size, pool, weight, sender hash; a summary per video: count, unique senders, busiest minute, per-minute curve, most said terms |
| 📝 **Subtitles, chapters, music** | CC and AI subtitles with timed lines and full text (with your cookie), chapters, background music title, artist and link |
| 📰 **Creator posts (动态)** | text, image, date, likes, comments, shares, favorites, pinned |
| 🏆 **Rankings and hot searches** | position, list name, ranking score, Popular badge, hot search keyword with its heat score and badge — `热`, `新` |
| 🕒 **Run info** | how the row was found (search, link, creator, collection, list, favorites, related), search keyword, scrape date |

Every field, with an example, is listed in the **Output** section below.

Fields marked **detail** in the Output tab (coins, shares, parts, resolution, rights, short link, honors…) are filled when **Full video details** is on, and always for the videos you paste in **Video URLs or IDs**.

### ✅ Why use Bilibili Videos Scraper?

- 🚀 **Fast**: about 100 videos of a search in 15 seconds.
- 🧩 **Everything in one Actor**: videos, creators, comments and replies, danmaku and their summary, subtitles, chapters, music, creator posts, public favorites, collections, rankings and hot searches.
- 🏆 **Every Top 100**: the all-site ranking (all, newcomers or original videos) and the 14 categories of the ranking page, Popular (热门), Weekly must-watch (每周必看, any issue) and All-time must-watch (入站必刷).
- 📅 **Past the 1,000 results of a search**: when Max videos is above 1,000 (or 0), with or without dates, the Actor splits the search into date windows to go past the site's cap. The order is then the windows' (the most recent window first).
- 🔔 **Monitoring built in**: tick **Only new videos**, schedule the Actor, and each run returns (and charges) only what it has never delivered before.
- 🔒 **Privacy option**: **Anonymize commenters and danmaku senders** replaces commenters by a stable hash.
- 🔌 API, scheduling, monitoring, integrations (Make, Zapier, n8n, Google Sheets…) and JSON/CSV/Excel export via the Apify platform.

### 🚀 How to scrape Bilibili

1. Create a free Apify account.
2. Open **Bilibili Videos Scraper** and type a **Search keyword** (e.g. `原神`).
3. Or paste **Video URLs or IDs**, **Creator URLs or UIDs** or **Collection / series URLs**, or pick **Trending lists**.
4. Set **Max videos** (100 by default, 0 = no limit), tick the extra data you want (comments, danmaku, profiles…), then click **Start**.
5. Download the dataset in JSON, CSV, Excel or via API.

### 💰 How much does it cost to scrape Bilibili?

This Actor uses **pay per event** pricing: you pay for the rows saved, each kind of row at its own price, plus a small fee per run start. The prices are on the **Pricing** tab of this page. Every extra (comments, danmaku, profiles, posts, details, subtitles, chapters and music, danmaku summary, contacts) is off by default: nothing is charged for it unless you tick it.

| What you pay for | Event |
| --- | --- |
| Video row: a search result, a pasted video, a creator's upload, a video of a collection, a list or a ranking, a favorite, a related video | `video` |
| Creator profile row: a pasted creator, a creator found by a search, or the author of a video with **Creator profiles** | `profile` |
| Comment or reply, with **Comments** / **Comment replies** | `comment` |
| Danmaku row, with **Danmaku** | `danmaku` |
| Creator post, with **Creator posts** | `post` |
| Hot search keyword, with **Hot searches** in **Trending lists** | `keyword` |
| The video's own page read for a video found by a search or a list, with **Full video details** (included for the videos you paste) | `video-details` |
| Chapters and music added to a video, with **Chapters and background music** (only when the video has some) | `chapters-music` |
| Subtitles added to a video, with **Subtitles** (only when the video has some) | `subtitles` |
| Danmaku summary added to a video, with **Danmaku summary** (only when the video has at least one danmaku) | `danmaku-summary` |
| Contacts added to a profile, with **Contacts from creator bios** (only when at least one is found) | `bio-contact` |
| A row dropped by one of the Actor's own filters (dates, views, likes, followers, excluded words): charged for each video a filter drops, not for the ones it keeps | `filter-check` |
| Run start | `apify-actor-start` |

A row you keep pays its own price; a row a filter drops pays only the check, which costs less: filtering never costs more than taking everything. Platform usage (compute, proxy) is included in the price.

### ⚙️ Input

A search with the full video page:

```json
{
    "query": "原神",
    "maxItems": 100,
    "includeVideoDetails": true
}
```

Several searches, newest first, only last week's videos with 1,000 views or more, only the ones not delivered before:

```json
{
    "searchQueries": ["原神", "minecraft"],
    "sortBy": "pubdate",
    "maxItemsPerQuery": 50,
    "postedAfter": "7 days",
    "minViews": 1000,
    "onlyNew": true,
    "stateKey": "genshin-daily"
}
```

Videos with their comments, replies and danmaku, commenters anonymized:

```json
{
    "videoUrls": ["https://www.bilibili.com/video/BV1pTap6UE1w", "BV18fhb65EGs"],
    "includeComments": true,
    "includeReplies": true,
    "includeDanmaku": true,
    "maxDanmakuPerVideo": 500,
    "includeDanmakuSummary": true,
    "anonymizeUsers": true
}
```

Creators with their uploads, posts and bio contacts:

```json
{
    "profileUrls": ["https://space.bilibili.com/546195", "401742377"],
    "maxVideosPerProfile": 50,
    "includeCreatorPosts": true,
    "maxPostsPerProfile": 20,
    "includeBioContacts": true
}
```

The Gaming and Knowledge Top 100 and the hot searches:

```json
{
    "trending": ["ranking", "hotSearch"],
    "rankingCategories": ["1008", "1010"],
    "maxItems": 300
}
```

| Field | Notes |
| --- | --- |
| `query`, `searchQueries` | Keywords, as typed in the site's search box (`原神`, `minecraft`). `searchQueries` adds more keywords, one search each; a Bilibili search page URL is accepted too (its keyword, sort, duration and category are used). Up to 1,000 results per search on the site. |
| `searchType` | `video` (default) or `creator`: one profile row per creator found (UP主), with followers, video count, level and verification. |
| `creatorSort` | Order of a creator search: `default`, `fans` or `level`. |
| `sortBy` | Order of a video search: `totalrank` (default), `click` (most viewed), `pubdate` (newest), `dm` (most danmaku), `stow` (most favorited), `scores` (most commented). |
| `duration`, `category` | The site's own search filters: video length, and one zone. |
| `videoUrls` | Videos to read directly: `https://www.bilibili.com/video/BV1pTap6UE1w`, bare ids (`BV1pTap6UE1w`, `av170001`), b23.tv short links, mobile links. Always with the full video page. |
| `profileUrls`, `maxVideosPerProfile` | Creators: `https://space.bilibili.com/546195` or a bare UID (`546195`). One profile row each; Max videos per creator also reads their uploads, newest first (0 = profile row only). |
| `collectionUrls` | A creator's collections (合集) and series (系列): `https://space.bilibili.com/546195/lists/1903592?type=season`. Every video of each, in the creator's order. |
| `trending` | Bilibili's own lists: `popular` (Popular, 热门, about 600 videos), `ranking` (Top 100, 排行榜), `weekly` (Weekly must-watch, 每周必看), `precious` (All-time must-watch, 入站必刷), `hotSearch` (hot searches, 热搜, one keyword row each). |
| `rankingCategories` | The categories of the ranking page, one Top 100 each: `1005` Animation, `1008` Gaming, `1007` Kichiku / remix, `1003` Music, `1004` Dance, `1001` Film & TV, `1002` Entertainment, `1010` Knowledge, `1012` Tech, `1020` Food, `1013` Cars, `1014` Fashion, `1018` Sports, `1024` Animals. Empty = the all-site Top 100. |
| `rankingType` | Which all-site Top 100: `all`, `rookie` (newcomers) or `origin` (original videos). A category's Top 100 has no types. |
| `weeklyIssues` | Issues of Weekly must-watch to read: `290` or `280-290`. Empty = the latest issue. Needs Weekly must-watch in **Trending lists**. |
| `maxItems` | Videos (and creators of a creator search) for the whole run, `0` = no limit. Profile rows of pasted creators and of video authors, posts, comments, danmaku and keyword rows are not counted: they have their own caps. Related videos are counted. |
| `maxItemsPerQuery` | Cap for EACH search, creator or list, so that the first one cannot use up the whole budget. `0` = no per-search cap. |
| `cookie` | Optional: your `SESSDATA` cookie (or the whole cookie header) from a logged-in bilibili.com tab, for the full comment list, the IP region of comments and subtitles. Stored encrypted, never written to the results or the log. |
| `includeVideoDetails` | Read each video's page: coins, shares, exact length, parts, resolution, badges, original or repost, rights, tags, subtitle languages. |
| `includeChaptersAndMusic` | Chapters (start, end, title) and the background music Bilibili recognized (title, artist, link), when the video has them. |
| `includeAuthorProfile`, `includeBioContacts` | One profile row per creator met; contacts from the bio and the live-room notice added to profile rows. |
| `includeCreatorPosts`, `maxPostsPerProfile` | Posts (动态) of each pasted creator, newest first, with their date and counts: 1 extra page per post (2 for an article, 专栏). 0 = all the feed serves, up to 10,000 posts. |
| `includeFavorites`, `maxFavoritesPerProfile` | Videos of each pasted creator's public favorite folders (收藏夹), as video rows naming the folder. 0 = all the site serves. |
| `commentSort`, `includeComments`, `maxCommentsPerVideo` | Top comments of each video, in the order `hot` (default) or `newest`. Without a cookie, about 6 to 8 a video; with your cookie, the whole list up to Max comments per video (0 = all). |
| `includeReplies`, `maxRepliesPerComment` | Replies under each top comment, as comment rows, 20 a page in the site's order. No cookie needed. 0 = all. |
| `includeDanmaku`, `maxDanmakuPerVideo` | Danmaku rows of each video, the first N by second of the video. 0 = all the site's file holds. No cookie needed. |
| `includeDanmakuSummary` | A summary of ALL the danmaku of the file, whatever Max danmaku per video says: count, unique senders, busiest minute, per-minute curve (the first 1,440 minutes), the 20 most said terms, oldest and newest send time. |
| `includeSubtitles` | CC and AI subtitles: languages, timed lines and full text. Needs your cookie (skipped with a message without it). |
| `includeRelatedVideos` | The videos Bilibili recommends next to each video you get, as video rows naming that video. They take places of Max videos as the run goes: when Max videos is smaller than the search, the recommended videos of the first videos can take places before the next pages of the search are read. To get the whole search first, set Max videos above the size of the search or leave this option unticked. They are charged as videos. |
| `postedAfter`, `postedBefore` | Publication date range: `2026-09-01`, or a period before now (`7 days`, `2 weeks`, `1 month`, `24 hours`). Applies to videos and creator posts. |
| `excludeKeywords` | Drop the videos whose title, the creators whose name and the posts whose text contain one of these words (case and accents ignored). |
| `minViews`, `minLikes` | Drop the videos with fewer views or likes. `0` = no minimum. The videos of a collection, a series or a favorites folder have no likes on their card: without `includeVideoDetails`, `minLikes` lets them through; with it, they are judged on their page. |
| `minFollowers`, `maxFollowers` | Creator rows: keep the creators within this follower range. `0` = no bound. |
| `anonymizeUsers` | Commenters become a stable hash of their UID; UID, avatar, page and the comment pictures whose address carries the UID are left out. Danmaku rows lose the sender's hash. Creators are kept. |
| `onlyNew`, `stateKey`, `resetState` | Monitoring: only the videos never delivered under this memory key (`genshin-daily`); `resetState` forgets the memory. |
| Advanced | `proxyConfiguration` (Apify proxy by default, included in the price; the residential proxy is not available), `maxConcurrency`, `maxRequestsPerMinute`, `minRequestIntervalMs`, `maxRequestRetries`, `debugLog`. |

### 📦 Output

A video read with **Chapters and background music** and **Danmaku summary** (a real row, shortened: the empty fields, 3 of the 4 parts, 17 of the 20 terms and the end of the description are left out):

```json
{
    "recordType": "video",
    "id": "BV1pTap6UE1w",
    "url": "https://www.bilibili.com/video/BV1pTap6UE1w",
    "bvid": "BV1pTap6UE1w",
    "aid": 117353656356865,
    "cid": 42306046424,
    "title": "《原神》过场动画-「遗赠」",
    "description": "唯有直面死亡才能理解其中的感受，死神也不例外。",
    "coverUrl": "https://i1.hdslb.com/bfs/archive/2063b8933f7ab4ad868ceda83d509af4bb92f996.jpg",
    "durationSec": 450,
    "durationText": "7:30",
    "publishedAt": "2026-10-10T04:00:00.000Z",
    "categoryId": 172,
    "categoryName": "手机游戏",
    "tags": ["死之执政", "圣土化", "过场动画", "米哈游", "miHoYo", "原神"],
    "viewCount": 719916,
    "danmakuCount": 1355,
    "commentCount": 7299,
    "likeCount": 85446,
    "coinCount": 16633,
    "favoriteCount": 11092,
    "shareCount": 2513,
    "engagementRate": 0.1442,
    "highestRank": 39,
    "honors": ["全站排行榜最高第39名", "热门收录"],
    "isOriginal": true,
    "isPaid": false,
    "isCollab": false,
    "partCount": 4,
    "parts": [{ "cid": 42306046424, "page": 1, "title": "《原神》过场动画-「遗赠」", "durationSec": 108, "width": 2560, "height": 1440 }],
    "width": 2560,
    "height": 1440,
    "danmakuSummary": {
        "count": 600,
        "uniqueSenders": 454,
        "peakMinute": 0,
        "perMinute": [371, 229],
        "topWords": [
            { "word": "异象", "count": 29 },
            { "word": "娜瓦", "count": 28 },
            { "word": "若娜", "count": 26 }
        ],
        "firstSentAt": "2026-10-10T04:00:44.000Z",
        "lastSentAt": "2026-10-16T11:08:36.000Z"
    },
    "parentCategoryId": 4,
    "parentCategoryName": "游戏",
    "categoryV2Id": 2064,
    "shortUrl": "https://b23.tv/BV1pTap6UE1w",
    "firstFrameUrl": "https://i0.hdslb.com/bfs/storyff/_0000094vdfj8gsar424alq2xh7r7e8b_firsti.jpg",
    "dynamicText": "#原神# #过场动画# #遗赠#\n《原神》过场动画-「遗赠」",
    "rights": {
        "noReprint": true,
        "download": true,
        "interactive": false,
        "panorama360": false,
        "paid": false,
        "chargeOnly": false,
        "isStory": false
    },
    "authorId": 401742377,
    "authorName": "原神",
    "authorAvatarUrl": "https://i2.hdslb.com/bfs/face/e63bacc8b9e68f59f401cc41728a99262ba661a3.jpg",
    "authorUrl": "https://space.bilibili.com/401742377",
    "source": "video",
    "scrapedAt": "2026-10-16T13:49:20.978Z"
}
```

You can download the dataset in various formats such as JSON, HTML, CSV or Excel. Filter on `recordType` to split videos, comments, danmaku, profiles, posts and hot search keywords.

#### All 125 fields

Every row has all the columns; a column that does not apply to its kind of row is `null` (or an empty list).

| Fields | What you get |
| --- | --- |
| `recordType`, `id`, `url` | **Every row**: `video`, `comment`, `danmaku`, `profile`, `post` or `keyword`; the site's id of the row (BV id, comment id, danmaku id, UID, post id or the keyword); its public page |
| `bvid`, `aid`, `cid` | **Video**: `BV1pTap6UE1w`, `117353656356865`, id of the first part (detail; danmaku rows: the part they belong to) |
| `title`, `description`, `coverUrl` | title, description (简介), cover image (post rows: first image) |
| `durationSec`, `durationText`, `publishedAt` | `450`, `7:30`, `2026-10-10T04:00:00.000Z` (what the date filters read; comments and posts: their own date) |
| `categoryId`, `categoryName`, `tags` | zone `172` `手机游戏`, tags |
| `viewCount`, `danmakuCount`, `commentCount`, `likeCount`, `coinCount`, `favoriteCount`, `shareCount` | **Stats**: views, danmaku, comments, likes, coins and shares (detail), favorites; comment and post rows: their own likes, and the post's comments, coins, favorites, shares |
| `engagementRate` | (likes + favorites + comments) ÷ views, the same whichever way the video was found: `0.1442` |
| `currentRank`, `highestRank`, `honors` | all-site rank now and best ever, badges such as `热门收录` (detail) |
| `isOriginal`, `isPaid`, `isCollab` | original upload or repost (detail), paid or charge-only, co-created |
| `partCount`, `parts`, `width`, `height` | **Full video page**: parts (分P) with cid, title, length and resolution; `2560` × `1440` |
| `subtitleLanguages`, `subtitles`, `transcript` | subtitle tracks listed on the page (detail); subtitles with timed lines and the full text of the first track (your cookie) |
| `danmakuSummary` | **Danmaku summary**: count, unique senders, busiest minute, danmaku per minute, the most said terms, first and last send time |
| `parentCategoryId`, `parentCategoryName`, `categoryV2Id`, `categoryV2Name` | main zone (`4` `游戏`), category of the site's new zone system (detail) |
| `recommendReason`, `publishLocation` | Popular / Weekly must-watch badge (`百万播放`), region the video was published from when Bilibili shows it |
| `shortUrl`, `firstFrameUrl`, `dynamicText`, `creatorNotice`, `collaborators`, `rights` | b23.tv link, first frame image, text posted with the upload, notice under the video, co-creators, video flags (detail) |
| `seasonId`, `seasonTitle` | collection (合集) the video belongs to |
| `chapters`, `musicId`, `musicTitle`, `musicArtist`, `musicUrl` | **Chapters and music**: chapters (start, end, title), background music |
| `favoriteFolder`, `relatedTo` | public favorite folder the video was found in, BV id of the video it was recommended next to |
| `authorId`, `authorName`, `authorAvatarUrl`, `authorUrl`, `authorLevel`, `authorVip` | **Creator or commenter**: UID, name, avatar, page; level 0-6 and VIP of a commenter |
| `commentId`, `parentCommentId`, `rootCommentId`, `text`, `replyCount`, `ipLocation` | **Comments**: comment id, the comment replied to and the top of the thread (replies), text (also danmaku and post text), replies, IP region (your cookie) |
| `isPinned`, `likedByAuthor`, `repliedByAuthor`, `pictures`, `commentOrder` | pinned, liked or answered by the creator, attached pictures, order it was read in (`hot`, `newest`, `replies`) |
| `progressSec`, `sentAt`, `mode`, `fontSize`, `color`, `senderHash`, `weight`, `pool` | **Danmaku**: second of the video, send time, mode (scrolling, bottom, top…), size, `#ffffff`, the site's sender hash, display weight, pool |
| `emotes` | emotes (表情) of a comment: code and image |
| `uid`, `name`, `avatarUrl`, `bio`, `gender`, `level` | **Creator profile**: UID, name, avatar, signature, gender as shown, level |
| `followerCount`, `followingCount`, `videoCount`, `postCount`, `collectionCount`, `articleCount`, `totalLikes` | followers, following, uploads, posts, collections, articles (专栏), likes received |
| `verified`, `verifyType`, `verifyTitle`, `vipType`, `isSeniorMember` | verification (personal or organization) and its text, VIP, senior member (硬核会员) |
| `liveRoomUrl`, `isLive`, `liveTitle`, `liveCoverUrl` | live room link, live now, title and cover |
| `verifyDescription`, `bannerUrl` | longer verification text, profile banner |
| `contactPhones`, `profileTags`, `contactEmails`, `contactUrls`, `socialHandles` | **Contacts from bios**: phones, profile tags, e-mails, links, handles by network (WeChat, Weibo, QQ, Douyin, RedNote, YouTube, X, Instagram, TikTok) |
| `school`, `profession`, `birthday` | as shown on the profile |
| `keyword`, `heatScore`, `label` | **Hot search**: the keyword, its heat score, its badge (`热`, `独家`, `新`, `梗`) |
| `source`, `searchQuery`, `listName`, `rank`, `points` | **Run info**: how the row was found (`search`, `video`, `creator`, `collection`, `favorites`, `related`…), the keyword, the list or collection, position (1 = first), Top 100 score when shown |
| `scrapedAt` | when the row was read, ISO 8601 UTC |

### 💡 Tips

#### How to get more results

A search gives at most 1,000 results on Bilibili. Set Max videos above 1,000 (or `0`) and the Actor splits the search into date windows to go past that cap, with or without `postedAfter` / `postedBefore`; the results then come window by window, the most recent window first, instead of in the site's order. A creator's uploads (`maxVideosPerProfile`) are the full list, not a name search. Set `maxItems` to `0` to remove the run's cap.

#### How to reduce costs

The price is per row, so the levers are `maxItems`, `maxItemsPerQuery`, the caps per video (`maxCommentsPerVideo`, `maxDanmakuPerVideo`, `maxRepliesPerComment`), the extras you tick, the filters (a row a filter drops costs only the check) and `onlyNew` for recurring runs (you never pay twice for the same video). **Danmaku summary** gives the shape of all the danmaku of a video without paying a row per danmaku.

#### Several searches in one run

Fill `searchQueries` (max 100 searches per run, on top of **Search keyword**). A video found by several searches is saved — and charged — once. Set `maxItemsPerQuery` to give every search, creator and list its own cap: without it the first ones can use up the whole `maxItems` budget.

#### Comments, subtitles and your cookie

Without a cookie, Bilibili shows a visitor about 3 top comments per sort order: the Actor merges the hot and newest lists, the pinned comment first, so expect about 6 to 8 top comments a video, plus their replies (**Comment replies**, no cookie needed). To get more, paste your `SESSDATA` cookie in **Bilibili cookie** (stored encrypted, never written to the results or the log): with your cookie the Actor reads the comment list in the order you chose, the IP region of each comment and the subtitles.

#### Monitoring: only the new videos

Tick **Only new videos** (`onlyNew`) and schedule the Actor. The first run returns everything; each later run skips the videos already delivered: they are not saved and not charged. The memory lives in a named key-value store of your account (`bilibili-videos-scraper-seen`, up to 150,000 videos per key) and is only updated with videos that really reached the dataset, so a failed run never hides anything. Give each schedule its own `stateKey` (two schedules sharing a key would hide each other's videos), and tick `resetState` once to start over. Sort the searches by newest (`pubdate`): a search sorted that way, like a creator's uploads, stops once it meets a long run of videos you already have. Only videos, creator rows and posts are remembered; comments, danmaku, hot search keywords and the profiles of video authors are not (a run that reads them again returns them again).

#### Filter by publication date

`postedAfter` and `postedBefore` take a date (`2026-09-01`, the whole day is included) or a period before now (`7 days`, `2 weeks`, `1 month`; via the API also `24 hours` or a full ISO date-time). A search sends the range to Bilibili; lists, creators and posts are filtered by the Actor, and a creator's uploads and posts stop being read at the first page that is entirely too old. A video without a publication date is dropped as soon as a date bound is set. Filtered-out rows are not saved and do not count in `maxItems`; the run summary tells how many were filtered.

### 🔌 Integrations and API

Call the Actor via the Apify API, the JavaScript or Python clients, or connect it with integrations and webhooks (Make, Zapier, n8n, Google Sheets, Slack, Airtable…). The dataset can be fetched as JSON or CSV from any tool.

### 🤖 Use with AI agents (MCP)

AI agents (Claude, ChatGPT, Cursor…) can find and run this Actor through the [Apify MCP server](https://mcp.apify.com), billed to their Apify account like any run. It returns one row per Bilibili video (and, on request, per comment, danmaku, creator, post or hot search keyword). Actor id: `nice_dev/bilibili-videos-scraper`; MCP server with this Actor only: `https://mcp.apify.com/?tools=fetch-actor-details,nice_dev/bilibili-videos-scraper`.

Smallest input, for a cheap first call:

```json
{
    "query": "原神",
    "maxItems": 10
}
```

Key output fields: `recordType`, `url`, `title`, `viewCount`, `likeCount`, `publishedAt`, `authorName` and `engagementRate`.

Cost: pay per event, one price per kind of row and per extra (all extras off by default), plus a small fee per run start: see the pricing section above. Cap each call with `maxItems` and, through the API, with the run option `maxTotalChargeUsd`.

### ❓ FAQ

#### Is it legal to scrape Bilibili?

The Actor only reads what Bilibili shows publicly to any anonymous visitor; with your optional cookie, it reads what your own account sees. Results can contain personal data (names and UIDs of creators and commenters, contacts written in public bios), which is protected by GDPR and other laws: do not store it without a legitimate reason. **Anonymize commenters and danmaku senders** replaces commenters by a hash — a pseudonym, not a proof of anonymity. You are responsible for using the data in compliance with Bilibili's Terms of Use and applicable law. This Actor is not affiliated with Bilibili.

#### Does it need a login or a proxy?

No login: videos, creators, rankings, replies and danmaku are read as a visitor. Your cookie is only needed for the full comment list, the IP region of comments and subtitles. The proxy is included in the price: leave the default setting (the residential proxy is not available). A request the site turns away is retried at once on a new proxy session, up to 10 times on top of the retries (without a proxy, after a pause of 5 seconds, doubled at each retry up to 150 seconds).

#### Is the data safe to open in Excel or to show on a web page?

Titles, descriptions, comments, danmaku and bios are the users' own words, copied as they are. A text can begin with `-`, `+`, `=` or `@`: Excel and Google Sheets may read such a cell of a CSV file as a formula or as a number. The Actor leaves the text as it is, so that the JSON and the API give the real value: when you open a CSV, import these columns as text. On a web page, escape every field like any text written by a stranger.

#### Known limitations

- Without your cookie: about 6 to 8 top comments a video (plus their replies), `ipLocation` always empty, no subtitles (skipped with a message), and `subtitleLanguages` empty on most videos.
- A search stops at 1,000 results on Bilibili; with Max videos above 1,000 (or 0) the Actor goes past it by splitting the search into date windows (the order is then the windows', the most recent first).
- Danmaku come from the first part (分P) of a video. Bilibili's file holds the danmaku currently shown, so a busy video gives fewer than its counter says (the example above: 600 in the file for a counter of 1,355).
- Videos of a collection, a series or a favorite folder come as list cards: no author name for a collection's videos and no `engagementRate` (their list gives no likes or comments) unless **Full video details** reads their page.
- Related videos are list cards too: no details, comments, danmaku or profile are read for them.
- Private favorite folders are not visible.
- `onlyNew` remembers video ids, not their content: a video whose views grew is not returned again.
- Two runs sharing the same `stateKey` at the same time may both return the same new video.

**A run that reaches its timeout** stops itself about 45 seconds before it: no new page is asked, what it read is saved and, with `onlyNew`, remembered, and the run ends *Succeeded* with "Stopped before the run's timeout". Resurrect it to go on from there, or give the next run a longer timeout (Run options).

**A run the platform stops without warning**

- Resurrect it: it goes on from where it stood at most a minute before the stop. What it had read since is read again, and the rows already saved are skipped: none is delivered or charged twice, and `maxItems` still counts them.
- With `onlyNew`, the memory is saved after each write (at most once every 2 seconds): resurrect the stopped run and the videos it had saved meanwhile join the memory; leave it stopped for good, and the next run may return the videos of its last 2 seconds once more.

#### Something doesn't work?

The last line of the log counts the videos saved, filtered out and no longer on Bilibili (removed, or a video id that does not exist), and the requests that failed after every retry. Those requests and the removed videos are listed, with the reason, in the `FAILED_REQUESTS` record of the run's key-value store. A run that saved nothing and had failed requests fails, and its last message gives the cause.

If Bilibili changes its pages, you are told instead of paying for blank rows. A results page that counts videos but gives none the Actor can read is an error (listed in `FAILED_REQUESTS`), never a quiet "No videos found". Each source of the run (a search, a ranking, a creator's uploads, the recommended videos…) is checked on its own first 20 rows: if they all lack their title, publication date, view count, author id or author name — or, when the video's page is read, the id of its first part, its coins, shares or number of parts; for creators, their name or follower count — the run saves nothing more, stops and fails, and its last message names the missing field and the source: at most those first rows are charged. A video that `postedAfter` / `postedBefore` drops because it has no date at all counts among those 20. A run of fewer videos (a scheduled `onlyNew` run that finds a few new ones, a small **Max videos**) is checked at its end, from 5 videos: its videos are already saved, and the run fails with the missing field instead of ending green.

### 🛟 Support

Open an issue in the **Issues** tab with a link to your run: the run log and the `FAILED_REQUESTS` record of the key-value store show exactly which requests failed and why.

# Actor input Schema

## `query` (type: `string`):

Bilibili search, as in the site's search box (Chinese or Latin: `原神`, `minecraft`). One result = one video (or one creator with **Search for** = Creators). Up to 1,000 results per search on the site: when **Max videos** is above 1,000 (or 0), the Actor splits the search into date windows to go past it, with or without dates (the order is then the windows', the most recent first).

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

Several keywords in one run: one search per keyword. Added to **Search keyword**; videos found by several searches are saved once. A search page URL (`search.bilibili.com/all?keyword=…&order=…`) is accepted too: its keyword, sort, duration and category are used.

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

Videos (default) or creators (UP主: one profile row per creator, with followers, video count, level and verification).

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

Videos to read directly: `bilibili.com/video/BV…` links, bare `BV…` or `av…` ids, `b23.tv` short links, mobile links. One video row each (always with the full video page data).

## `profileUrls` (type: `array`):

Creators (UP主) to read: `space.bilibili.com/<uid>` links or bare numeric UIDs. One profile row each; set **Max videos per creator** to also get their uploads.

## `collectionUrls` (type: `array`):

A creator's collections (合集) and series (系列): `space.bilibili.com/<uid>/lists/<id>?type=season` or `?type=series` links, or `space.bilibili.com/<uid>/channel/collectiondetail?sid=<id>`. Every video of each, in the creator's order.

## `maxVideosPerProfile` (type: `integer`):

Uploads to read for each creator of **Creator URLs or UIDs**, newest first (the full list, not a name search). 0 = profile row only.

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

Bilibili's own lists, read as the site's pages show them now: Popular (热门, about 600 videos), Top 100 ranking (排行榜, the all-site Top 100 or one per category below, as on the ranking page), Weekly must-watch (每周必看, latest issue), All-time must-watch (入站必刷) and Hot searches (热搜, one keyword row each). Each video keeps its `rank`.

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

Categories of the Top 100 ranking, as on the site's ranking page (one Top 100 each, the videos it shows now). Empty = the all-site Top 100.

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

Which all-site Top 100 ranking (排行榜) to read: all videos, newcomers' videos (新人) or original videos only (原创). Only the all-site Top 100 has these types: a category's Top 100 is the same whatever you choose.

## `weeklyIssues` (type: `array`):

Issue numbers of Weekly must-watch (每周必看) to read, e.g. `290` or `280-290`. Empty = the latest issue only. Needs **Weekly must-watch** in **Trending lists**.

## `creatorSort` (type: `string`):

Order of the creators found by a search with **Search for** = Creators, as on the site.

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

Maximum number of videos (or creators) to save for the whole run (after deduplication and filters). Creators read from **Creator URLs or UIDs**, profiles of video authors, comments, danmaku and keyword rows are not counted: they have their own caps below. 0 = no limit.

## `maxItemsPerQuery` (type: `integer`):

Cap for EACH search, creator or trending list, so that the first one cannot use up the whole **Max videos** budget. 0 = no per-search cap.

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

Order of the search results, as on the site.

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

Video length filter of the site's search.

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

Search only one category (the site's zone filter).

## `cookie` (type: `string`):

Your `SESSDATA` cookie (or the whole cookie header) from a logged-in bilibili.com tab. Stored encrypted, used only for comments and subtitles, never written to the results or the log.

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

Read each video page: coins, shares, exact duration, parts (分P) with their cid, resolution, honors (weekly / ranking badges), original or repost, rights, tags with ids, subtitle languages. Always on for **Video URLs**.

## `includeChaptersAndMusic` (type: `boolean`):

Adds to each video row its chapters (start, end, title) and the background music Bilibili recognized (title, artist, link), when the video has them.

## `includeAuthorProfile` (type: `boolean`):

One profile row per creator met (followers, following, uploads, total likes, level, verification, VIP, live room, bio).

## `includeBioContacts` (type: `boolean`):

Adds to profile rows the e-mails, phone numbers, links and social handles (WeChat, Weibo, QQ, Douyin, RedNote, YouTube…) written in the creator's bio and live-room announcement. Needs **Creator profiles** or creator rows.

## `includeCreatorPosts` (type: `boolean`):

Posts (动态 / opus) of each creator of **Creator URLs or UIDs**, newest first: text, image, date, likes, comments, shares, favorites. One post row each; the date and the counts come from the post's own page (1 extra page per post).

## `maxPostsPerProfile` (type: `integer`):

Posts read per creator, newest first (1 extra page each). 0 = all the feed serves, up to 10 000 posts.

## `includeFavorites` (type: `boolean`):

Videos saved in the public favorite folders (收藏夹) of each creator of **Creator URLs or UIDs**, as video rows with `favoriteFolder`. Private folders are not visible.

## `maxFavoritesPerProfile` (type: `integer`):

Favorite videos per creator, all folders together. 0 = all the site serves.

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

Comment rows for each video: the top-level comments with text, likes, number of replies, date, author level and VIP. Without a cookie Bilibili shows a visitor about 3 top comments per sort order: the hot and newest lists are merged, the pinned comment first, so expect about 6 to 8 a video. With your cookie the full list is read. The IP region (IP属地) is given only with your cookie.

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

Top-level comments per video. 0 = all the site serves. Without a cookie a video gives only about 6 to 8, whatever you set.

## `commentSort` (type: `string`):

Order of the comments. With your cookie: the full list in this order. Without: the few top comments of the hot and newest lists are merged, this one first.

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

Replies under each top comment, as comment rows with `parentCommentId` and `rootCommentId`, after the top comments. Open to visitors: no cookie needed. Each reply is a comment row.

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

Replies read under each top comment (20 a page, in the site's order). 0 = all the site serves. Only used with Comment replies.

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

Bullet comments (弹幕) of each video, one row each: text, second of the video, send time, color, mode, pool, weight and the sender's hash (left out with **Anonymize commenters and danmaku senders**). First part (分P) of a video only. Open to visitors: no cookie needed.

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

Danmaku rows per video: the first N in the order of the video (by second). 0 = all the site's file holds. That file holds the danmaku currently shown, so a very busy video gives fewer than its danmaku counter says. Only used with Danmaku.

## `includeDanmakuSummary` (type: `boolean`):

Adds to each video row a summary of all the danmaku the site's file holds, whatever **Max danmaku per video** says: count, unique senders, busiest minute, per-minute curve (the first 1,440 minutes), the 20 most said terms and the oldest / newest send time. No row per danmaku needed. First part (分P) of a video only; a video without danmaku gets `count` 0.

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

CC and AI subtitles of each video: languages, timed lines and full text. Bilibili shows them to logged-in viewers only: skipped with a message without **Bilibili cookie**.

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

Also save the videos Bilibili recommends next to each video you get (up to 40 each) as video rows: `source` `related`, `relatedTo` = the BV id of the video they are recommended next to. They are videos like any other: they count in **Max videos** and take its places as the run goes (when Max videos is smaller than the search, the recommended videos of the first videos can take places before the next pages of the search are read: to get the whole search first, set Max videos above the size of the search or leave this option unticked), they are charged as videos, a video already in the results is not saved again, and the filters (views, likes, dates, excluded words) apply. They come as the cards of a list: video details, chapters, subtitles, danmaku, comments and author profile are not read for them, and a recommended video has no recommended videos of its own.

## `postedAfter` (type: `string`):

Only videos and creator posts published on or after this date: `2026-09-01` (a date without a time is read at Beijing time, UTC+8, while the publication date in the results is in UTC), or a period before now such as `7 days`, `2 weeks`, `1 month` (API: `24 hours` and full ISO date-times work too). Searches send it to the site (date window), lists and creators are filtered by the Actor; a creator's posts stop being read at the first page whose posts are all older.

## `postedBefore` (type: `string`):

Only videos and creator posts published on or before this date (same formats as **Posted after**: a date without a time is read at Beijing time, UTC+8, while the publication date in the results is in UTC).

## `excludeKeywords` (type: `array`):

Drop the videos whose title, the creators whose name and the posts whose text contain one of these words (case and accents ignored).

## `minViews` (type: `integer`):

Drop the videos with fewer views (播放). 0 = no minimum.

## `minLikes` (type: `integer`):

Drop the videos with fewer likes. 0 = no minimum. The videos of a collection, a series or a favorites folder have no likes on their card: without Full video details, this filter lets them through; with it, they are judged on their page.

## `minFollowers` (type: `integer`):

Creator rows (creator search, creator profiles): drop the creators with fewer followers. 0 = no minimum.

## `maxFollowers` (type: `integer`):

Creator rows: drop the creators with more followers (to find small and mid-size creators). 0 = no maximum.

## `anonymizeUsers` (type: `boolean`):

Replace the name, UID, avatar and page link of commenters with a stable anonymous hash (same person = same hash). Comment pictures whose address carries the UID are left out. Danmaku rows leave out the sender's hash (the danmaku summary still counts the senders). Video creators are kept.

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

Skip the videos that a previous run (same **Memory key**) already delivered: they are not saved and not charged. First run = everything is new.

## `stateKey` (type: `string`):

Name of the memory used by **Only new videos**. Give each schedule / task its own key (e.g. `genshin-daily`) so that they do not share their memory. Letters, digits, `-` and `_`.

## `resetState` (type: `boolean`):

Forget everything remembered under this **Memory key** before the run: this run returns (and charges) every video again. Untick it afterwards.

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

Apify Proxy or your own proxies. Keep the default: it is included in the price. The residential Apify proxy is not available in this Actor.

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

Maximum number of requests processed in parallel.

## `maxRequestsPerMinute` (type: `integer`):

Most requests to the site in any 60 seconds, all of them counted: results pages, video pages and the extra page read for a video. A budget, not an even pace: up to this many can leave at once when the minute starts (spread them with the minimum delay below). Lower it if the site answers HTTP 429 / 403 in the log.

## `minRequestIntervalMs` (type: `integer`):

Smallest gap between two requests, in milliseconds. Unlike the per-minute rate, this spreads the requests evenly instead of letting them go out in a burst. 0 = no gap.

## `maxRequestRetries` (type: `integer`):

Retries per request before it is marked as failed. Behind a proxy, a request the site turns away is also retried on a new proxy session up to 10 times without using up these retries.

## `debugLog` (type: `boolean`):

Include debug messages in the run log.

## Actor input object example

```json
{
  "query": "原神",
  "searchQueries": [],
  "searchType": "video",
  "videoUrls": [],
  "profileUrls": [],
  "collectionUrls": [],
  "maxVideosPerProfile": 0,
  "trending": [],
  "rankingCategories": [],
  "rankingType": "all",
  "weeklyIssues": [],
  "creatorSort": "default",
  "maxItems": 100,
  "maxItemsPerQuery": 0,
  "sortBy": "totalrank",
  "duration": "all",
  "category": "all",
  "includeVideoDetails": false,
  "includeChaptersAndMusic": false,
  "includeAuthorProfile": false,
  "includeBioContacts": false,
  "includeCreatorPosts": false,
  "maxPostsPerProfile": 20,
  "includeFavorites": false,
  "maxFavoritesPerProfile": 100,
  "includeComments": false,
  "maxCommentsPerVideo": 20,
  "commentSort": "hot",
  "includeReplies": false,
  "maxRepliesPerComment": 10,
  "includeDanmaku": false,
  "maxDanmakuPerVideo": 200,
  "includeDanmakuSummary": false,
  "includeSubtitles": false,
  "includeRelatedVideos": false,
  "excludeKeywords": [],
  "minViews": 0,
  "minLikes": 0,
  "minFollowers": 0,
  "maxFollowers": 0,
  "anonymizeUsers": false,
  "onlyNew": false,
  "stateKey": "default",
  "resetState": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "maxConcurrency": 8,
  "maxRequestsPerMinute": 120,
  "minRequestIntervalMs": 0,
  "maxRequestRetries": 5,
  "debugLog": 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 = {
    "query": "原神",
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("nice_dev/bilibili-videos-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 = {
    "query": "原神",
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("nice_dev/bilibili-videos-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 '{
  "query": "原神",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call nice_dev/bilibili-videos-scraper --silent --output-dataset

```

## MCP server setup

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