Bilibili Scraper — videos, stats, search & comments avatar

Bilibili Scraper — videos, stats, search & comments

Pricing

from $0.005 / actor start

Go to Apify Store
Bilibili Scraper — videos, stats, search & comments

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

Istmobot

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 days ago

Last modified

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 buvid3 session, 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?

FieldDescription
bvid / aidBilibili video ids (BV id and legacy av id)
title / descriptionVideo title and description, plain text
url / thumbnailVideo page URL and cover image
durationLength in seconds
publishedAtPublish time, ISO 8601 (UTC)
category / categoryIdBilibili partition (分区) name and id
tagsVideo tags (optional, on by default)
parts / isOriginalNumber of parts (P) and whether it is marked as original (自制)
ownerUploader: mid, name, face (avatar)
stats.viewsPlays (播放)
stats.likes / stats.coins / stats.favorites / stats.sharesLikes (点赞), coins (投币), favorites (收藏), shares (分享)
stats.danmakuDanmaku (弹幕) bullet-comment count
stats.commentsComment count (评论)
commentsOptional top comments: text, likes, reply count, author, date
scrapedAtWhen 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

  1. Click Try for free on this Actor's page (you need a free Apify account).
  2. Choose a Mode: search by keyword, specific videos, popular now, ranking or uploader's videos.
  3. Fill in a search term, video URLs, a ranking category or uploader ids, and set Max videos.
  4. Optionally turn on Include top comments.
  5. Click Start. The default input searches for "原神" (Genshin Impact) and returns 20 videos in under a minute.
  6. 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:

EventPrice
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

FieldTypeDefaultDescription
modesearch | videos | popular | ranking | usersearchWhat to scrape (required)
searchTermstring—search mode: keyword in Chinese or English, e.g. 原神, minecraft
searchOrdertotalrank | click | pubdate | dm | stowtotalranksearch mode: relevance, most viewed, newest, most danmaku, most favorited
videoUrlslist of strings—videos mode: BV ids, av ids or bilibili.com/video/... URLs
rankingCategorystring0ranking 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
userIdslist of strings—user mode: uploader ids (mid) or space.bilibili.com/... URLs
maxItemsinteger50Max videos in search / popular / ranking mode, and per uploader in user mode (ignored in videos mode)
includeTagsbooleantrueAdd video tags
includeCommentsbooleanfalseAdd top comments
maxCommentsinteger3Comments 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:

  • duration is in seconds. publishedAt, createdAt and scrapedAt are UTC (Beijing time is UTC+8).
  • category is Bilibili's partition name in Chinese; categoryId is its id.
  • comments is present only with includeComments: true. Bilibili shows logged-out visitors the top 3 hot comments per video; [妙啊]-style text is Bilibili's emoji markup.
  • tags is null with includeTags: 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 ApifyClient
client = 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. (哔哩哔哩).