Bilibili Danmaku Scraper
Pricing
from $9.36 / 1,000 video processeds
Bilibili Danmaku Scraper
Extract decoded Bilibili (哔哩哔哩) danmaku (bullet comments) with timestamps, color, mode, sender, and a per-video summary. One flat price per video, no per-comment surcharge. No login required.
Pricing
from $9.36 / 1,000 video processeds
Rating
0.0
(0)
Developer
Romy
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
8 days ago
Last modified
Categories
Share
Extract decoded Bilibili (哔哩哔哩) danmaku (弹幕, "bullet comments" — the scrolling on-video reactions Bilibili is known for) with full timestamp, color, mode, and sender data, plus a per-video summary (unique senders, peak-activity minute, time range). No login required.
Why
Danmaku is returned by Bilibili's own API as raw Protobuf binary
(x/v2/dm/web/seg.so), not JSON — most scrapers either skip it entirely or
depend on a third-party protobuf library. This actor uses a hand-rolled
varint/tag decoder (no dependency) against the community-documented
DanmakuElem/DmSegMobileReply schema, ported from the mature sibling
actor bilibili-all-in-one-api (already live and verified on Apify),
along with its bvid -> cid video-info resolution.
Pricing differentiation: competing danmaku actors on Apify charge per comment on top of a per-video fee (e.g. $0.00999/video + $0.00015/danmaku, which adds up fast on a popular video with thousands of comments). This actor charges one flat price per video — you get every danmaku it finds, no matter how many, for one price.
How it works
- Resolves each input video (URL or bare bvid) to Bilibili's internal
cid(the video-part id danmaku is actually indexed by, not the bvid). - Fetches danmaku in ~6-minute segments (
maxSegmentsinput, default 3), stopping early once a segment comes back empty. - Decodes each segment's raw Protobuf into structured JSON:
id,progressMs(position in the video),mode,fontSize,color,midHash(hashed sender id),content,ctime(send time),weight,pool,attr. - Pushes one dataset row per video: video metadata + a summary (unique
senders, first/last send time, the single busiest minute and its count)
- the full decoded danmaku array.
Input
| Field | Type | Description |
|---|---|---|
videos | array of strings | Bilibili video URLs or bare bvids (required) |
maxSegments | integer | Max ~6-minute segments to fetch per video (default 3, max 20) |
Output
One dataset item per video:
{"bvid": "BV1Q5tG6bEX3","title": "...","owner": "...","duration": 123,"viewCount": 456789,"totalDanmakuCount": 18165,"fetchedDanmakuCount": 254,"summary": {"uniqueSenders": 249,"firstCtime": 1788404458,"lastCtime": 1788427409,"peakMinute": 0,"peakMinuteCount": 159},"danmaku": [{ "id": 3203383280, "progressMs": 2067, "mode": 5, "fontSize": 25, "color": 16777215, "midHash": "432e7d85", "content": "是什么蒙蔽了我的双眼", "ctime": 1788404458, "weight": 11, "attr": 1048580 }]}
totalDanmakuCount is Bilibili's own reported count for the whole video;
fetchedDanmakuCount is how many this run actually pulled (limited by
maxSegments — raise it for very long videos).
A video that fails to resolve (bad URL/bvid, deleted video) doesn't abort
the run — it's logged and pushed as an { input, error } row so a batch of
mixed-quality input doesn't lose the videos that did work.
Pricing
Pay-per-event, one flat video event per successfully processed video —
no per-comment charge. See the actor's Pricing tab on Apify Console for
current tiered rates.
Getting started
$apify run