Bilibili Scraper: Videos, Danmaku, Comments avatar

Bilibili Scraper: Videos, Danmaku, Comments

Pricing

from $12.00 / 1,000 videos

Go to Apify Store
Bilibili Scraper: Videos, Danmaku, Comments

Bilibili Scraper: Videos, Danmaku, Comments

Bilibili scraper for video search, details, popular, danmaku, comments, subtitle transcripts and profiles. Charged only for rows delivered. $12 per 1,000 video rows.

Pricing

from $12.00 / 1,000 videos

Rating

0.0

(0)

Developer

Agnes Maina

Agnes Maina

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

3 days ago

Last modified

Share

Bilibili Scraper: videos, danmaku, comments, transcripts

Run on Apify

This Bilibili scraper reads video search results, video details, the popular list, danmaku (the timed comments displayed over a video), comments, subtitle transcripts, an uploader's videos and channel profiles. You pay for rows you receive: $0.012 per video row, which is $12 per 1,000 videos, and every billable event fires only after a successful dataset push.

Limits before you run it: maxItems caps items at 1,000 per query or per user, maxDanmakuPerVideo at 10,000 and maxCommentsPerVideo at 5,000. Which modes need a cookie you supply yourself: comments and transcript. Without one, comments stop at the top 3 ordinary replies per video plus a pinned reply, with totalComments still reporting the true total, and transcript returns the subtitle language list only, with hasText false, so it costs nothing per row. The other six modes, search, video_detail, popular, danmaku, user_videos and profile, need no cookie, and profile mode ignores it.

What you get

One row type per mode, and each one has its own price:

ModeRows you getBilled as
searchVideo search rows per queries entry, with coins and shares from signed video detailone video event per row
popularThe popular video list, maxItems in totalone video event per row
user_videosAn uploader's videos, maxItems per midone video event per row
video_detailDetail and statistics for each BV ID or video URLone video-detail event per row
danmakuTimed on-screen comments per video, up to maxDanmakuPerVideo across all pagesone danmaku-video event per video that delivered a row
commentsComments per video, up to maxCommentsPerVideo including second-level replies, each row with totalCommentsone comment event per delivered row with non-empty text
transcriptSubtitle language rows per part and language, with hasText saying whether text came with itone transcript event per row with text
profileUploader profiles, maxItems across all mids, missing fields nullone profile event per non-empty row

Rows are keyed by bvid for video modes and by mid for profile mode, which is what delta mode tracks. Each run writes RUN_SUMMARY with pushed rows, charged events and errors.

Try it in 30 seconds

  1. Open the Actor page in the Apify Store and click Try for free.
  2. Pick mode, fill the input it needs, click Start and open the dataset.

BV1VeHQ6tEaS is a video ID and 946974 is an uploader's numeric mid. Apify Proxy (datacenter) is the default; these examples switch it off only to keep the input short.

What you wantInput
Search for videos{"mode":"search","queries":["Genshin Impact"],"maxItems":20,"proxyConfiguration":{"useApifyProxy":false}}
Video detail and statistics{"mode":"video_detail","videoUrls":["BV1VeHQ6tEaS"],"proxyConfiguration":{"useApifyProxy":false}}
The popular list{"mode":"popular","maxItems":20,"proxyConfiguration":{"useApifyProxy":false}}
Danmaku for a video{"mode":"danmaku","videoUrls":["BV1VeHQ6tEaS"],"maxDanmakuPerVideo":100,"proxyConfiguration":{"useApifyProxy":false}}
Comments for a video{"mode":"comments","videoUrls":["BV1VeHQ6tEaS"],"maxCommentsPerVideo":50,"proxyConfiguration":{"useApifyProxy":false}}
Subtitle languages, or text with a cookie{"mode":"transcript","videoUrls":["BV1VeHQ6tEaS"],"proxyConfiguration":{"useApifyProxy":false}}
An uploader's videos{"mode":"user_videos","userIds":["946974"],"maxItems":5,"proxyConfiguration":{"useApifyProxy":false}}
Uploader profiles{"mode":"profile","userIds":["946974","https://space.bilibili.com/8295295"],"maxItems":2,"proxyConfiguration":{"useApifyProxy":false}}

Pricing

EventPriceWhat counts
video$0.012One search, popular or user_videos row
video-detail$0.02One video_detail row
comment$0.008One delivered comment with non-empty text
danmaku-video$0.01One video that delivers at least one danmaku row, whatever the count
transcript$0.01One delivered transcript row with text, per part and language
profile$0.012One non-empty profile row

That is $12 per 1,000 video rows, $0.01 per danmaku set and $0.01 per transcript with text. The current pricing has no start event. Language-only transcript rows are free, so a run with no cookie and no subtitle text has no event charges.

Input

FieldTypeDefaultLimits and behavior
modestringsearchsearch, video_detail, popular, danmaku, comments, transcript, user_videos or profile
queriesarrayone prefilled queryOne Bilibili video search per entry
videoUrlsarraynoneBV IDs or bilibili.com/video/BV URLs
userIdsarraynoneNumeric mid, space.bilibili.com/
maxItemsinteger1001 through 1000. Maximum per query or user, total for popular, or videos processed after dedupe and delta for videoUrls modes. Profile caps delivered rows across all mids
maxDanmakuPerVideointeger50001 through 10000 danmaku rows per video across all pages
maxCommentsPerVideointeger1001 through 5000 comments per video, including second-level replies
publishedAfterstringnoneInclusive start date, YYYY-MM-DD in UTC, for search and user_videos
publishedBeforestringnoneInclusive end date, YYYY-MM-DD in UTC, for search and user_videos
cookiestringnoneSecret input. A bare SESSDATA value or a full browser cookie string. It unlocks comments past the visitor limit of 3 and subtitle text, and is never logged or stored
deltaModebooleanfalseSkip a mode and bvid pair delivered by an earlier run before detail fetching, or a profile and mid pair before card fetching, and never bill it again
proxyConfigurationobject{"useApifyProxy":true}Datacenter Apify Proxy by default. Custom proxy URLs and disabled proxy are honored

Delta mode

deltaMode true skips items already delivered by an earlier run, tracked in the named key-value store bilibili-scraper-seen. Already delivered means the prior push and charge succeeded and the marker was saved. For danmaku, comments and transcript, the whole video's intended rows must finish before the marker is saved. Failed videos and zero-row results get no marker and are retried next run. A crash between a push and its marker can repeat rows, because the push, the charge and the marker are not one transaction. Completed language-only transcript markers also skip later cookie enabled delta runs, so turn delta off to fetch text that only a cookie unlocks.

Use cases

  • Track what a channel publishes with user_videos and maxItems.
  • Follow the discussion under one video with comments, then read totalComments against the delivered rows.
  • Read the timed comment track for a video with danmaku, billed per video.
  • Collect subtitle text where a cookie unlocks it, through transcript.
  • Build an uploader list from profile rows across several mids.

Integrations

Run it from the Apify API and read the dataset back in the same call:

curl -X POST "https://api.apify.com/v2/acts/agnes.developer.queen~bilibili-scraper/run-sync-get-dataset-items" \
-H "Authorization: Bearer $APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"mode":"search","queries":["Genshin Impact"],"maxItems":20}'

The same call works from Python, Node.js, Make, n8n or Zapier. AI assistants and MCP clients can call the Actor through the Apify MCP server:

https://mcp.apify.com/?tools=agnes.developer.queen/bilibili-scraper

FAQ

No Bilibili account is needed. A SESSDATA session cookie you supply yourself is only needed to go past 3 ordinary comments per video and to get subtitle text. The other six modes run without one, and profile ignores it.

What is danmaku?

Danmaku are the timed comments displayed over a video as it plays. The actor bills one danmaku-video event per video that produced a row, not per row, so a video with 5,000 danmaku rows costs the same as one with a single row.

Can I get subtitles or transcripts?

Without a cookie, transcript returns the language list only, with hasText false, and a video with no listed languages produces no rows. Add a valid login session in cookie to unlock comment pagination and subtitle text, billed per transcript row with text.

How do I get only new videos?

Set deltaMode to true and run on a schedule. Video modes key on mode plus bvid, profile keys on mode plus mid. Items that failed or produced no rows are retried next run.

What does maxItems apply to?

It caps items per query or per user, the popular list in total, and videos processed after dedupe and delta in the videoUrls modes. For profile it caps delivered rows across all mids. The hard cap is 1,000.

Can I filter by upload date?

Yes, with publishedAfter and publishedBefore as YYYY-MM-DD dates in UTC. Both are inclusive, for search and user_videos.

What happens when a request fails?

A transport error on a video is recorded in RUN_SUMMARY.errors, leaves that video unmarked and is retried on the next delta run, with no row charged. user_videos also retries risk-control responses such as -352 with a fresh visitor session before falling back to an author-filtered search.

Why was a row charged?

Every billable event fires only after a successful dataset push, so a charge means the row is in your dataset. An empty result or a failed request costs nothing.

Support

Open an issue on the Issues tab of the Store page with the run ID, your input and RUN_SUMMARY.