# Bilibili Scraper – Videos, Comments, Danmaku & Creators (`smoldesk/bilibili-scraper`) Actor

Scrape Bilibili (哔哩哔哩) without login: search videos, full stats, comments, replies, danmaku, creator profiles and trending charts. Many sources in one run, monitor mode, from $0.002 per video.

- **URL**: https://apify.com/smoldesk/bilibili-scraper.md
- **Developed by:** [Smoldesk Studios](https://apify.com/smoldesk) (community)
- **Categories:** Social media, Videos, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 1,000 videos

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Bilibili Scraper – Videos, Comments, Danmaku & Creators

Scrape **Bilibili (哔哩哔哩)** without login, cookies or an API key. Search videos by keyword, get **full video stats** (views, likes, **coins**, favorites, shares, danmaku and comment counts, tags, honors), **creator profiles** (followers, total likes, video count, verification), **danmaku (弹幕)** with the second of the video each one appears at, **top comments and reply threads**, and Bilibili's **trending feed and category rankings**.

**Mix sources in one run**: keywords, video links, creators and trending together. Results are deduplicated across sources. **$2.50 per 1,000 videos**, about 8x cheaper than the most-used Bilibili scraper, with no monthly fee.

### What you can use it for

- **Chinese market & brand research**: what Gen-Z China watches and says about a brand, game, car or gadget.
- **Influencer (KOL / UP主) discovery**: shortlist creators by followers, total likes and verification, then pull their latest uploads.
- **Content & trend tracking**: daily snapshots of the hot feed or a category's top 100 ranking.
- **Audience reaction analysis**: danmaku show exactly which second of a video people react to.
- **AI / NLP datasets**: Chinese titles, descriptions, tags, comments and danmaku with clean text, ready for sentiment analysis or RAG.
- **Monitoring**: schedule it with **Only new videos** to get a feed of new uploads for a keyword or creator.

### How to scrape Bilibili

1. **Create a free Apify account** (no credit card needed to start) and open this Actor.
2. **Pick sources.** Add **Search keywords**, **Video URLs or IDs**, **Creators (UID or profile URL)** or turn on **Trending videos**. You can mix them in one run.
3. **Set the limits.** *Max videos per keyword* and *Max videos per creator* decide how much each source returns. Use *Search sort*, *Video length* and the date range to narrow it.
4. **Add detail (optional).** Turn on *Include comments*, *Include danmaku (弹幕)* or leave *Full video stats* on for coins, favorites, shares and tags.
5. **Click Start.** Results appear in the **Output** tab while it runs.
6. **Download or connect.** Export as JSON, CSV, Excel or HTML, or read the dataset through the API, Make, Zapier, n8n, Google Sheets or a webhook.
7. **Automate it.** Open **Schedules**, add a daily schedule and switch on **Only new videos** to get a feed of new uploads for a keyword or creator.

**Tips**

- Bilibili shows logged-out visitors only the top comments of a video; for audience reactions at scale use danmaku.
- Bilibili stops search at 1,000 results per keyword. Use date ranges or more specific keywords for more.
- Creator lists are paged slowly by Bilibili, so very large creator lists can take a few minutes.

### Output: video

```json
{
  "type": "video",
  "bvid": "BV1g1C6Y2Ef3",
  "aid": 113719929475294,
  "url": "https://www.bilibili.com/video/BV1g1C6Y2Ef3",
  "title": "【4K】黑神话悟空全成就保姆级攻略【已完结】",
  "description": "分P大合集来了，再次撒花！…",
  "coverUrl": "https://i1.hdslb.com/bfs/archive/ee6abfa95da35ce4d1ccfd2802d42d42ab3f34ae.jpg",
  "durationSeconds": 81532,
  "publishedAt": "2024-12-27T04:00:00+00:00",
  "category": "单机游戏",
  "tags": ["黑神话悟空", "攻略", "单机游戏", "4K"],
  "authorName": "爱玩的Kaka",
  "authorId": 420269,
  "authorUrl": "https://space.bilibili.com/420269",
  "authorFollowers": 40054,
  "views": 7755592,
  "likes": 58601,
  "coins": 59522,
  "favorites": 64965,
  "shares": 7123,
  "danmakuCount": 40033,
  "commentCount": 3795,
  "parts": 29,
  "honors": [],
  "rank": 1,
  "source": "search",
  "searchQuery": "黑神话悟空",
  "markdown": "# 【4K】黑神话悟空全成就保姆级攻略【已完结】\n\nby 爱玩的Kaka · 2024-12-27 · 7,755,592 views · 58,601 likes\n…",
  "scrapedAt": "2026-10-15T09:58:35.745889+00:00"
}
```

`source` tells you where the video came from: `search`, `video`, `user`, `popular` or `ranking:<category>`. `rank` is its position in that list.

### Output: creator

```json
{
  "type": "user",
  "userId": 686127,
  "url": "https://space.bilibili.com/686127",
  "name": "籽岷",
  "bio": "为人民服务 新质成长力 AI游戏大玩家 MBTI：INFP",
  "level": 6,
  "followers": 5467643,
  "following": 864,
  "videoCount": 6643,
  "totalLikes": 153404044,
  "verifiedTitle": "2025年度公益UP主、2024百大UP主、知名游戏UP主",
  "isVerified": true,
  "isVip": true,
  "liveRoomUrl": "https://live.bilibili.com/544853",
  "isLive": true,
  "tags": ["籽岷", "我的世界", "Minecraft", "单机游戏", "AI"]
}
```

### Output: danmaku (弹幕)

```json
{
  "type": "danmaku",
  "videoBvid": "BV1g1C6Y2Ef3",
  "text": "在进入二周目前，先来跟着up检查一番",
  "videoTimeSeconds": 0,
  "mode": "scroll",
  "color": "#e2027f",
  "sentAt": "2025-09-29T08:41:44+00:00",
  "senderHash": "78600a8d",
  "danmakuId": "1946527028350773504"
}
```

Danmaku are **sampled evenly across the whole video**, not just the opening seconds, so you see reactions to every part.

### Output: comment

```json
{
  "type": "comment",
  "videoBvid": "BV1g1C6Y2Ef3",
  "commentId": "262717555232",
  "text": "在黄花观金光苑土地庙打百眼魔君的boss战场地入口往左转…",
  "likes": 1281,
  "replyCount": 39,
  "publishedAt": "2025-05-13T08:53:34+00:00",
  "authorName": "凪卄难忘",
  "authorId": 492922209,
  "authorLevel": 5,
  "authorIsVip": true,
  "isReply": false,
  "parentId": null,
  "isPinnedByUploader": true
}
```

### Input

```json
{
  "searchQueries": ["人工智能", "minecraft"],
  "maxVideosPerSearch": 100,
  "searchSort": "views",
  "publishedAfter": "2026-09-01",
  "users": ["https://space.bilibili.com/686127"],
  "maxVideosPerUser": 50,
  "videoUrls": ["https://www.bilibili.com/video/BV1m5aY69E8D", "https://b23.tv/xxxxxx"],
  "trending": "ranking",
  "rankingCategory": "tech",
  "includeDanmaku": true,
  "maxDanmakuPerVideo": 100,
  "includeComments": true,
  "maxRepliesPerComment": 10
}
```

- **Search**: Chinese and English keywords, sort (relevance, most viewed, newest, most danmaku, most favorited), video length, published date range. Bilibili returns at most 1,000 videos per keyword; split by date range to go further.
- **Videos**: links, BV IDs, av IDs and **b23.tv short links**.
- **Creators**: UID or profile link. Profile plus their uploads (newest, most viewed or most favorited).
- **Trending**: hot feed (up to 500) or the top-100 ranking for 18 categories.
- **Full video stats** is on by default. It adds coins, shares, tags, honors and the uploader's follower count at no extra cost.

### Pricing

Pay only for results. No monthly rental, no start fee to speak of.

| Result | Price | Per 1,000 |
|---|---|---|
| Video (full stats) | $0.0025 | **$2.50** |
| Creator profile | $0.002 | $2.00 |
| Comment or reply | $0.0005 | $0.50 |
| Danmaku | $0.0001 | $0.10 |

Example: 1,000 videos with full stats = **$2.50**, plus 1,000 top comments = $0.50. The most-used Bilibili scraper charges $0.02 per row: $20 + $20 for the same data.

Videos that can't be read (deleted, private, blocked) are skipped and **not charged**.

### Use with AI (LangChain / LlamaIndex / CrewAI)

Each video has a `markdown` field (title, creator, date, views, likes, tags, description) ready for LLMs. With LangChain (`pip install langchain-apify`):

```python
from langchain_apify import ApifyWrapper
from langchain_core.documents import Document

apify = ApifyWrapper()  # reads APIFY_API_TOKEN
loader = apify.call_actor(
    actor_id="smoldesk/bilibili-scraper",
    run_input={"searchQueries": ["新能源汽车"], "maxVideosPerSearch": 50},
    dataset_mapping_function=lambda v: Document(
        page_content=v.get("markdown") or v.get("text") or "",
        metadata={k: v.get(k) for k in ("type", "url", "videoUrl", "views", "likes", "publishedAt")},
    ),
)
docs = loader.load()
```

Already have a run? Use `ApifyDatasetLoader(dataset_id="<run's dataset ID>", dataset_mapping_function=...)`. **LlamaIndex**: `ApifyActor` from `llama-index-readers-apify`. **CrewAI / Claude / MCP clients**: add the Actor as a tool through the Apify MCP server: `https://mcp.apify.com?actors=smoldesk/bilibili-scraper`.

### Limitations

- **Comments**: Bilibili shows visitors who aren't logged in only the **top 3 comments** of each video (plus the uploader's pinned comment). Their reply threads can be scraped in full. This Actor never logs in, so for audience reactions at scale use **danmaku**, which are fully available.
- Bilibili caps keyword search at 1,000 results per query. Use date ranges or more specific keywords for more.
- Danmaku: Bilibili serves the most recent ~1,000–3,000 danmaku of a video.
- Subtitles and play URLs need a login and are not included.
- Bilibili rate-limits bursts. The Actor retries with fresh sessions and switches to datacenter proxies on its own, so large creator lists can take a few minutes.

### FAQ

**Does Bilibili have a public API?** Not an official one for developers. This Actor reads the same public endpoints the Bilibili website loads for any visitor, and returns clean, English-named JSON.

**Do I need a Bilibili account, cookies or a Chinese phone number?** No. Nothing to log in to, nothing to configure.

**Do I need a proxy or VPN?** No. It works from Apify's servers as is.

**What are coins (投币)?** Bilibili viewers tip videos with coins. Together with likes and favorites (三连) they are the strongest engagement signal on the platform.

**What is danmaku (弹幕)?** Comments that scroll across the video at a specific second. They show which moments viewers react to.

**How do I get only new uploads?** Turn on **Only new videos** and schedule the Actor. Each run returns videos that earlier runs with the same keyword, creator or trending settings haven't seen.

**Is it legal?** It collects only data Bilibili shows publicly to every visitor, with no login. Follow copyright and privacy laws (e.g. PIPL, GDPR) when you reuse it.

### Feedback

Found a bug or missing a field? Open an issue in the **Issues** tab. If the Actor saved you time, a short review on this page helps other people find it.

### More Actors from Smoldesk Studios

- [Weibo Scraper](https://apify.com/smoldesk/weibo-scraper): keyword and hashtag search, posts, comments, profiles and the hot-search board from China's biggest microblog, no login
- [Google Hotels Scraper](https://apify.com/smoldesk/google-hotels-scraper): hotel prices for your dates in any currency, ratings, review aspects and booking-site prices, worldwide
- [Google Trends Scraper](https://apify.com/smoldesk/google-trends-scraper): interest over time, by region and city, related queries and Trending now — no API key
- [Telegram Channel Scraper](https://apify.com/smoldesk/telegram-channel-scraper): public channel posts, views, reactions and subscribers
- [Substack Scraper](https://apify.com/smoldesk/substack-scraper): newsletters, subscriber counts and posts
- [Shopify Store Analyzer](https://apify.com/smoldesk/shopify-store-analyzer): apps, contacts and products of any Shopify store
- [Career Site Jobs Scraper](https://apify.com/smoldesk/career-site-jobs-scraper): live jobs from 13,000+ company career sites (Greenhouse, Lever, Workday, Ashby) with salary and seniority
- [SEEK, JobStreet & JobsDB Scraper](https://apify.com/smoldesk/seek-jobs-scraper): jobs and salaries across Australia and Southeast Asia

# Actor input Schema

## `searchQueries` (type: `array`):

Search Bilibili videos by keyword. Chinese (人工智能) and English (AI tutorial) both work. Bilibili returns at most 1,000 videos per keyword — use the date filters below to go further back.

## `videoUrls` (type: `array`):

Bilibili video links, BV IDs (BV1xx411c7mD), av IDs or b23.tv short links. Each video gets full stats; turn on comments / danmaku below to get those too.

## `users` (type: `array`):

Bilibili creator UIDs (686127) or profile links (https://space.bilibili.com/686127). Returns the creator profile (followers, likes, video count, verification) and, if enabled, their latest videos.

## `trending` (type: `string`):

Also scrape Bilibili's trending lists: 'Popular' is the live hot feed (up to 500 videos), 'Ranking' is the top-100 chart for a category.

## `rankingCategory` (type: `string`):

Category for the 'Ranking' chart.

## `maxVideosPerSearch` (type: `integer`):

Stop after this many videos for each keyword (Bilibili's cap is 1,000).

## `searchSort` (type: `string`):

How Bilibili orders search results.

## `searchDuration` (type: `string`):

Only search videos of this length.

## `publishedAfter` (type: `string`):

Only search videos published on or after this date (YYYY-MM-DD).

## `publishedBefore` (type: `string`):

Only search videos published on or before this date (YYYY-MM-DD).

## `includeUserVideos` (type: `boolean`):

For each creator, also scrape their uploaded videos.

## `maxVideosPerUser` (type: `integer`):

Newest first (or by the sort below).

## `userVideoSort` (type: `string`):

Order of a creator's videos.

## `maxTrendingVideos` (type: `integer`):

Popular feed: up to 500. Ranking: up to 100.

## `fetchDetails` (type: `boolean`):

Fetch each video's detail page for likes, coins, shares, tags, honors and the uploader's follower count. Search results alone only have views, likes, favorites, comments and danmaku counts. Same price either way.

## `includeComments` (type: `boolean`):

Scrape each video's top comments (most-liked, plus the uploader's pinned comment) as their own rows. Bilibili only shows visitors who aren't logged in the top 3 comments of a video, so expect up to ~4 comments per video, plus their replies if you turn those on below. For audience reactions at scale, use danmaku.

## `maxCommentsPerVideo` (type: `integer`):

Upper limit of top-level comments per video (Bilibili currently shows logged-out visitors about 3 per video).

## `commentSort` (type: `string`):

Which comments come first (Bilibili shows logged-out visitors only the first few).

## `maxRepliesPerComment` (type: `integer`):

Also scrape the reply thread under each top comment (0 = off). Replies are rows with isReply = true and parentId.

## `includeDanmaku` (type: `boolean`):

Scrape the on-video scrolling comments (弹幕) — the main audience-reaction data on Bilibili — each with the second of the video it appears at.

## `maxDanmakuPerVideo` (type: `integer`):

Danmaku are sampled evenly across the whole video timeline (not just the opening seconds). Bilibili serves up to ~1,000–3,000 recent danmaku per video.

## `onlyNewVideos` (type: `boolean`):

Remember videos returned by earlier runs with the same keyword / creator / trending settings and only return new ones. Schedule the Actor to get a feed of new uploads.

## `maxConcurrency` (type: `integer`):

Videos processed in parallel. Higher is faster but Bilibili rate-limits bursts.

## `proxyConfiguration` (type: `object`):

Not needed — the Actor switches to Apify datacenter proxies on its own if Bilibili rate-limits the run. Residential proxies are ignored.

## Actor input object example

```json
{
  "searchQueries": [
    "人工智能",
    "minecraft"
  ],
  "videoUrls": [],
  "users": [],
  "trending": "none",
  "rankingCategory": "all",
  "maxVideosPerSearch": 20,
  "searchSort": "relevance",
  "searchDuration": "any",
  "includeUserVideos": true,
  "maxVideosPerUser": 20,
  "userVideoSort": "pubdate",
  "maxTrendingVideos": 20,
  "fetchDetails": true,
  "includeComments": false,
  "maxCommentsPerVideo": 20,
  "commentSort": "hot",
  "maxRepliesPerComment": 0,
  "includeDanmaku": false,
  "maxDanmakuPerVideo": 50,
  "onlyNewVideos": false,
  "maxConcurrency": 3,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `videos` (type: `string`):

Videos (type = video).

## `comments` (type: `string`):

Comments and replies (type = comment).

## `danmaku` (type: `string`):

On-video comments (type = danmaku).

## `users` (type: `string`):

Creator profiles (type = user).

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "searchQueries": [
        "人工智能",
        "minecraft"
    ],
    "videoUrls": [],
    "users": [],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("smoldesk/bilibili-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "searchQueries": [
        "人工智能",
        "minecraft",
    ],
    "videoUrls": [],
    "users": [],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("smoldesk/bilibili-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "searchQueries": [
    "人工智能",
    "minecraft"
  ],
  "videoUrls": [],
  "users": [],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call smoldesk/bilibili-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,smoldesk/bilibili-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/gDgjsaC1TkgVWpUlC/builds/FvbpdJToveqkeBHXR/openapi.json
