⚡ Key takeaways
- Bilibili has no official API for comments; old tutorials break on the new
w_ridsigning. - The open-source Bilibili Scraper handles signing and risk control, so it works without a login.
- 1,000 comments with full reply threads cost $1 on Apify, or nothing if you self-host.
- Export to Excel, CSV or JSON in one click, or use it as a Python library.
Bilibili (哔哩哔哩, B站) is where China's Gen Z watches anime, gaming, tech and lifestyle videos, and its comment sections are brutally honest. Add danmaku (弹幕), the bullet comments that fly across the video at the exact second something happens, and you have one of the richest audience-reaction datasets on the internet.
Getting it out is the hard part. Bilibili has no official public API, its endpoints now demand a w_rid / wts signature (WBI signing), and it answers fast or unsigned requests with silent risk-control errors (-352, -412). Most tutorials from before 2023 simply don't work anymore.
Here are two ways that do work in 2026, without a Bilibili account.

What can you scrape from Bilibili?
| Data | What you get |
|---|---|
| Comments | Hot or newest first, with full nested reply threads. 23 fields per comment: user, likes, pinned, VIP, verified, "liked by uploader", IP location, reply count… |
| Danmaku (bullet comments) | Every bullet comment as its own row, with its playback time, colour, mode and send time |
| Videos | Views, likes, coins, favourites, shares, danmaku and reply counts, tags |
| UP主 (creators) | Name, bio, level, verified title, VIP, followers, following, video count, total likes |
| Creator uploads | Every video a creator uploaded, sorted by date, views or favourites |
| Search & trending | Keyword search (sort by views, date, danmaku…), the popular feed and the top-100 ranking |
| Subtitles / transcripts | Including AI captions. This is the one thing that needs a login cookie |
Option 1: No code, in 4 clicks (Apify)
- Open the Bilibili Scraper and click Try for free. A free Apify account includes monthly credit.
- Pick What to scrape:
videos,comments,danmaku,subtitlesorusers. - Give it a source: paste video links,
space.bilibili.com/...creator links or search links, or just type keywords such as原神. - Click Start, then Export to Excel, CSV or JSON (or send it straight to Google Sheets).
Example: the comments, with replies, on the top 20 search results for a keyword:
{
"mode": "comments",
"searchQueries": ["原神"],
"maxVideosPerSource": 20,
"maxCommentsPerVideo": 200,
"includeReplies": true
}
How do you scrape UP主 (creator) profiles?
Set mode to users and pass creator IDs (the number in space.bilibili.com/<UID>):
{
"mode": "users",
"userIds": ["2", "546195"]
}
Each row has name, sign (bio), level, verified, vip, followers, following, videos, likes and the profile url. To get a creator's videos instead, use mode: "videos" with the same userIds.
What does it cost?
Pay per result, no subscription:
| You scrape | Price per 1,000 |
|---|---|
| Comments (incl. replies) | $1 |
| Danmaku | $0.05 |
| Videos or UP主 profiles | $2 |
| Subtitles | $3 |
Option 2: Python (free, open source)
The scraper is open source (MIT):
git clone https://github.com/Dunkmap/Bilibili-Scraper
cd Bilibili-Scraper
pip install -e .
From the command line:
bili comments BV1xx411c7mD --replies -o comments.csv
bili danmaku BV1xx411c7mD -o danmaku.csv
bili user 2 # UP主 profile
bili uploads 2 --order click --limit 100 -o uploads.csv
bili search "原神" --order click --limit 200 -o search.csv
Or as a library:
import asyncio
from bilibili_scraper import Scraper
async def main():
async with Scraper(rate=4) as s:
video = await s.video("BV1xx411c7mD")
async for c in s.comments(video["bvid"], limit=500, replies=True):
print(c["uname"], c["content"])
creator = await s.user(video["owner_mid"])
print(creator["name"], creator["followers"])
async for v in s.user_videos(video["owner_mid"], order="click", limit=20):
print(v["title"], v["views"])
asyncio.run(main())
How does it get past w_rid signing and risk control?
- WBI signing: fetches
img_key/sub_key, generatesw_ridandwts, caches the keys and refreshes them when Bilibili rejects a signature (-352). - Silent risk control: Bilibili sometimes answers
code: 0with only av_voucherand no data. The scraper detects this and retries instead of treating it as an empty page. - Device cookies: generates a
buviditself, so no account is needed. - Rate limits: jittered delays and backoff retries on
-412. The cloud version also switches to a proxy when it gets blocked.
Want the details? Read how the Bilibili API works.
What else can it do?
- Sentiment analysis: label every comment and danmaku positive, neutral or negative ($2 per 1,000 labels, using your own free Groq API key).
- Delta mode: scheduled runs return only items that are new since the last run, which is handy for brand monitoring.
- Danmaku highlights: if you analyse bullet comments, the Bilibili Danmaku Scraper adds a keyword filter and a free per-video highlight timeline. New to danmaku? Start with what is danmaku.
Not sure which tool fits? See the comparison of Bilibili scrapers on Apify.
