# Bilibili 哔哩哔哩 B站 Scraper: Full Comments, Danmaku 弹幕, Creators (`sourabhbgp/bilibili-scraper`) Actor

Scrape Bilibili (哔哩哔哩 / B站) in 10 modes: search, video details, full comment threads, danmaku (弹幕), creator profiles and search, related videos, trending keywords and the popular board. Full threads, not the 1-3 comments most scrapers return. Chinese and English keywords. No login, cookie or proxy.

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

## Pricing

from $3.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

### Bilibili scraper 哔哩哔哩 B站: videos, comments, danmaku, creators & trending

Scrape Bilibili (B站) without a login, a cookie, or a proxy. Ten modes cover keyword search,
video details, full comment threads, danmaku (弹幕), creator profiles and the trending boards.

**From $3.00 per 1,000 results. No proxy or browser needed.**

Works with Chinese and English keywords, and searches simplified and traditional forms together.

### Full comment threads, not the first three

This is the one that matters. Bilibili's older comment endpoint hands an anonymous caller
**only 1 to 3 top level comments per video** and reports that the thread has ended. Most
Bilibili scrapers stop there, and several say in their own documentation that full comments
need a logged in account or residential proxies.

That is not true. This Actor uses the endpoint Bilibili's own website uses, pages the whole
thread, and then follows each reply chain separately. On a video whose top comment alone
declares 1,009 replies, the shallow approach returns 2 of them. This one returns the thread.

**No account, no cookie, no proxy. You are never asked for credentials.**

### What you can pull

| Mode | Give it | You get |
|---|---|---|
| **Search videos** | a keyword | videos with views, likes, danmaku count, tags, creator |
| **Video details** | a video URL or BV id | the richest row: coins, shares, favourites, tags, part count |
| **Comments** | a video URL | whole comment threads, replies attached to their parent |
| **Danmaku** | a video URL | on video bullet comments with their exact second, colour, mode |
| **Creator videos** | a channel URL | a creator's entire back catalogue |
| **Creator profile** | a channel URL | followers, bio, lifetime likes, verification |
| **Search creators** | a keyword | creator discovery with follower counts |
| **Related videos** | a video URL | what Bilibili shows alongside that video |
| **Trending keywords** | nothing | the hot search board with heat scores |
| **Popular board** | a category | what is trending, in 14 categories |

### Top use cases

#### Brand and product monitoring on Chinese social

Search a brand in Chinese and English at once, pull the comment threads, and read what
Gen Z actually said. Turn on **Search wider** and one query for `nike` also searches
`耐克`, `尼克` and Bilibili's own related terms. Schedule it with **Only return items not
seen before** and each run gives you only what is new.

#### Influencer and KOL research

**Search creators** by keyword returns follower counts, video counts and verification
straight away, so you can shortlist without opening a single page. **Creator profile**
then gives you the bio, which on business accounts usually carries a contact email.

#### Competitor and content research

**Creator videos** pulls a channel's whole catalogue with view counts, so you can see what
a rival publishes and what actually lands. **Popular board** and **Trending keywords**
show you what is rising right now, before it reaches the English speaking internet.

#### Chinese language datasets for AI

Comments and danmaku are colloquial, current, Gen Z Chinese: the kind of text that is hard
to source and expensive to buy. Danmaku is unique to Bilibili, and it is sampled evenly
across the whole video rather than taken from the opening seconds.

#### Sentiment and reaction analysis

Danmaku carries the exact second each comment was posted at, so you can see which moment of
a video people reacted to. Nothing else on Bilibili gives you that.

### The three most used modes

#### 🔍 Search videos

Type a keyword in Chinese or English. Sort by best match, most viewed, newest, most danmaku,
most favourited or most commented. Filter by video length and by publish date range.

Simplified and traditional Chinese are genuinely different result sets on Bilibili: for
computer, `电脑` and `電腦` share only 10 of their top 20 results, and for AI, `人工智能` and
`人工智慧` share just 1. **Search wider** searches both, so a Taiwan or Hong Kong keyword
still reaches the mainland catalogue.

Bilibili caps any single query at about 1,000 results. Add more terms under **Extra search
terms** to go past that.

#### 🎬 Video details

Paste a video URL or a BV id and get the fullest record this Actor produces: views, likes,
coins, favourites, shares, comment count, danmaku count, duration, part count, publish date,
category, tags, and the creator with their id and avatar.

Accepts a full URL, a bare BV id, an `av` id, or a b23.tv share link.

#### 💬 Comments

Whole threads, described above. Replies come back as their own rows tagged with the id of the
comment they answer, so you can rebuild the conversation. Sort by most liked or newest. Use
**Maximum replies per comment** to choose breadth across many threads or depth in a few.

### Input examples

**Search videos**

```json
{
  "mode": "search",
  "searchQuery": "人工智能",
  "searchOrder": "click",
  "durationFilter": "medium",
  "expandQuery": true,
  "maxItems": 100
}
```

**Video details**

```json
{
  "mode": "video_detail",
  "videoUrls": [
    "https://www.bilibili.com/video/BV1uv411q7Mv",
    "av170001"
  ],
  "maxItems": 10
}
```

**Comments**

```json
{
  "mode": "video_comments",
  "videoUrls": ["https://www.bilibili.com/video/BV1AAtT6aE8m"],
  "sortComments": "hot",
  "includeReplies": true,
  "maxRepliesPerComment": 20,
  "maxCommentsPerVideo": 500,
  "maxItems": 500
}
```

**Danmaku**

```json
{
  "mode": "danmaku",
  "videoUrls": ["BV1uv411q7Mv"],
  "maxDanmakuPerVideo": 1000,
  "maxItems": 1000
}
```

**Creator videos**

```json
{
  "mode": "creator_videos",
  "creatorUrls": ["https://space.bilibili.com/946974"],
  "includeFullStats": true,
  "maxItems": 500
}
```

**Creator profile**

```json
{
  "mode": "creator_profile",
  "creatorUrls": ["https://space.bilibili.com/946974", "517327498"],
  "maxItems": 50
}
```

**Search creators**

```json
{
  "mode": "creator_search",
  "searchQuery": "美食",
  "expandQuery": true,
  "maxItems": 100
}
```

**Related videos**

```json
{
  "mode": "related_videos",
  "videoUrls": ["BV1uv411q7Mv"],
  "maxItems": 40
}
```

**Trending keywords**

```json
{
  "mode": "hot_search",
  "maxItems": 50
}
```

**Popular board**

```json
{
  "mode": "popular",
  "popularCategory": "4",
  "maxItems": 100
}
```

**Add comments or danmaku to any list mode**

```json
{
  "mode": "search",
  "searchQuery": "美食",
  "includeComments": true,
  "includeDanmaku": true,
  "maxCommentsPerVideo": 20,
  "maxDanmakuPerVideo": 50,
  "maxItems": 1000
}
```

**Run it as a monitor**

```json
{
  "mode": "creator_videos",
  "creatorUrls": ["https://space.bilibili.com/946974"],
  "deltaMode": true,
  "deltaStateKey": "yingshi-weekly",
  "maxItems": 200
}
```

### Output examples

Every row carries a `type` so you can split a mixed run, and a `scrapedAt` timestamp. These
are real rows from live runs.

**Search videos**, one row per video

```json
{
  "type": "video",
  "bvid": "BV1rpWjevEip",
  "aid": 113006243481679,
  "cid": null,
  "url": "https://www.bilibili.com/video/BV1rpWjevEip",
  "title": "【全748集】目前B站最全最细的Python零基础全套教程，2026最新版，包含所有干货！七天就能从小白到大神！少走99%的弯路！存下吧！很难找全的！",
  "description": "【视频配套籽料、开发环境搭建安装包教程、电子书+问题解答请看 ”置顶平论” 自取哦】\r\n本套教程从零开始讲解，手把手教学，包含基础语法、进阶语法、爬虫、自动化办公、数据分析\r\n无论是新手小白，还是有一定编码经验的选手，皆可学习\r\n如果视频对你有用的话请 一键三连【长按点赞】支持一下UP哦，拜托，这对我真的很重要！",
  "coverUrl": "https://i2.hdslb.com/bfs/archive/a979056b1a32012cdd00d48fbc3732d253e30620.jpg",
  "durationSeconds": 143894,
  "partCount": null,
  "publishedAt": "2024-08-22T14:59:18.000Z",
  "categoryName": "计算机技术",
  "tags": [
    "程序员",
    "Python教程",
    "Python入门零基础",
    "计算机",
    "编程语言",
    "数据分析",
    "Python爬虫",
    "Python下载安装",
    "IT",
    "Python"
  ],
  "creatorMid": 3546597933714079,
  "creatorName": "Python官方课程",
  "creatorAvatarUrl": "https://i1.hdslb.com/bfs/face/6822e4fdc8f82c69e10accd1ab11a109702bccbf.jpg",
  "viewCount": 19310365,
  "danmakuCount": 127089,
  "likeCount": 519254,
  "coinCount": null,
  "favoriteCount": 801371,
  "shareCount": null,
  "replyCount": 338162,
  "scrapedAt": "2026-08-30T16:04:46.970Z"
}
```

**Video details**, the same shape, fully populated

```json
{
  "type": "video",
  "bvid": "BV1uv411q7Mv",
  "aid": 243922477,
  "cid": 214334689,
  "url": "https://www.bilibili.com/video/BV1uv411q7Mv",
  "title": "爆肝９８小时！在MC中还原糖调小镇",
  "description": "相关游戏：\n----Minecraft、しゅがてん！-sugarfull tempering\n====================\n制作名单：\n----Minecraft 游戏内建筑：-落忆-\n----程序：-落忆-\n----游戏内摄影：-落忆-、Passkou\n----视频后期：Passkou\n----音乐编曲：Passkou\n=============\n时间统计：\n建筑：约47小时\n程序+调试：14小时\n摄影：11小时\n后期：4小时\n编曲：22小时\n==============\n其它：\n原本是制作了红石音乐的版本，但由于MC限制，音质不好且有卡顿，所以直接用了工程导出的音频。\n这个坑是真的难搞，从7月10号就开始搞了（来看直播的应该知道），中途各种麻烦。",
  "coverUrl": "http://i2.hdslb.com/bfs/archive/82e52df9d0221836c260c82f2890e3761a46716b.jpg",
  "durationSeconds": 314,
  "partCount": 1,
  "publishedAt": "2020-07-20T00:00:14.000Z",
  "categoryName": "单机游戏",
  "tags": [
    "糖调",
    "多人游戏打卡挑战",
    "我的世界",
    "Minecraft",
    "galgame",
    "单机联机",
    "しゅがてん"
  ],
  "creatorMid": 228292951,
  "creatorName": "-星の忆-",
  "creatorAvatarUrl": "https://i1.hdslb.com/bfs/face/5e0820559b0c5b18d536abbc650dabcafd95a558.jpg",
  "viewCount": 21683,
  "danmakuCount": 95,
  "likeCount": 2419,
  "coinCount": 1800,
  "favoriteCount": 1034,
  "shareCount": 177,
  "replyCount": 232,
  "scrapedAt": "2026-08-30T16:04:52.020Z"
}
```

**Comments**, one row per comment, replies included

```json
{
  "type": "comment",
  "bvid": "BV1AAtT6aE8m",
  "aid": 117174307915535,
  "commentId": 312200748689,
  "parentCommentId": null,
  "isReply": false,
  "text": "啼魂外卖已送达，开吃！\n\n道友，落云仙音·宋玉1/6轻雕像级手办已开售🔥同款身姿，双韵呈现（含2款可替换腿部组件）！\n古筝传音，质感入微，眸含流光，眉蕴清韵～道友速来get>>https://b23.tv/PNPqNsx",
  "likeCount": 1499,
  "replyCount": 307,
  "authorMid": 1811805578,
  "authorName": "万维猫动画",
  "authorAvatarUrl": "https://i2.hdslb.com/bfs/face/bd555bdf48aa6fac2f3cb4262a9c5aa5adfa8afd.jpg",
  "postedAt": "2026-08-29T03:00:34.000Z",
  "scrapedAt": "2026-08-30T16:05:10.839Z"
}
```

**Danmaku**, one row per bullet comment, with its position in the video

```json
{
  "type": "danmaku",
  "bvid": "BV1uv411q7Mv",
  "cid": 214334689,
  "text": "厉害！@#",
  "videoTimeSeconds": 0.2,
  "mode": 1,
  "fontSize": 25,
  "color": "#ffffff",
  "sentAt": "2026-04-16T13:25:00.000Z",
  "senderHash": "666c9ee8",
  "danmakuId": "2090899975382086656",
  "scrapedAt": "2026-08-30T16:05:15.370Z"
}
```

**Creator profile**, one row per creator

```json
{
  "type": "creator",
  "mid": 946974,
  "url": "https://space.bilibili.com/946974",
  "name": "影视飓风",
  "bio": "无限进步！｜商务合作请联系邮箱：bd@ysjf.com（邮件中麻烦备注公司、咨询内容）｜店铺名：影视飓风",
  "avatarUrl": "https://i0.hdslb.com/bfs/face/c1733474892caa45952b2c09a89323157df7129a.jpg",
  "followerCount": 17312590,
  "followingCount": 684,
  "videoCount": 939,
  "totalLikes": 124132188,
  "level": 6,
  "sex": "male",
  "officialRole": 7,
  "verifiedType": "personal",
  "officialTitle": "2025百大UP主、2023年度最高人气奖UP主、课堂优质讲师",
  "isVerified": true,
  "scrapedAt": "2026-08-30T16:04:59.015Z"
}
```

**Search creators**, one row per creator found

```json
{
  "type": "creator",
  "mid": 521974986,
  "url": "https://space.bilibili.com/521974986",
  "name": "Unitree宇树科技",
  "bio": "智能体机器人行业领航者，90后们创立的公司，欢迎热爱科技的人一起推进人类科技。",
  "avatarUrl": "https://i0.hdslb.com/bfs/face/1743e687547cc74932c4fec36c675c69306978bf.jpg",
  "followerCount": 917721,
  "followingCount": null,
  "videoCount": 98,
  "totalLikes": null,
  "level": 6,
  "sex": "unknown",
  "officialRole": null,
  "verifiedType": "organization",
  "officialTitle": "宇树科技股份有限公司官方账号",
  "isVerified": true,
  "scrapedAt": "2026-08-30T16:05:02.516Z"
}
```

**Creator videos**, the catalogue listing carries view count only unless you turn on full stats

```json
{
  "type": "video",
  "bvid": "BV17Rh56DEdV",
  "aid": 117156205370302,
  "cid": null,
  "url": "https://www.bilibili.com/video/BV17Rh56DEdV",
  "title": "桑多涅：哈？来至冬需要执行官照顾？",
  "description": "主线剧情相关哦，桑多涅真是操碎了心",
  "coverUrl": "http://i2.hdslb.com/bfs/archive/1b70a82a89ef9f47d58545bb175a72f73585750a.jpg",
  "durationSeconds": 85,
  "partCount": null,
  "publishedAt": "2026-08-26T03:35:00.000Z",
  "categoryName": null,
  "tags": null,
  "creatorMid": 37836281,
  "creatorName": "白银新手",
  "creatorAvatarUrl": null,
  "viewCount": 2438560,
  "danmakuCount": null,
  "likeCount": null,
  "coinCount": null,
  "favoriteCount": null,
  "shareCount": null,
  "replyCount": null,
  "scrapedAt": "2026-08-30T16:04:55.370Z"
}
```

**Related videos**, one row per related video

```json
{
  "type": "video",
  "bvid": "BV1mnNo6XEyU",
  "aid": 116936507661670,
  "cid": 40051803394,
  "url": "https://www.bilibili.com/video/BV1mnNo6XEyU",
  "title": "梦想小镇|便利店",
  "description": null,
  "coverUrl": "http://i1.hdslb.com/bfs/archive/083a3018bbae1b194e22d551cf0f97bbf0d941ce.jpg",
  "durationSeconds": 44,
  "partCount": 1,
  "publishedAt": "2026-07-17T17:34:04.000Z",
  "categoryName": "单机游戏",
  "tags": null,
  "creatorMid": 3546666407824093,
  "creatorName": "肉脸蒜蒜",
  "creatorAvatarUrl": "https://i1.hdslb.com/bfs/face/f0963b03d47d2c6abf6bae291ef2477d04da6cd4.jpg",
  "viewCount": 11706,
  "danmakuCount": 3,
  "likeCount": 575,
  "coinCount": 17,
  "favoriteCount": 470,
  "shareCount": 5,
  "replyCount": 39,
  "scrapedAt": "2026-08-30T16:05:18.859Z"
}
```

**Popular board**, one row per trending video

```json
{
  "type": "video",
  "bvid": "BV1gk4X6zEm5",
  "aid": 117183132862617,
  "cid": 41422619370,
  "url": "https://www.bilibili.com/video/BV1gk4X6zEm5",
  "title": "《全障碍沟通》",
  "description": null,
  "coverUrl": "http://i2.hdslb.com/bfs/archive/bd8f3c5f5130aa9db304ef685d5f228db0f83cac.jpg",
  "durationSeconds": 138,
  "partCount": 1,
  "publishedAt": "2026-08-30T07:10:01.000Z",
  "categoryName": "搞笑",
  "tags": null,
  "creatorMid": 3493260618106936,
  "creatorName": "伤心欲茄222",
  "creatorAvatarUrl": "https://i1.hdslb.com/bfs/face/1f0cb64d9b62da7db7e6e020b78b6872dbffe55c.jpg",
  "viewCount": 727086,
  "danmakuCount": 1026,
  "likeCount": 67492,
  "coinCount": 1641,
  "favoriteCount": 3162,
  "shareCount": 1798,
  "replyCount": 1837,
  "scrapedAt": "2026-08-30T16:05:25.434Z"
}
```

**Trending keywords**, one row per keyword

```json
{
  "type": "keyword",
  "keyword": "广州TTG 北京JDG",
  "showName": "北京JDG战胜广州TTG KPL",
  "heatScore": 5193940,
  "iconUrl": "http://i0.hdslb.com/bfs/activity-plat/static/20221213/eaf2dd702d7cc14d8d9511190245d057/lrx9rnKo24.png",
  "rank": 1,
  "scrapedAt": "2026-08-30T16:05:22.009Z"
}
```

### How much does Bilibili Scraper cost?

**$3.00 per 1,000 results** on the Business plan, and $5.00 per 1,000 on the free plan. There
is a $0.005 fee when a run starts.

- Apify's **$5 free monthly credit** gets you about **1,000 results** a month at the free rate.
- The **$29 Starter plan** gets you about **7,249 results** at the Starter rate, on top of
  everything else you run.

You are charged per row delivered. A duplicate is never charged twice, and a row you did not
receive is never charged. A run against a video or creator that does not exist costs you
nothing beyond the start fee.

### Limitations

- **Bilibili caps a single search query at about 1,000 results.** Use extra search terms, or
  turn on Search wider, to go past that.
- **A category board on the popular feed holds about 95 to 100 videos.** Asking for more will
  tell you it could not fill the request.
- **Subtitles are not available.** Bilibili tells an anonymous caller that a subtitle track
  exists and what language it is in, but will not serve the text without a login.
- **Creator text posts are not available.** Bilibili blocks that feed to anonymous callers.
- **The creator listing is lean by default:** it carries the view count only. Turn on
  **Fetch full engagement stats** for likes, coins, favourites, danmaku and comment counts.
  That opens each video individually, so it is slower.
- **BV ids are case sensitive.** `BV1uv411q7Mv` and `BV1uv411q7mv` are two different videos.
  Copy the id from the address bar rather than retyping it.

### Frequently asked questions

#### Do I need a Bilibili account, cookies, or a login?

No. Nothing in this Actor asks for credentials, and none of the ten modes needs them. That
also means your account can never be affected by using it.

#### Will I get blocked, or do I need a proxy?

No proxy is needed and none is used by default. Testing across datacenter and residential
proxies in the US, Singapore and Germany found residential performed no better and in places
worse, so it is off. The proxy input is there if you want it.

#### Can I really get all the comments on a video?

You get whole threads rather than the 1 to 3 top level comments an anonymous caller normally
sees, plus the replies under each one. The limit is what you set with **Maximum comments per
video**, not what Bilibili hands out by default.

#### Can I scrape a creator's videos from a specific date range?

Yes, in Search videos mode, with **Published after** and **Published before**. Creator videos
mode returns the catalogue newest first, so you can stop when you reach your cutoff.

#### Does the maximum results setting actually work?

Yes, exactly. Ask for 7 and you get 7. Filters and sorts are verified to change the result
set rather than being accepted and quietly ignored.

#### What happens if a video or creator does not exist?

The run finishes normally and tells you which ids were not found. It does not fail, and you
are not charged for rows you did not get.

#### Does it work with Chinese keywords?

Yes, and that is the point. Simplified and traditional are different result sets on Bilibili,
so **Search wider** searches both plus Bilibili's own related terms. All text comes back in
the original Chinese, including emoji and full width punctuation.

#### Is it legal to scrape Bilibili?

This Actor only reads pages and endpoints that Bilibili serves publicly to anyone, with no
login. It does not access private or paywalled content. You are responsible for how you use
the data, including any personal data, under the laws that apply to you.

#### Does it support scheduled runs and integrations?

Yes. Use Apify Schedules for recurring runs, and turn on **Only return items not seen before**
so each run gives you only new items and does not bill you again for old ones. Results push to
Google Sheets, Slack, Zapier, Make, Airbyte and webhooks.

#### Can I use it with the Apify API?

Yes. Every Actor on Apify has a REST API, and there are official clients for
[Python](https://docs.apify.com/api/client/python/) and
[JavaScript](https://docs.apify.com/api/client/js/).

#### Can I use it through an MCP server?

Yes. It works with Apify's MCP server, so an AI agent can call it directly.

### Your feedback

Found a bug, or need a field that is not here yet? Open an issue on the
[Actor's Issues tab](https://console.apify.com/actors/KVNGJZGNQAa13Mbc6/issues) and it will
reach a human.

# Actor input Schema

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

Pick one job per run. Search finds videos or creators by keyword, Video details and Comments and Danmaku and Related take video URLs, Creator videos and Creator profile take channel URLs, Trending keywords and Trending board take no target.

## `searchQuery` (type: `string`):

Keyword to search. Works in Chinese and English, for example 人工智能 or python tutorial. Used in Search videos and Search creators modes.

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

Additional terms to search and merge into the same result set, for example the Chinese name of a brand alongside the English one. Bilibili caps every single query at 1000 results, so extra terms are the only way past that ceiling. Used in Search mode.

## `expandQuery` (type: `boolean`):

Search more widely for the same idea. Adds Bilibili's own related search suggestions, and for Chinese queries also searches the simplified and traditional forms. Those are genuinely different result sets on Bilibili: for computer, 电脑 and 電腦 shared only 10 of their top 20 results, and for AI, 人工智能 and 人工智慧 shared just 1. Used in Search videos and Search creators modes.

## `searchOrder` (type: `string`):

How to order search results. Used in Search mode.

## `durationFilter` (type: `string`):

Filter search results by video length. Used in Search mode.

## `pubtimeBegin` (type: `string`):

Only return videos published on or after this date, as YYYY-MM-DD. Leave empty for no limit. Used in Search mode.

## `pubtimeEnd` (type: `string`):

Only return videos published on or before this date, as YYYY-MM-DD. Leave empty for no limit. Used in Search mode.

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

Bilibili videos. Accepts a full URL, a bare BV id, an av id, or a b23.tv share link, for example https://www.bilibili.com/video/BV1uv411q7Mv or BV1uv411q7Mv or av170001. Used in Video details, Comments, Danmaku and Related videos modes.

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

Bilibili creator pages, for example https://space.bilibili.com/946974 or the bare id 946974. Used in Creator videos and Creator profile modes.

## `popularCategory` (type: `string`):

Which board to read in Trending mode. All returns the site-wide popular feed.

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

Stop after this many rows. Each video, comment or danmaku line counts as one row.

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

Upper limit of comment rows per video, counting replies. Bilibili threads can run to tens of thousands, so raise this when you want a whole thread rather than the top of it.

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

Also pull the replies under each top level comment, each as its own row. This is the only way to get real thread depth without a Bilibili account. Used in Comments mode.

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

How deep to follow each individual reply thread. Bilibili only inlines 2 or 3 replies per comment no matter how many there are, so this Actor pages the rest. Keep it low for a broad spread across many threads, raise it to pull whole conversations. Set 0 for top level comments only.

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

Order of the comment thread. Used in Comments mode and when comments are added to other modes.

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

Upper limit of danmaku rows per video. Used in Danmaku mode.

## `includeFullStats` (type: `boolean`):

Used in Creator videos mode. Bilibili's creator listing returns only the view count. Turn this on to look up each video individually so likes, coins, favourites, danmaku and comment counts are filled in too. It is slower and uses one extra request per video, so it is off by default.

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

In Search, Creator videos and Trending modes, also pull the comment thread of every video found, one row per comment. This multiplies rows and cost, so it is off by default and bounded by Maximum comments per video.

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

In Search, Creator videos and Trending modes, also pull the danmaku track of every video found, one row per danmaku. Samples evenly across the whole video, not just the opening seconds. Off by default.

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

Turns a one off scrape into a recurring monitor. Each run returns only items that earlier runs did not already deliver, so a schedule gives you new items and does not bill you again for old ones.

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

Names the saved list of already delivered items, so separate monitors do not collide. Use a distinct name per thing you track, for example nike-weekly. Used when Only return items not seen before is on.

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

Optional. Bilibili does not require a proxy for these endpoints and testing showed residential proxies perform worse than none, so leave this off unless you have a specific reason.

## Actor input object example

```json
{
  "mode": "search",
  "searchQuery": "python",
  "expandQuery": false,
  "searchOrder": "totalrank",
  "durationFilter": "any",
  "popularCategory": "all",
  "maxItems": 20,
  "maxCommentsPerVideo": 50,
  "includeReplies": true,
  "maxRepliesPerComment": 20,
  "sortComments": "hot",
  "maxDanmakuPerVideo": 500,
  "includeFullStats": false,
  "includeComments": false,
  "includeDanmaku": false,
  "deltaMode": false,
  "deltaStateKey": "default",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

One row per video, comment, danmaku line, creator or trending keyword. Videos carry views, likes, coins, favourites, danmaku and comment counts plus creator and tags. Comments carry text, likes, author and reply threading. Danmaku carries text with its position in the video timeline. Creators carry follower counts, bio, level and verification.

# 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",
    "searchQuery": "python",
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("sourabhbgp/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",
    "searchQuery": "python",
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("sourabhbgp/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",
  "searchQuery": "python",
  "maxItems": 20
}' |
apify call sourabhbgp/bilibili-scraper --silent --output-dataset

```

## MCP server setup

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