DEV Community

Sami
Sami

Posted on

Scraping Bilibili Videos and Creators for Market Research in 2026

Bilibili (哔哩哔哩) is China's premier video platform with 300M+ monthly active users. Think YouTube, but with a younger demographic (Gen Z and millennials), a thriving anime and gaming community, and a unique feature called danmaku (弹幕) — real-time scrolling comments that overlay the video as it plays.

For anyone doing market research on Chinese youth culture, gaming audiences, tech content, or creator economics, Bilibili is one of the richest data sources available. The problem is that there is no official public Bilibili API for international developers. Bilibili's internal APIs are undocumented, require Chinese phone verification, and change frequently.

This article shows how to extract Bilibili videos, comments, creator profiles, and trending content using the zhorex/bilibili-scraper Actor on Apify — no API key, no browser, no proxy required.


TL;DR

  • What: Extract videos, comments, creator profiles, and trending content from Bilibili
  • How: zhorex/bilibili-scraper on Apify — pure HTTP, 256MB RAM
  • Cost: $5 per 1,000 items scraped
  • Auth: None required — all endpoints are public
  • Unique data: Danmaku counts, coin counts (投币), favorites, plus standard engagement metrics

What Makes Bilibili Data Unique

Unlike YouTube or TikTok, Bilibili has platform-specific metrics that this actor captures:

  • Danmaku count (弹幕) — live scrolling comments overlaid on the video. High danmaku signals active community engagement, not just passive viewing
  • Coin count (投币) — Bilibili's tipping system where users "throw coins" at creators. A direct signal of audience appreciation
  • Favorite count (收藏) — equivalent to "save" on other platforms
  • Standard metrics: views, likes, shares, replies

These metrics together give a much richer picture of content performance than views alone.


Five Scraping Modes

1. Search Videos

Search by keyword (Chinese or English). Supports sort and filter options.

{
  "mode": "search",
  "searchQuery": "人工智能教程",
  "sortOrder": "pubdate",
  "maxResults": 50
}
Enter fullscreen mode Exit fullscreen mode

Sort options: totalrank (relevance), click (most views), pubdate (newest), dm (most danmaku), stow (most favorites), scores (most comments).

Duration filters: short (<10min), `medium` (10-30min), `long` (30-60min), `verylong` (>60min).

2. Video Details

Full video info with all engagement metrics and tags.

{
  "mode": "video_detail",
  "videoUrls": [
    "https://www.bilibili.com/video/BV1GJ411x7h7",
    "BV1xx411c7mD"
  ]
}
Enter fullscreen mode Exit fullscreen mode

3. Video Comments

Extract comments with author info and likes.

{
  "mode": "video_comments",
  "videoUrls": ["https://www.bilibili.com/video/BV1GJ411x7h7"],
  "maxComments": 50,
  "sortComments": "hot"
}
Enter fullscreen mode Exit fullscreen mode

Sort options: hot (top/most-liked), time (newest), likes (by like count).

Note: Bilibili throttles comment pagination from datacenter IPs, returning only top/pinned comments. Full comment pagination requires residential IPs or authenticated sessions. Other modes are unaffected.

4. Creator/User Videos

Get user profile info plus their recent videos.

{
  "mode": "user_videos",
  "userIds": ["546195", "1340190821"],
  "maxResults": 30
}
Enter fullscreen mode Exit fullscreen mode

Find a user's mid in their profile URL: space.bilibili.com/{mid}. Multiple users are processed in parallel (up to 3 concurrent).

5. Popular/Trending Videos

Trending videos, filterable by Bilibili category.

{
  "mode": "popular",
  "category": "game",
  "maxResults": 20
}
Enter fullscreen mode Exit fullscreen mode

Available categories: Animation, Music, Dance, Gaming, Knowledge, Tech, Sports, Cars, Life, Food, Animal, Fashion, Entertainment.


Output Example

Video:

{
  "type": "video",
  "bvid": "BV1YXDfBUETP",
  "title": "Example Video Title",
  "url": "https://www.bilibili.com/video/BV1YXDfBUETP",
  "duration": 167,
  "durationFormatted": "2:47",
  "viewCount": 1570113,
  "likeCount": 182455,
  "coinCount": 110535,
  "favoriteCount": 63471,
  "shareCount": 45918,
  "danmakuCount": 7466,
  "replyCount": 17276,
  "authorName": "Creator Name",
  "authorMid": 1340190821,
  "publishDate": "2026-04-08T12:00:00+00:00",
  "category": "Gaming",
  "tags": ["anime", "action", "review"],
  "scrapedAt": "2026-04-10T10:00:00+00:00"
}
Enter fullscreen mode Exit fullscreen mode

User Profile:

{
  "type": "user",
  "mid": 546195,
  "name": "老番茄",
  "fans": 20189060,
  "archiveCount": 652,
  "verified": false,
  "profileUrl": "https://space.bilibili.com/546195",
  "scrapedAt": "2026-04-10T10:00:00+00:00"
}
Enter fullscreen mode Exit fullscreen mode

Use Cases for Market Research

  • Gaming/anime brand monitoring — Track game launches and anime reactions on China's largest anime community
  • Content trend analysis — Identify trending topics in Chinese youth culture and Gen Z interests
  • Creator evaluation — Analyze Bilibili KOLs (Key Opinion Leaders) for partnerships and sponsorships using follower counts, engagement ratios, and content frequency
  • Ad placement research — Understand which categories and content types perform best by danmaku density, coin rates, and view-to-engagement ratios
  • Academic research — Study Chinese digital culture, danmaku behavior, and content consumption patterns
  • Product launch monitoring — Track brand mentions and competitor content in China

Python and JavaScript Integration

Python:

from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")
run = client.actor("zhorex/bilibili-scraper").call(run_input={
    "mode": "search",
    "searchQuery": "人工智能教程",
    "maxResults": 50
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["title"], item["viewCount"], item["danmakuCount"])
Enter fullscreen mode Exit fullscreen mode

JavaScript:

import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });
const run = await client.actor('zhorex/bilibili-scraper').call({
    mode: 'search',
    searchQuery: '人工智能教程',
    maxResults: 50,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => console.log(item.title, item.viewCount));
Enter fullscreen mode Exit fullscreen mode

Technical Details

  • No browser — pure HTTP requests to Bilibili's public APIs
  • No proxy — Bilibili is accessible globally (some licensed content may be geo-restricted)
  • No API key — all endpoints are public
  • 256MB RAM — lightweight and efficient
  • Concurrent fetching — video_detail: up to 5 in parallel; user_videos and video_comments: up to 3 in parallel

Pricing

$0.005 per item scraped ($5 per 1,000 results). Start with Apify's free plan which includes $5 of monthly credits.


Part of the Chinese Digital Intelligence Suite

Bilibili covers video and creator analytics. For full China market coverage, combine with:

All actors: no browser, no proxy, no API keys. Built by Zhorex.


Get Started

https://apify.com/zhorex/bilibili-scraper

Try the popular mode first (no auth needed) to see what is trending on Chinese video right now.

Top comments (0)