Bilibili Scraper – Videos, Comments, Danmaku & Users avatar

Bilibili Scraper – Videos, Comments, Danmaku & Users

Pricing

from $17.00 / 1,000 bilibili scraped items

Go to Apify Store
Bilibili Scraper – Videos, Comments, Danmaku & Users

Bilibili Scraper – Videos, Comments, Danmaku & Users

Scrape Bilibili videos, comments, danmaku (bullet chats), creator profiles & user archives. 6 modes: search, trending, video detail, comments, user videos, profile. Clean JSON, delta mode, PPE pricing. $17/1K items + $30/1K danmaku.

Pricing

from $17.00 / 1,000 bilibili scraped items

Rating

0.0

(0)

Developer

Scrape Pilot

Scrape Pilot

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

a month ago

Last modified

Categories

Security

Limited permissions

Share


📺 Bilibili Scraper Pro — Videos, Comments, Danmaku, User Profiles


The most comprehensive Bilibili scraper on Apify. Extract videos, comments, danmaku (bullet comments), creator profiles, and deep metadata from China's #1 video platform. Search by keyword, fetch trending feeds, scrape entire creator libraries, or dig deep into a single video — all with one powerful actor.

Pricing: Pay only for what you use — $17 per 1,000 items (videos, comments, users) and $30 per 1,000 danmaku profiles. Actor start: $0.02 per run.


💡 What is the Bilibili Scraper Pro?

Bilibili (B站) is the largest video platform in China with over 300 million monthly active users. This actor is designed to extract structured, actionable data from every corner of the platform — including hard-to-reach data like danmaku bullet comments and creator archive libraries.

Unlike basic scrapers, this actor uses a real browser-like session that warms up cookies (buvid3, b_nut) to avoid Bilibili's anti-bot protections, plus optional Apify residential proxies for large-scale runs. The result is a reliable, production-grade Bilibili data pipeline.

Six powerful scraping modes in one actor:

  1. Search Mode — Search videos by keyword with sorting, duration, and category filters.
  2. Popular Mode — Scrape Bilibili's trending/popular video feed.
  3. Video Detail Mode — Extract complete metadata for specific videos (by URL or BVID).
  4. Video Comments Mode — Scrape comments for one or more videos, with optional replies.
  5. User Videos Mode — Fetch every video from a creator's archive (plus their profile).
  6. User Profile Mode — Get complete creator cards: fans, level, official status, etc.

🚀 Key Features

FeatureDescription
6 Scrape ModesSearch, Popular, Video Detail, Video Comments, User Videos, User Profile.
Danmaku Reaction ProfilesParse bullet comments to get sender counts, per-minute rate, peak minute, timeline sample.
Nested CommentsFetch top-level comments and (optionally) their replies in one call.
Creator CardsGet fans, level, official status, archive count, total likes, and more.
Delta ModeSave processed BVIDs to KV store so subsequent runs only return new items.
Cookie WarmingRealistic Chrome 124 fingerprint + tracking cookie handshake to bypass 412.
HTML Deep ParsingExtracts window.__INITIAL_STATE__ from video pages for complete metadata.
Residential Proxy ReadyCompatible with Apify residential proxies for high-volume production runs.
Pay-Per-Event Pricing$17/1K items, $30/1K danmaku profiles, $0.02 actor start — transparent.
Clean JSON OutputConsistent schema across all modes; ready for analytics or ML pipelines.

📥 Input Parameters

The actor accepts a JSON object with the following fields. Which fields are required depends on the mode.

ParameterTypeRequiredDefaultDescription
modestringYes"search"search, popular, video_detail, video_comments, user_videos, or user_profile.
searchQuerystringSearch mode"人工智能教程"Keyword for search mode.
videoUrlsarrayVideo modes["https://www.bilibili.com/video/BV1bmTb6EEs8"]Video URLs or BVIDs for detail/comment modes.
userUrlsarrayUser modes["https://space.bilibili.com/546195"]Creator space URLs or MIDs.
maxResultsintegerNo50Max videos to return (search/popular/user_videos).
sortOrderstringNo"totalrank"Search sort: totalrank, click, pubdate, dm, stow.
durationFilterstringNo"any"any, short (<10m), medium (10–30m), long (30–60m), huge (>60m).
categorystringNo"all"Numeric category ID or "all".
includeCommentsbooleanNofalseAlso fetch comments for each video.
maxCommentsintegerNo20Max comments per video.
sortCommentsstringNo"hot"hot or time.
includeRepliesbooleanVideo-comments modefalseFetch nested replies too.
includeDanmakubooleanNofalseInclude danmaku reaction profile for each video.
danmakuSampleSizeintegerNo25Number of danmaku items in the timeline sample.
deltaModebooleanNofalseOnly return items not seen in previous runs.
deltaStateKeystringNo"default"Separate delta state for different pipelines.
proxyConfigurationobjectNo–Apify proxy config (residential strongly recommended for large runs).

Example Input — Search Mode

{
"mode": "search",
"searchQuery": "人工智能教程",
"maxResults": 20,
"sortOrder": "click",
"durationFilter": "medium",
"includeComments": true,
"maxComments": 10,
"includeDanmaku": true
}

Example Input — Video Detail Mode

{
"mode": "video_detail",
"videoUrls": [
"https://www.bilibili.com/video/BV1bmTb6EEs8",
"BV1qZSLBYEpa"
],
"includeComments": true,
"maxComments": 30,
"includeDanmaku": true,
"danmakuSampleSize": 50
}

Example Input — User Videos Mode

{
"mode": "user_videos",
"userUrls": ["https://space.bilibili.com/546195"],
"maxResults": 50,
"includeComments": false
}

📤 Output Fields

The actor outputs multiple record types depending on mode:

1. type: "video" — Video Record

FieldTypeDescription
bvidstringBilibili video ID (BV…).
aidintegerNumeric archive ID.
titlestringVideo title (HTML cleaned).
descriptionstringVideo description.
urlstringCanonical video URL.
thumbnailUrlstringThumbnail URL (https-normalized).
durationintegerDuration in seconds.
durationFormattedstringDuration as mm:ss or h:mm:ss.
viewCountintegerTotal views.
likeCountintegerTotal likes.
coinCountintegerBilibili coins.
favoriteCountintegerFavorites.
shareCountintegerShares.
danmakuCountintegerTotal danmaku.
replyCountintegerTotal comments.
authorNamestringUploader display name.
authorMidintegerUploader numeric ID.
publishDatestringISO 8601 publish date.
publishTimestampintegerUnix epoch.
categorystringVideo category name.
tagsarrayVideo tags.
scrapedAtstringISO 8601 extraction time.

2. type: "comment" — Comment Record

FieldTypeDescription
commentIdintegerBilibili reply ID.
textstringComment text.
likeCountintegerLikes on the comment.
replyCountintegerReplies to this comment.
createdAtstringISO 8601 time.
createdTimestampintegerUnix epoch.
authorNamestringCommenter name.
authorMidintegerCommenter numeric ID.
authorAvatarstringAvatar URL.
authorLevelintegerBilibili user level (0–6).
videoBvidstringSource video BVID.
scrapedAtstringISO 8601 extraction time.

3. type: "danmaku_profile" — Danmaku Reaction Profile

FieldTypeDescription
videoBvidstringVideo BVID.
aidintegerVideo AID.
countFetchedintegerDanmaku fetched from XML.
totalVideoDanmakuintegerTotal danmaku count from video metadata.
uniqueSendersintegerDistinct sender hashes.
perMinuteRatefloatDanmaku per minute.
peakMinuteobject{minute, danmakuCount} at peak.
timelineSamplearraySampled danmaku across the timeline: {time, timeFormatted, text, senderHash, timestamp}.
scrapedAtstringISO 8601 extraction time.

4. type: "user" — Creator Profile

FieldTypeDescription
midintegerCreator numeric ID.
namestringDisplay name.
facestringAvatar URL.
signstringBio.
levelintegerBilibili level (0–6).
fansintegerFollower count.
friendintegerFollowing count.
attentionintegerAccounts this creator follows.
isOfficialbooleanOfficial verification.
officialDescstringOfficial status description.
archiveCountintegerTotal uploaded videos.
likeCountintegerTotal likes received.
profileUrlstringSpace URL.
scrapedAtstringISO 8601 extraction time.

Example Output — Search Mode

[
{
"type": "video",
"bvid": "BV1qZSLBYEpa",
"title": "【整整600集】清华大学196小时讲完的AI人工智能从入门到精通全套教程...",
"viewCount": 1107723,
"likeCount": 24014,
"danmakuCount": 8285,
"replyCount": 14643,
"authorName": "IT界扛霸子",
"url": "https://www.bilibili.com/video/BV1qZSLBYEpa",
"duration": 0,
"durationFormatted": "0:00",
"publishDate": "2026-01-15T08:00:00+00:00",
"scrapedAt": "2026-10-09T12:00:00+00:00"
}
]

Example Output — Danmaku Profile

[
{
"type": "danmaku_profile",
"videoBvid": "BV1qZSLBYEpa",
"aid": 113456789,
"countFetched": 3000,
"totalVideoDanmaku": 8285,
"uniqueSenders": 2104,
"perMinuteRate": 42.5,
"peakMinute": {"minute": 18, "danmakuCount": 312},
"timelineSample": [
{"time": 5.4, "timeFormatted": "0:05", "text": "666", "senderHash": "a1b2c3d4", "timestamp": 1768460400}
],
"scrapedAt": "2026-10-09T12:00:05+00:00"
}
]

💰 Pricing

EventPriceUnit
item-scraped$17.00 per 1,000Videos, comments, user profiles
danmaku-profile$30.00 per 1,000Danmaku reaction profile
apify-actor-start$0.02 per runStartup fee

Example costs:

  • 100 videos with comments: 100 videos + 20 comments each (2,000 comments) = $17.00 (2,000 items @ $17/1K) + $0.02 = ~$17.02.
  • 50 videos with danmaku profiles: 50 videos + 50 danmaku profiles = 50 × $0.017 + 50 × $0.030 = $0.85 + $1.50 = $2.35.
  • 1 user + 500 videos (user_videos mode): 501 items = ~$8.54.

🛠 How to Use on Apify

  1. Create a task with this actor.
  2. Choose the mode in the input JSON.
  3. Provide the required URLs / keywords.
  4. (Optional) Enable residential proxies for large-scale runs.
  5. Run – the actor scrapes everything and pushes results to the Dataset.
  6. Export – download as JSON, CSV, or Excel.

Running via API

curl -X POST "https://api.apify.com/v2/acts/your-username~bilibili-scraper/runs" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"mode": "search",
"searchQuery": "AI教程",
"maxResults": 20
}'

🎯 Use Cases

  • Trending video tracking – Monitor what content is rising on Bilibili.
  • Content research – Analyze creator libraries at scale.
  • Danmaku sentiment analysis – Use bullet comment timelines to find viral moments.
  • Comment analytics – Study viewer reactions across videos.
  • Creator intelligence – Build a database of creator stats (fans, level, uploads).
  • Delta monitoring – Track new uploads from your favorite creators on a schedule.

❓ Frequently Asked Questions

1. Do I need a Bilibili account?
No. All data is public. No login or cookie supplied by you.

2. What's the difference between danmaku and comments?
Danmaku are bullet comments overlaid on the video at specific timestamps. Comments are the traditional threaded replies below the video.

3. Why is duration 0 in some search results?
Bilibili's search API occasionally omits duration. Use video_detail mode on those BVIDs for exact duration.

4. How does delta mode work?
Each processed BVID is saved in the actor's key-value store. On subsequent runs with the same deltaStateKey, already-seen items are skipped. Perfect for scheduled daily monitoring.

5. Do I need a proxy?
Not for small runs. For 500+ items per run, use Apify residential proxies to avoid 412 rate-limits.

6. Why does my danmaku count differ from the video's danmakuCount?
Bilibili's XML feed only returns a subset (~3,000) of the total danmaku. countFetched reports the number fetched, while totalVideoDanmaku reports Bilibili's public count.

7. Can I scrape playlists or合集?
Not in this version. You can scrape all videos from a creator's archive with user_videos mode.

8. Does the actor work outside Apify?
Yes — it's a standalone Python script using apify SDK. You can run it locally with the Apify CLI.

9. What happens if I hit the spending limit?
The actor detects event_charge_limit_reached and exits gracefully, saving all data pushed so far.

10. Can I run search + comments + danmaku in one go?
Yes — combine mode: "search", includeComments: true, and includeDanmaku: true.



🔍 SEO Keywords

Bilibili scraper, B站 scraper, bilibili video scraper, bilibili comments, bilibili danmaku, bilibili bullet comments, bilibili user profile scraper, bilibili search API, bilibili trending videos, Apify bilibili actor, bilibili delta scraper, bilibili creator analytics




Start scraping Bilibili today — $17/1K items, $30/1K danmaku profiles, $0.02 actor start.