Bilibili Scraper — videos, stats, search & comments
Pricing
from $0.005 / actor start
Bilibili Scraper — videos, stats, search & comments
Scrape Bilibili (B站) videos with no login or cookies: keyword search, popular, rankings, uploader channels or video URLs. Get views, likes, coins, favorites, shares, danmaku, comment counts, tags, uploader, duration and top comments. Bilibili API alternative. Export JSON, CSV, Excel.
Pricing
from $0.005 / actor start
Rating
0.0
(0)
Developer
Istmobot
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
2 days ago
Last modified
Categories
Share
Bilibili Scraper & Bilibili API — video data, stats, search & comments (B站)
Scrape Bilibili video data at scale: views, likes, coins, favorites, shares, danmaku counts, comment counts, tags, uploader info, duration, publish date and top comments for any video on Bilibili (B站), China's largest video platform for Gen Z. Use it as an unofficial Bilibili API for keyword search, the popular feed, the official rankings, an uploader's channel or your own list of video URLs.
What is Bilibili Scraper?
Bilibili Scraper is a Bilibili scraper that turns Bilibili's public web endpoints into one clean, flat record per video, in English field names, ready for spreadsheets, BI tools and AI pipelines.
- No login, no cookies, no API key, no browser. It reads the same public data a logged-out visitor sees.
- Handles Bilibili's anti-bot layer for you: anonymous
buvid3session, WBI request signing, and automatic retries with backoff when Bilibili's risk control (-412/-352) kicks in. - Five modes: keyword search, specific videos, popular now, ranking (排行榜, overall or by category) and uploader (UP主) videos.
- Same output in every mode: every video is enriched with full stats from the video detail endpoint, so search results, rankings and channels all share one schema.
- Polite by design: concurrency of 3, requests spaced out, exponential backoff on errors.
- Download your data as JSON, CSV, Excel, HTML or XML, or read it via the Apify API.
What data can I extract with Bilibili Scraper?
| Field | Description |
|---|---|
bvid / aid | Bilibili video ids (BV id and legacy av id) |
title / description | Video title and description, plain text |
url / thumbnail | Video page URL and cover image |
duration | Length in seconds |
publishedAt | Publish time, ISO 8601 (UTC) |
category / categoryId | Bilibili partition (分区) name and id |
tags | Video tags (optional, on by default) |
parts / isOriginal | Number of parts (P) and whether it is marked as original (自制) |
owner | Uploader: mid, name, face (avatar) |
stats.views | Plays (播放) |
stats.likes / stats.coins / stats.favorites / stats.shares | Likes (点赞), coins (投币), favorites (收藏), shares (分享) |
stats.danmaku | Danmaku (弹幕) bullet-comment count |
stats.comments | Comment count (评论) |
comments | Optional top comments: text, likes, reply count, author, date |
scrapedAt | When the record was collected |
How can I use Bilibili data?
- Global brands & marketers — find and vet Chinese creators (KOLs / UP主) by real engagement (coins and favorites are strong intent signals), then track campaign videos daily.
- Game, anime and music publishers — monitor how your titles perform in China: search volume, rankings, danmaku activity and comment sentiment.
- Market researchers & analysts — follow trends on the Chinese video platform through the popular feed and category rankings.
- Agencies in China and Asia — export creator channels and competitor videos to Excel for reports.
- Data scientists & AI teams — build datasets of Chinese video titles, tags and comments for NLP and recommendation work.
- Trend trackers — schedule the ranking or popular mode hourly to build your own Bilibili trend history.
How to scrape Bilibili
- Click Try for free on this Actor's page (you need a free Apify account).
- Choose a Mode: search by keyword, specific videos, popular now, ranking or uploader's videos.
- Fill in a search term, video URLs, a ranking category or uploader ids, and set Max videos.
- Optionally turn on Include top comments.
- Click Start. The default input searches for "原神" (Genshin Impact) and returns 20 videos in under a minute.
- Download the dataset as JSON, CSV, Excel or HTML, or connect it to your tools via the API.
How much does it cost to scrape Bilibili?
This Actor uses pay-per-event pricing, so you only pay for the videos you actually get:
| Event | Price |
|---|---|
| Actor start | $0.005 per run |
video-result (one video in the dataset) | $0.002 per video = $2 per 1,000 videos |
Tags and top comments are included at no extra charge. Error items (invalid ids, deleted or private videos, blocked requests) are never charged.
Example: 1 run × 1,000 videos = $0.005 + $2.00 = $2.005.
The Apify free plan includes $5 of monthly credit, which covers roughly 2,500 videos per month. You can set a maximum cost per run; once it is reached the Actor stops cleanly and keeps everything scraped so far.
⬇️ Input
| Field | Type | Default | Description |
|---|---|---|---|
mode | search | videos | popular | ranking | user | search | What to scrape (required) |
searchTerm | string | — | search mode: keyword in Chinese or English, e.g. 原神, minecraft |
searchOrder | totalrank | click | pubdate | dm | stow | totalrank | search mode: relevance, most viewed, newest, most danmaku, most favorited |
videoUrls | list of strings | — | videos mode: BV ids, av ids or bilibili.com/video/... URLs |
rankingCategory | string | 0 | ranking mode: 0 all, 1001 Film & TV, 1002 Entertainment, 1003 Music, 1004 Dance, 1005 Animation, 1007 Kichiku, 1008 Games, 1010 Knowledge, 1012 Tech, 1013 Cars, 1014 Fashion & beauty, 1018 Sports, 1020 Food, 1024 Animals |
userIds | list of strings | — | user mode: uploader ids (mid) or space.bilibili.com/... URLs |
maxItems | integer | 50 | Max videos in search / popular / ranking mode, and per uploader in user mode (ignored in videos mode) |
includeTags | boolean | true | Add video tags |
includeComments | boolean | false | Add top comments |
maxComments | integer | 3 | Comments per video (logged-out access returns at most 3) |
{"mode": "search","searchTerm": "原神","searchOrder": "totalrank","maxItems": 20,"includeTags": true,"includeComments": true}
Top 100 gaming videos of the last 3 days: { "mode": "ranking", "rankingCategory": "1008", "maxItems": 100 }
An uploader's latest 50 uploads: { "mode": "user", "userIds": ["https://space.bilibili.com/632887"], "maxItems": 50 }
⬆️ Output
One item per video. The Overview table view in Apify Console shows thumbnail, title, uploader, views, likes, coins, favorites, danmaku, comments, duration and category at a glance. Real sample from a search run for "原神":
{"bvid": "BV1aFHh6FEPz","aid": 117374845977393,"title": "丘丘人化的申鹤😭【原神动画】(补档)","description": "","url": "https://www.bilibili.com/video/BV1aFHh6FEPz","thumbnail": "https://i1.hdslb.com/bfs/archive/333cc0b0d502ffb4f46d9ac57d9abc5db90dee52.jpg","duration": 256,"publishedAt": "2026-10-03T03:30:01.000Z","category": "网络游戏","categoryId": 65,"tags": ["二次元", "催眠", "原神动画", "原神六周年", "闲云", "恶魔化", "黑化", "原神", "申鹤", "丘丘人"],"parts": 1,"isOriginal": true,"owner": {"mid": 88942930,"name": "缔元破里","face": "https://i1.hdslb.com/bfs/face/a47e85084d60a9b9d2fed3f4f88c3f4e60913e8b.jpg"},"stats": {"views": 108089,"likes": 3617,"coins": 469,"favorites": 5402,"shares": 520,"danmaku": 248,"comments": 283},"comments": [{"id": "319426208000","text": "瓦学妹有机会吗?[妙啊][妙啊]","likes": 137,"replies": 4,"author": { "mid": 695876349, "name": "被占用lD的木瓜桑" },"createdAt": "2026-10-03T03:44:35.000Z"}],"scrapedAt": "2026-10-05T02:30:20.920Z"}
Notes on fields:
durationis in seconds.publishedAt,createdAtandscrapedAtare UTC (Beijing time is UTC+8).categoryis Bilibili's partition name in Chinese;categoryIdis its id.commentsis present only withincludeComments: true. Bilibili shows logged-out visitors the top 3 hot comments per video;[妙啊]-style text is Bilibili's emoji markup.tagsisnullwithincludeTags: false.
Error items
{ "input": "BV1AAAAAAAAA", "url": "https://www.bilibili.com/video/BV1AAAAAAAAA", "errorType": "API_ERROR", "error": "code -400: 请求错误" }
errorType is NOT_FOUND (deleted, private or region-locked video), INVALID_VIDEO_ID, INVALID_USER_ID, RISK_CONTROL (Bilibili kept blocking after all retries), API_ERROR, FETCH_FAILED or LISTING_FAILED. Error items are never charged.
Integrations and API
Apify API — start a run and get results over HTTP:
curl -X POST "https://api.apify.com/v2/acts/istmobot~bilibili-scraper/run-sync-get-dataset-items?token=<YOUR_API_TOKEN>" \-H "Content-Type: application/json" \-d '{"mode": "ranking", "rankingCategory": "0", "maxItems": 20}'
Python (pip install apify-client):
from apify_client import ApifyClientclient = ApifyClient("<YOUR_API_TOKEN>")run = client.actor("istmobot/bilibili-scraper").call(run_input={"mode": "search","searchTerm": "minecraft","maxItems": 50,})for video in client.dataset(run["defaultDatasetId"]).iterate_items():print(video.get("title"), video.get("stats", {}).get("views"))
Node.js (npm install apify-client):
import { ApifyClient } from 'apify-client';const client = new ApifyClient({ token: '<YOUR_API_TOKEN>' });const run = await client.actor('istmobot/bilibili-scraper').call({mode: 'user',userIds: ['632887'],maxItems: 30,});const { items } = await client.dataset(run.defaultDatasetId).listItems();console.log(items);
- Schedules — run it hourly or daily to track rankings, creator channels and video stats over time.
- Webhooks — get notified or trigger your own pipeline when a run finishes.
- Make, Zapier, n8n — send Bilibili data to Google Sheets, Airtable, Slack or a database without code.
- AI agents — use it from Claude, ChatGPT or any MCP client via the Apify MCP server (https://mcp.apify.com).
FAQ
Is it legal to scrape Bilibili? This Actor only reads publicly available data that any logged-out visitor can see, does not log in and does not bypass any paywall. Public data is generally fine to collect, but uploader names, avatars and comments are personal data / user-generated content — if you store or process them, be mindful of GDPR, China's PIPL and similar laws. You are responsible for using the data in line with applicable laws and Bilibili's terms; if unsure, consult a lawyer.
Do I need a Bilibili account, cookies or an API key? No. No login, no cookies and no key. The Actor creates an anonymous visitor session by itself.
Why only 3 comments per video? Bilibili limits logged-out visitors to the top 3 hot comments. Getting more requires a logged-in account, which this Actor deliberately does not use. The total comment count is always in stats.comments.
What are coins and danmaku? Coins (投币) are a limited currency viewers give to videos they value, a strong engagement signal unique to Bilibili. Danmaku (弹幕) are the bullet comments that fly across the video.
What is "risk control" (-412 / -352)? Bilibili's anti-bot system. The Actor signs requests the way the website does, retries with exponential backoff and a fresh anonymous session; if a request is still blocked you get a free RISK_CONTROL error item instead of a silent gap.
How many search results can I get? Bilibili caps search at 50 pages × 20 = 1,000 videos per keyword. Use several keywords or searchOrder to go beyond that. Rankings return up to 100 videos.
How fast is it? Requests are deliberately spaced out to stay under Bilibili's risk control: roughly 2 videos per second with tags, so 100 videos take about a minute. Comments add one request per video.
Does it work outside China? Yes. It runs on Apify's servers, no Chinese IP or proxy needed. A few region-locked videos may return NOT_FOUND.
Can I schedule it? Yes. Use Apify Schedules to run it on any cron interval and combine with webhooks or integrations to push the results wherever you need them.
Other Actors you might like
Your feedback
Found a bug or want a new field? Open an issue in the Issues tab of this Actor — we read every one.
Disclaimer
This is an unofficial tool. It is not affiliated with, endorsed by or sponsored by Bilibili Inc. (哔哩哔哩).