Bilibili API: Video Scraper with Stats, Tags and Danmaku avatar

Bilibili API: Video Scraper with Stats, Tags and Danmaku

Pricing

from $4.25 / 1,000 videos

Go to Apify Store
Bilibili API: Video Scraper with Stats, Tags and Danmaku

Bilibili API: Video Scraper with Stats, Tags and Danmaku

Bilibili (B站) videos by keyword search, video URL, creator or trending list: views, likes, coins, favorites, shares, tags and danmaku (bullet comments). No login. $5 per 1,000 videos.

Pricing

from $4.25 / 1,000 videos

Rating

0.0

(0)

Developer

Saulius AutomatesIT

Saulius AutomatesIT

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 minutes ago

Last modified

Share

Bilibili API: videos, stats, tags and danmaku

Get Bilibili (哔哩哔哩) video data in bulk: search by keyword, look up video URLs, pull a creator's latest uploads, or grab the trending lists. Every video comes with views, likes, coins, favorites, shares, danmaku and comment counts, tags, duration, publish date and creator. Add danmaku (弹幕, the bullet comments that fly across the video) with the second of the video each one appears at.

No Bilibili account, no cookies of yours, no browser. $5 per 1,000 videos, danmaku $0.20 per 1,000.

What you can use it for

  • Trend and market research in China: what is rising on Bilibili for a topic, game, product or brand, sorted by views, newest or most danmaku.
  • Creator and influencer research: a creator's latest videos with engagement, plus their follower count, for KOL shortlists.
  • Brand monitoring: schedule a daily keyword run and see new videos about your brand as they appear.
  • Audience reaction: danmaku shows what viewers said at each moment of a video, ready for sentiment analysis or an LLM.
  • Daily trending snapshots: the Popular list and the Top 100 ranking, saved every day.

How to use it

  1. Fill any mix of Search keywords, Video URLs, Creators or a Trending list.
  2. Optional: Sort search by (relevance, most views, newest, most danmaku, most favorites) and how many videos to keep.
  3. Optional: Full stats and tags for every video and Include danmaku.
  4. Run it and download the results as JSON, CSV or Excel, or read them through the API.

Input example

{
"searchQueries": ["minecraft", "原神"],
"sortBy": "views",
"maxVideosPerSearch": 100,
"creators": ["https://space.bilibili.com/2"],
"trending": "ranking",
"includeDanmaku": true,
"maxDanmakuPerVideo": 100
}

Output

One item per video:

{
"type": "video",
"bvid": "BV1zmYP6aEdH",
"aid": "117363672351162",
"url": "https://www.bilibili.com/video/BV1zmYP6aEdH",
"title": "我———问你为什么要折断奥特钥匙!!!(大结局下)",
"thumbnailUrl": "https://i0.hdslb.com/bfs/archive/c2c33ea113452198230ba208d119f9b85c005a0a.jpg",
"durationSeconds": 713,
"publishedAt": "2026-10-01T04:09:58.000Z",
"category": "特摄",
"tags": ["奥特曼", "鬼畜", "搞笑", "赛罗", "特摄"],
"authorName": "百火哥斯拉",
"authorId": "3461573133732544",
"authorUrl": "https://space.bilibili.com/3461573133732544",
"views": 2415970,
"likes": 309605,
"coins": 350424,
"favorites": 162084,
"shares": 34130,
"danmakuCount": 123836,
"commentCount": 52371,
"source": "ranking",
"position": 1,
"scrapedAt": "2026-10-03T16:51:59.323Z"
}

And, with Include danmaku, one item per danmaku:

{
"type": "danmaku",
"bvid": "BV1CrHe6ZEvk",
"videoUrl": "https://www.bilibili.com/video/BV1CrHe6ZEvk",
"text": "萌趣的世界才受大众喜爱",
"videoTimeSeconds": 35.212,
"sentAt": "2026-10-03T16:43:14.000Z",
"mode": "scroll",
"color": "#ffffff",
"fontSize": 25,
"senderHash": "55f5d787"
}
  • source says where the video came from (search, video, creator, popular, ranking), with searchQuery or creatorId and the position in that list.
  • Search, creator and trending lists give views, likes, favorites and the basics. Coins, shares, comment count and full tags need Full stats and tags (single video URLs always have them).
  • For creator lookups, creatorId and creatorFollowers are the creator you asked for. A collab video on their page can have another creator as authorName.
  • category comes from search and trending lists; single video lookups leave it empty.
  • senderHash is Bilibili's anonymous hash of the sender, not a user id.

The run summary (videos and danmaku delivered, videos not found, failures) is saved as OUTPUT in the run's key-value store. Results are in the dataset's Videos and Danmaku views.

Pricing

Pay per result, no subscription:

EventPrice
Video$0.005 ($5 per 1,000 videos)
Danmaku$0.0002 ($0.20 per 1,000)
Actor start$0.00005

1,000 videos with full stats cost $5. 100 videos with 200 danmaku each cost $0.50 + $4. Videos that don't exist cost nothing. Bronze, Silver and Gold Apify plans get 5%, 10% and 15% off. Proxy and compute are included.

Use it from code

API (cURL)

curl -X POST "https://api.apify.com/v2/acts/sauliusautomatesit~bilibili-api/run-sync-get-dataset-items?token=YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"searchQueries": ["minecraft"], "maxVideosPerSearch": 20}'

Python

from apify_client import ApifyClient
client = ApifyClient("YOUR_TOKEN")
run = client.actor("sauliusautomatesit/bilibili-api").call(run_input={
"searchQueries": ["minecraft"],
"sortBy": "views",
"maxVideosPerSearch": 100,
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(item["views"], item["title"], item["url"])

JavaScript

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_TOKEN' });
const run = await client.actor('sauliusautomatesit/bilibili-api').call({ trending: 'ranking' });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.map((v) => `${v.position}. ${v.title} (${v.views} views)`));

MCP (Claude, Cursor, any MCP client)

Add https://mcp.apify.com/?tools=sauliusautomatesit/bilibili-api as a remote MCP server and your agent can search Bilibili as a tool.

Limits, honestly

  • Search goes 1,000 videos deep per keyword (50 pages of 20), which is as far as Bilibili search goes. Use several narrower keywords or other sort orders for more.
  • Comments are not included. Bilibili shows only 3 comments per video to visitors who aren't logged in; you get the comment count. Danmaku is fully available.
  • Danmaku: Bilibili serves the latest few hundred to a few thousand danmaku per video depending on its length, and the Actor keeps up to 1,000, newest first. Older danmaku archives need a login.
  • Creator lookups return the creator's videos newest first; very large back catalogues can be read up to the number you set.
  • Bilibili rate-limits busy IPs. The Actor switches IP and asks again, so big runs stay reliable but take a little longer.

FAQ

Do I need a Bilibili account? No. Everything comes from Bilibili's public pages as a visitor.

Does it work with Chinese keywords? Yes, any language. Titles, tags and danmaku come back in the original language.

Can I track the same keyword or creator every day? Yes. Save the input as a task and schedule it; each run returns the current numbers.

How fast is it? About 20 videos a second for lists, slower with full stats or danmaku, 4 tasks in parallel by default (up to 10).

Is it legal? It collects publicly visible video data. You are responsible for how you use the data and for complying with the laws that apply to you.