Bilibili Scraper: Videos, Danmaku & Comments avatar

Bilibili Scraper: Videos, Danmaku & Comments

Pricing

from $1.49 / 1,000 videos

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

Bilibili Scraper: Videos, Danmaku & Comments

Scrape Bilibili (B站) videos with views, likes, coins, favorites and tags, plus danmaku (弹幕) with their time in the video, top comments and replies, and UP主 creator profiles. Search by keyword, video link or UID. No login or cookies. $1.49 per 1,000 videos.

Pricing

from $1.49 / 1,000 videos

Rating

0.0

(0)

Developer

CleanScrape

CleanScrape

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

3 hours ago

Last modified

Share

Bilibili Scraper

Collect Bilibili (哔哩哔哩, B站) data without an account:

  • Videos: title, description, cover, publish time, length, category, creator (UP主), views, likes, coins, favorites, shares, comment and danmaku counts, and tags.
  • Danmaku (弹幕): the bullet comments Bilibili's player loads, each with its time in the video, text, colour, mode and the time it was sent.
  • Top comments (评论): the top comments and the first 20 replies under each, with likes and dates.
  • Creators (UP主): followers, video count, likes, level, verification and public collections.

Start from search terms, video links, creator links or UIDs, or paste the text the Bilibili app copies with Share > Copy link. No Bilibili account, login or cookies needed.

$1.49 per 1,000 videos. Comments $0.49 per 1,000 and danmaku $0.10 per 1,000, only when you turn them on. No start fee. Maintained by CleanScrape.

中文简介: 无需登录、无需 Cookie。按关键词、视频链接(BV号、av号、b23.tv 分享链接或 App 复制的分享文字)或 UP主(空间链接、UID)采集哔哩哔哩数据:视频信息及播放、点赞、投币、收藏、分享数据,弹幕(含出现时间),热门评论及回复,UP主资料。可导出 Excel、CSV 或 JSON。时间均为 UTC(北京时间 = UTC+8)。每 1,000 个视频 1.49 美元。

Why this one is fast without getting blocked

Bilibili limits how fast one visitor can read each kind of data, and it blocks an IP for minutes to an hour when that limit is crossed. We measured those limits field by field. This Actor:

  • spreads the work over several connections (proxy IPs) at once, up to 10;
  • keeps every connection under the measured pace for each field (details, tags, comments, danmaku, search);
  • moves work to the other connections when Bilibili refuses one, and never retries aggressively or tries to get around Bilibili's checks;
  • remembers which proxy IPs are refused for which field, so the next run skips them.

Measured in our tests:

JobTime
100 videos with tags (the default input)45 seconds
1,000 videos from 50 search terms7 minutes
236 videos from two creators' collections75 seconds
1,889 videos with tags, related videos, top comments, replies and danmaku (133,737 rows)23 minutes

On the run's own single connection the same work is several times slower (about 17 videos a minute instead of over 100).

Quick start

  1. Type a search term under Search terms, for example 咖啡 (coffee). Chinese terms find more videos than English ones.
  2. Choose the extra data under Data to collect for each video. Video details and statistics are always included.
  3. Start the run. Open Output and pick Videos, Comments, Danmaku or Creators from the menu: each is its own table.
  4. To download, open Storage > Dataset, choose the table in the Dataset menu, pick CSV, Excel or JSON and select Download. The Export button at the top downloads the videos.

JSON input example:

{
"searchQueries": ["咖啡"],
"maxVideosPerQuery": 100,
"includeComments": true,
"includeDanmaku": true,
"maxDanmakuPerVideo": 500
}

Other ways to start:

You havePut it inYou get
Search termsSearch termsUp to 1,000 videos per term, in Bilibili's relevance order
Video links, BV ids, av ids, b23.tv links, or the text the app copies with Share > Copy linkVideo linksThose videos. Short links that have expired are reported in the run summary
Creator links (space.bilibili.com/…), UIDs such as 546195, or creator links shared from the appCreator linksA profile row per creator, plus the videos in their public collections and series

Choose a ready-to-run example

Open one, change the search term or link, and start it. Each example runs in about a minute.

Use it from the API

Run it from Python with the Apify client (pip install apify-client):

from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("cleanscrape/bilibili-scraper").call(run_input={
"searchQueries": ["咖啡"],
"maxVideosPerQuery": 50,
"includeDanmaku": True,
"maxDanmakuPerVideo": 200,
})
datasets = run["storageIds"]["datasets"] # default (videos), comments, danmaku, creators
for video in client.dataset(datasets["default"]).iterate_items():
print(video["videoId"], video["views"], video["title"])
for danmaku in client.dataset(datasets["danmaku"]).iterate_items():
print(danmaku["videoId"], danmaku["timeInVideoSeconds"], danmaku["text"])

Videos are in the run's default dataset. Comments, danmaku and creators each have their own dataset, listed under storageIds.datasets in the run object, and every row carries the videoId (or creatorId) to join them. The same input works from JavaScript, the REST API, schedules and integrations.

What you get

Each kind of row has its own table (dataset): Videos, Comments, Danmaku and Creators. Comment and danmaku rows carry the video's BV id, so you can join them to the videos. Ids are stored as text so spreadsheets do not round them.

Row typeFields
VideoBV id, av id, title, description, cover, published time, length, parts, category, creator, views, likes, coins, favorites, shares, comment count, danmaku count, tags, related video ids, the search term and rank that found it
CommentVideo id, comment text, likes, reply count, posted time, author name, id and level, pinned flag, and for replies the comment they answer
DanmakuVideo id, part, time in the video, text, mode (scrolling, top, bottom), colour, font size, sent time, Bilibili's anonymised sender code
CreatorName, id, link, bio, level, followers, following, video count, likes, verification, public collections and series

What Bilibili shows without login

This Actor collects what Bilibili shows a logged-out visitor. That means:

  • Comments are a sample. Without login Bilibili shows the top comments of a video (usually 3) and the first 20 replies under each. The video row's comments column has the full count. If you need every comment of a video, this Actor is not the right tool.
  • Creator videos come from public collections and series. Bilibili does not list a creator's full upload history to logged-out visitors. Many creators organise their videos in collections; creators who don't will have a profile row and a note in the run report.
  • Category names are filled for videos found by search. For videos from links Bilibili leaves the name empty, so you get the category number.
  • Danmaku is the list Bilibili's player loads for each video part, up to its limit (often 1,000–3,000 for popular videos).

Pricing

WhatPriceWhen
Video$1.49 per 1,000Every saved video, with details, statistics and the tags or related videos you selected
Creator$1.49 per 1,000Every saved creator profile
Comment$0.49 per 1,000Every saved comment or reply, only when comments are on
Danmaku$0.10 per 1,000Every saved danmaku, only when danmaku is on

Examples at base prices: 100 videos with tags cost $0.15. 100 videos with top comments and replies cost about $0.64 to $1.40, because popular videos have more replies (10 to 25 comment rows per video in our tests). Danmaku adds $0.10 for every 1,000 danmaku rows; Danmaku per video caps it.

Platform usage is included. Your spending limit is respected: the Actor stops cleanly just before it is reached and says so in the run status. If a run is interrupted and restarted, already saved rows are not saved or charged again.

Speed settings

Parallel connections (default 8) sets how many proxy IPs the run uses at once. Each one keeps to Bilibili's pace, so more connections finish sooner.

  • The Actor uses your Apify Proxy. Free Apify plans include 5 datacenter IPs; extra connections are skipped automatically.
  • The datacenter proxy is enough. Residential proxies are not needed and cost more.
  • Running several runs at the same time shares the same proxy IPs, so one larger run is better than many parallel ones.
  • 0 uses only the run's own connection. It works, but slowly, and danmaku in particular is often refused on that connection.

The run stops shortly before its timeout and ends normally, keeping everything it saved. Videos still being collected at that moment are not saved half-finished, so you are never charged for a video without the fields you asked for. The default timeout is one hour; give runs at least 2 minutes, and raise the timeout under Run options for very large runs.

Run report

Each run saves a readable summary (Output > Run summary) with what was found per input, how many requests each field needed and whether Bilibili refused any. If Bilibili refused every connection for a field (for example danmaku), the videos are still saved and the summary and run status say which field is missing.

Common questions

Is there an official Bilibili API?

Bilibili's open platform is for approved partners and for creators managing their own accounts. It is not a general API for reading any video's data. This Actor reads what the Bilibili website shows a logged-out visitor and returns it as rows you can export, or fetch from the Apify API, Python or JavaScript.

Do I need a Bilibili account or cookies?

No. Nothing is logged in and no cookies are needed. You need an Apify account to run the Actor.

How do I export Bilibili videos or danmaku to Excel or CSV?

Type a search term or paste video or creator links, turn on the data you want, and start the run. Then open Storage > Dataset, choose Default (videos), Comments, Danmaku or Creators in the Dataset menu, pick CSV, Excel or JSON and select Download. Each is its own table, so a download holds one kind of row. The Export button at the top of the run downloads the videos.

How much does it cost to scrape Bilibili?

$1.49 per 1,000 videos or creators, $0.49 per 1,000 comments and $0.10 per 1,000 danmaku, with no start fee and platform usage included. 100 videos with tags cost about $0.15. See Pricing above.

Can I get every comment on a video?

No. Without login Bilibili shows only the top comments (usually 3) and the first 20 replies under each. The video row has the full comment count.

Does it work for bilibili.tv (the international site)?

No, this Actor is for bilibili.com.

Why are there fewer videos than I asked for?

Bilibili shows at most 1,000 results per search term, removed or private videos are skipped (the run report counts them), and creators without public collections have no video list.

Is the data in Chinese?

Titles, descriptions, tags and comments are as written on Bilibili, mostly in Chinese. Column names are in English, with Bilibili's own terms next to the main ones, such as Creator (UP主), Coins (投币) and Favorites (收藏). Times are in UTC; Beijing time is UTC+8.

Yes. In the app, tap Share > Copy link (分享 > 复制链接) and paste the whole text: the title in brackets and the b23.tv link. It works for videos and for creator pages. If a creator's link ends up under Video links, or a video's under Creator links, it is still collected.

The Actor collects only what Bilibili shows publicly to any visitor, at a pace Bilibili accepts. Comment and danmaku rows can include public user names and codes, which can be personal data. How you store and use the data must follow the laws that apply to you, such as the GDPR or China's PIPL, and Bilibili's terms. This is not legal advice.

Questions or a reproducible issue: contact.cleanscrape@gmail.com. CleanScrape is independent of Bilibili and Apify.

More tools from CleanScrape