Bilibili Video Scraper —Videos, Comments, & Danmaku
Pricing
from $5.00 / 1,000 scraped results
Bilibili Video Scraper —Videos, Comments, & Danmaku
Scrape Bilibili video details, including title, description, creator information, engagement statistics, danmaku bullet comments, and top video comments. Export all collected data to an Apify Dataset in JSON format.
Pricing
from $5.00 / 1,000 scraped results
Rating
0.0
(0)
Developer
Data Pilot
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
6 days ago
Last modified
Categories
Security
Limited permissionsShare
📺 Bilibili Video Scraper — Videos, Comments & Danmaku is a powerful Apify Actor designed to extract video details, top comments, and live bullet comments (danmaku) from any public Bilibili video. This tool provides comprehensive Bilibili Video Scraper intelligence including title, description, creator, views, likes, coins, favorites, shares, comments, and danmaku text with timestamps. Whether you're analyzing audience reactions, researching content trends, or collecting data for social listening, the Bilibili Video Scraper delivers structured insights efficiently.
With simple BV ID or video URL input, visitor-cookie setup, danmaku XML parsing, comment extraction, and reliable Apify Dataset delivery, this Bilibili Video Scraper actor turns one video into a clean dataset of metadata, comments, and bullet comments. It focuses on key engagement signals including views, likes, coins, and audience reactions, making Bilibili Video Scraper an essential tool for video analytics and audience research.
📋 Table of Contents
- Features
- Data Source
- How It Works
- Input
- Output
- Technical Stack
- Data Fields
- Use Cases
- Quick Start
- Configuration
- Performance
- Important Notes
- License & Legal
🔥 Features
- Video Metadata Extraction – Collects title, description, creator, publish date, duration, cover image, and engagement stats. This is the core of Bilibili Video Scraper.
- Danmaku (Bullet Comment) Extraction – Parses the video's danmaku XML to capture comment text, timestamp in the video, and font color.
- Top Comment Extraction – Collects top comments with author, likes, reply count, and publish date.
- URL or BV ID Input – Accepts a full Bilibili video URL or a plain BV ID and extracts the BV ID automatically.
- Engagement Stats – Captures views, likes, coins, favorites, shares, and danmaku count for each video.
- Visitor Cookie Setup – Creates visitor cookies before requests to reduce Bilibili's anti-bot blocking (error -412).
- Clean Text Output – Strips HTML tags and decodes HTML entities from titles, descriptions, and comments.
- Configurable Item Limit – Control how many danmaku and comments to collect with
maxComments. - Apify Proxy Support – Optional Apify Proxy for reliable Bilibili Video Scraper access.
- Proxy Fallback Handling – Automatically retries without a proxy if a proxied request fails with an error.
- Single-Batch Dataset Push – Pushes all records to the Apify Dataset together once collection completes.
- Detailed Logging – Logs proxy status, scraping progress, and completion for every Bilibili Video Scraper run.
📊 Data Source
Bilibili Public Endpoints
- Video details:
https://api.bilibili.com/x/web-interface/view - Danmaku (bullet comments):
https://comment.bilibili.com/{cid}.xml - Comments:
https://api.bilibili.com/x/v2/reply - Access Method: Browser-impersonated HTTP requests via
curl_cffi(Chrome 124 fingerprint) with visitor cookies, parsing JSON and XML responses - Coverage: Public Bilibili videos
- Data: Video metadata, engagement statistics, danmaku, and top-level comments
- Access: Public endpoints, no login or API key required
- Update Frequency: Reflects live data at time of run
⚙️ How It Works
The Bilibili Video Scraper accepts one video URL or BV ID. It sets up visitor cookies, fetches the video details, then uses the video's cid to download danmaku and its aid to download top comments. Everything is combined into one list of records and pushed to the Apify Dataset as a single batch.
Key Processing Steps:
- Input Parsing – Read
videoUrlOrBvidandmaxComments - BV ID Extraction – Pull the
BV...ID out of a URL, or use the value as given - Proxy Setup – Configure Apify Proxy if enabled, with automatic direct-connection fallback
- Cookie Setup – Create visitor cookies and visit the Bilibili home page
- Video Details – Fetch metadata and stats, and build a
video_metarecord - Danmaku – Download the danmaku XML using
cidand builddanmakurecords - Comments – Fetch top comments using
aidand buildcommentrecords - Dataset Push – Push all Bilibili Video Scraper records at once
- Summary Logging – Report the total number of items pushed
Key Benefits:
- Get video stats, comments, and danmaku in one run
- Use a URL or BV ID, whichever you have
- Receive one dataset with a
typefield to filter records easily - Automate recurring Bilibili Video Scraper runs to track engagement over time
📥 Input
The Actor accepts the following input parameters:
| Field | Type | Default | Description |
|---|---|---|---|
videoUrlOrBvid | string | "BV1uv411q7Mv" | Bilibili video URL or BV ID. |
maxComments | integer | 30 | Maximum number of danmaku and of comments to collect (each capped at 50). |
proxyConfiguration | object | {"useApifyProxy": true} | Apify Proxy configuration. |
Example Input:
{"videoUrlOrBvid": "BV1uv411q7Mv","maxComments": 30}
Using a Full Video URL:
{"videoUrlOrBvid": "https://www.bilibili.com/video/BV1uv411q7Mv","maxComments": 50}
Run Without Proxy:
{"videoUrlOrBvid": "BV1uv411q7Mv","maxComments": 20,"proxyConfiguration": {"useApifyProxy": True}}
📤 Output
The Actor pushes Bilibili Video Scraper records of three types, identified by the type field.
video_meta record (1 per run)
| Field | Type | Description |
|---|---|---|
type | string | "video_meta" |
bvid | string | The video's BV ID |
aid | string | The video's numeric AV ID |
title | string | Cleaned video title |
description | string | Cleaned video description |
creator_name | string | Uploader name |
creator_mid | string | Uploader's user ID |
views | integer | View count |
likes | integer | Like count |
coins | integer | Coin count |
favorites | integer | Favorite count |
shares | integer | Share count |
danmaku_count | integer | Total danmaku reported by Bilibili |
duration_seconds | integer | Video length in seconds |
pubdate | string | Publish time in UTC (YYYY-MM-DD HH:MM:SS), or "N/A" |
url | string | Video page URL |
cover_url | string | Cover image URL |
scraped_at | string | ISO 8601 UTC timestamp |
danmaku record
| Field | Type | Description |
|---|---|---|
type | string | "danmaku" |
bvid | string | The video's BV ID |
content | string | Bullet comment text |
timepoint_seconds | number | Time in the video when the bullet comment appears |
font_color | string | Font color value from the source |
url | string | Video page URL |
scraped_at | string | ISO 8601 UTC timestamp |
comment record
| Field | Type | Description |
|---|---|---|
type | string | "comment" |
bvid | string | The video's BV ID |
rpid | string | Comment ID |
user_name | string | Commenter's name |
user_mid | string | Commenter's user ID |
content | string | Cleaned comment text |
likes | integer | Likes on the comment |
reply_count | integer | Number of replies to the comment |
pubdate | string | Comment time in UTC, or "N/A" |
url | string | Video page URL |
scraped_at | string | ISO 8601 UTC timestamp |
Example Bilibili Video Scraper Records:
{"type": "video_meta","bvid": "BV1uv411q7Mv","aid": "12345678","title": "Example Video Title","creator_name": "ExampleUploader","views": 1250000,"likes": 98000,"coins": 45000,"favorites": 52000,"shares": 8000,"danmaku_count": 15000,"duration_seconds": 312,"pubdate": "2026-05-12 08:30:00","url": "https://www.bilibili.com/video/BV1uv411q7Mv","scraped_at": "2026-10-30T09:00:00Z"}
{"type": "danmaku","bvid": "BV1uv411q7Mv","content": "Great video!","timepoint_seconds": 42.5,"font_color": "16777215","url": "https://www.bilibili.com/video/BV1uv411q7Mv","scraped_at": "2026-10-30T09:00:00Z"}
🧰 Technical Stack
- HTTP Client:
curl_cffiwith Chrome 124 TLS fingerprint impersonation - Sources: Bilibili video info API, danmaku XML endpoint, and comment API
- XML Parsing: Python
xml.etree.ElementTreefor danmaku - Text Cleaning: Regex-based HTML tag removal plus
html.unescape - Date Handling:
datetimewith timezone-aware UTC timestamps - Async:
asynciowith executor-run blocking requests - Proxy: Apify Proxy, optional via
useApifyProxy, with automatic no-proxy fallback on failure - Logging: Apify Actor logging system
- Platform: Apify Actor serverless environment
📊 Data Fields Explained
Video Identity
- bvid / aid / title / description: Identifiers and cleaned text for the video
Creator
- creator_name / creator_mid: The uploader's name and user ID
Engagement
- views / likes / coins / favorites / shares / danmaku_count: Bilibili's engagement statistics for the video
Danmaku
- content / timepoint_seconds / font_color: Bullet comment text, when it appears, and its color
Comments
- user_name / content / likes / reply_count / pubdate: Who commented, what they said, and how the comment performed
🎯 Use Cases
- Audience Reaction Analysis – Read comments and danmaku to understand how viewers respond
- Sentiment Research – Feed comment and danmaku text into sentiment analysis tools
- Content Trend Research – Compare engagement stats across videos
- Creator Research – Review a creator's video performance and audience feedback
- Social Listening – Monitor discussions around a specific video
- Chinese Language Data Collection – Gather real viewer-generated text for language research
🚀 Quick Start
1. Prepare Input
Go to Apify Console and enter:
{"videoUrlOrBvid": "BV1uv411q7Mv","maxComments": 30}
2. Run the Actor
Click Start. The Actor will:
- Connect through Apify Proxy if enabled
- Set up visitor cookies
- Fetch video details, danmaku, and top comments
- Push all results to the Dataset as one batch
3. Monitor Progress
Console shows (the log messages are written in romanized Bengali):
🛡️ Apify Proxy connect hoyeche.🔎 Bilibili video scrape shuru hocche: BV1uv411q7Mv...💬 Live Danmaku bullet comments ana hocche (cid: ...)...🗣️ Top comments ana hocche (aid: ...)...✅ Mot 61 ti Bilibili item dataset e push kora hoyeche!🎉 Shompurno hoyeche!
4. View & Download Results
- Results Tab: All Bilibili Video Scraper records
- Export: JSON, CSV, Excel, or HTML
- Filter: By
type(video_meta,danmaku,comment) - API Access: Available via the Apify API
⚙️ Configuration
Default run:
{"videoUrlOrBvid": "BV1uv411q7Mv","maxComments": 30}
Maximum items per type:
{"videoUrlOrBvid": "BV1uv411q7Mv","maxComments": 50}
Direct connection without proxy:
{"videoUrlOrBvid": "BV1uv411q7Mv","proxyConfiguration": {"useApifyProxy": false}}
📈 Performance
Processing Speed
- Four to five lightweight requests per video: home page cookie visit, video details, danmaku XML, and comments
- Results arrive within seconds for a single video
Resource Usage
- Memory: Low, since no browser instance is launched
- Network: Lightweight requests only
- Proxy: Optional Apify Proxy with automatic no-proxy fallback on failure
⚠️ Important Notes
Legal & Compliance
- Fair Use: Uses a small number of requests per video to keep load on the source minimal
- Public Data Only: Retrieves only publicly available video, comment, and danmaku data
- Privacy: Comments include usernames and user IDs, which may be personal data under privacy laws such as GDPR. Use only for legitimate purposes.
- Legal: Not legal advice — consult qualified professionals before using this data in compliance-sensitive contexts
Data Quality
- One Video Per Run: Each run processes a single video
- Limits: Danmaku and comments are each limited to
min(maxComments, 50)items per run, so a run returns at most 101 records (1 video record, up to 50 danmaku, up to 50 comments) - Danmaku Selection: Danmaku are taken from the start of the XML file, not sampled across the whole video
- Comments: Only top-level comments from the first page are collected; replies to comments are not included, only their count
- Partial Results: If danmaku or comments cannot be fetched, the run still returns the video record and any other data it collected
- Failed Video Lookup: If the video details cannot be fetched or Bilibili returns an error, the run logs an error and pushes no data
- Anti-Bot Protection: Bilibili may block requests at times; using Apify Proxy is recommended
- Freshness: Reflects live data at time of run
Best Practices
- Use a valid, public video URL or BV ID for accurate Bilibili Video Scraper results
- Keep Apify Proxy enabled for more reliable access
- Run on a schedule to track changes in views, likes, and comments
- Handle usernames and user IDs responsibly
📄 License & Legal
Terms of Use:
- Use for legitimate research, analytics, and social listening purposes
- Respect Bilibili's terms of service and content creators' rights
- Do not use for spam, harassment, or unlawful data collection
- Use data responsibly and in compliance with applicable privacy laws
Disclaimer: Bilibili Video Scraper is provided as-is for research purposes. It is not affiliated with or endorsed by Bilibili. Users are responsible for compliance with all applicable laws and the terms of service of the data source. This is not legal advice.
⚖️ Bilibili Video Scraper Excellence
This Actor is optimized for Bilibili Video Scraper research with:
- ✅ Video metadata and engagement stats
- ✅ Danmaku (bullet comment) extraction
- ✅ Top comment extraction
- ✅ URL or BV ID input
- ✅ Visitor cookie setup for fewer blocks
- ✅ Proxy fallback for reliable access
- ✅ Production-ready code