# Bilibili Scraper (`idealistic_countryside/bilibili-scraper`) Actor

Scrape Bilibili (B站) with no account and no cookies to paste: search videos by keyword, read full video statistics, get a creator's profile and upload list, and export bullet comments (danmaku). You pay per row saved.

- **URL**: https://apify.com/idealistic_countryside/bilibili-scraper.md
- **Developed by:** [Sachin](https://apify.com/idealistic_countryside) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 81.8% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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

### What does Bilibili Scraper do?

**Bilibili Scraper** reads public data from [Bilibili](https://www.bilibili.com) (B站, 哔哩哔哩), one of China's biggest video platforms, and gives it to you as clean rows. You need **no Bilibili account and no cookies to paste**. Pick a mode, press Start, and download the result as JSON, CSV or Excel.

It can collect:

- 🔎 **Search results**: videos that match your keywords, with sort order, video length and publication date filters.
- 🎬 **Video details**: views, likes, coins, favorites, shares, comment count, bullet comment count, tags, description, cover and length for any video link or BV id.
- 👤 **Creator profiles**: followers, total likes, level, verification and bio for any channel.
- 📚 **Creator upload lists**: the videos Bilibili lists for a creator, newest first, each row already carrying its full statistics.
- 🔥 **The popular chart**: what is trending on Bilibili right now.
- 💬 **Bullet comments (danmaku, 弹幕)**: the comments that fly across the video, each with the second it appears at.

Because it runs on Apify, you can also schedule it, call it from the API, and send the rows to Google Sheets, Slack, Make, Zapier or your own code.

### What Bilibili data can I extract?

Every row has a `recordType` that says what it is: `video`, `creator` or `bulletComment`.

| Row type | Fields |
| --- | --- |
| `video` | `bvid`, `url`, `title`, `description`, `coverUrl`, `durationSeconds`, `publishedAt`, `category`, `tags`, `viewCount`, `likeCount`, `coinCount`, `favoriteCount`, `shareCount`, `commentCount`, `bulletCommentCount`, `creatorId`, `creatorName`, `searchKeyword`, `aid`, `cid`, `scrapedAt`, `isDetailMissing` |
| `creator` | `creatorId`, `url`, `name`, `bio`, `avatarUrl`, `level`, `followerCount`, `followingCount`, `videoCount`, `totalLikeCount`, `isVerified`, `verificationTitle`, `scrapedAt` |
| `bulletComment` | `bulletCommentId`, `bvid`, `cid`, `text`, `videoTimeSeconds`, `sentAt`, `position`, `fontSize`, `colorHex`, `scrapedAt` |

Dates are in UTC. Bullet comment rows carry no information about who sent them.

### How to scrape Bilibili

1. Open the Actor and choose **What to collect**: Search, Videos, Creators or Popular.
2. Fill in the list for that mode: keywords, video links or creator links. Popular needs no list.
3. Set **Maximum videos**. It counts per keyword and per creator.
4. Optional: switch on **full details**, **creator uploads** or **bullet comments**.
5. Press **Start**. When the run ends, open the **Output** tab and export the rows.

### How much does it cost to scrape Bilibili?

You pay per row saved, nothing per hour and nothing for rows you did not get.

| What you get | Price |
| --- | --- |
| One video row | $0.004 ($4 per 1,000) |
| One creator profile row | $0.004 |
| One bullet comment row | $0.0003 ($0.30 per 1,000) |
| Starting a run | $0.00005 |

Examples:

- 500 search results for one keyword: about $2.00.
- One creator profile with their 300 uploads: about $1.20.
- One video with 1,000 bullet comments: about $0.30.

Links that Bilibili says do not exist are skipped and not charged. If you set a maximum charge for a run, the Actor stops when it reaches it and keeps the rows saved so far.

### Input

| Field | What it does |
| --- | --- |
| `mode` | `search`, `videos`, `creators` or `popular`. |
| `searchKeywords` | Search mode. Keywords or phrases, Chinese or English. |
| `videoUrls` | Videos mode. Video links or BV ids. |
| `creatorUrls` | Creators mode. Channel links (`https://space.bilibili.com/8047632`) or numeric ids. |
| `maxVideos` | Most videos per keyword, per creator, or from the popular chart. Default 20. |
| `sortOrder` | Search mode. `relevance`, `views`, `newest`, `bulletComments`, `favorites` or `comments`. |
| `durationFilter` | Search mode. `any`, `under10Minutes`, `from10To30Minutes`, `from30To60Minutes` or `over60Minutes`. |
| `publishedAfter`, `publishedBefore` | Search mode. Dates as `YYYY-MM-DD`, China time. |
| `includeVideoDetails` | Open every listed video to fill in the fields its list does not carry. One more request per video. |
| `includeCreatorVideos` | Creators mode. Also save each creator's uploads. |
| `includeBulletComments` | Save the bullet comments of every video collected. |
| `maxBulletCommentsPerVideo` | Default 1,000. |

#### Search for videos by keyword

```json
{
    "mode": "search",
    "searchKeywords": ["咖啡", "coffee"],
    "sortOrder": "views",
    "publishedAfter": "2026-01-01",
    "maxVideos": 200
}
```

#### Get a creator and their upload list

```json
{
    "mode": "creators",
    "creatorUrls": ["https://space.bilibili.com/8047632"],
    "includeCreatorVideos": true,
    "maxVideos": 5000
}
```

#### Get one video with its bullet comments

```json
{
    "mode": "videos",
    "videoUrls": ["https://www.bilibili.com/video/BV1XbrYY4E35/"],
    "includeBulletComments": true
}
```

### Output

A video row:

```json
{
    "recordType": "video",
    "bvid": "BV1XbrYY4E35",
    "url": "https://www.bilibili.com/video/BV1XbrYY4E35/",
    "title": "上B站！弹幕看春晚",
    "description": "六字总结：上B站！看春晚！",
    "coverUrl": "https://i1.hdslb.com/bfs/archive/4726ab8013ac2682dea473a0660663c38435d5a6.jpg",
    "durationSeconds": 31,
    "publishedAt": "2025-01-09T02:05:00+00:00",
    "category": null,
    "tags": ["B站首播总台春晚", "春晚", "B站", "拜年", "弹幕"],
    "viewCount": 6150626,
    "likeCount": 224331,
    "coinCount": 15893,
    "favoriteCount": 25260,
    "shareCount": 19257,
    "commentCount": 2727,
    "bulletCommentCount": 8619,
    "creatorId": 8047632,
    "creatorName": "哔哩哔哩弹幕网",
    "searchKeyword": null,
    "aid": 113792054725203,
    "cid": 27762362819,
    "scrapedAt": "2026-10-13T21:20:47+00:00"
}
```

A creator row:

```json
{
    "recordType": "creator",
    "creatorId": 8047632,
    "url": "https://space.bilibili.com/8047632",
    "name": "哔哩哔哩弹幕网",
    "bio": "哔哩哔哩 干杯  ( ゜- ゜)つロ",
    "avatarUrl": "https://i0.hdslb.com/bfs/face/0c84b9f4ad546d3f20324809d45fc439a2a8ddab.jpg",
    "level": 6,
    "followerCount": 4078327,
    "followingCount": 78,
    "videoCount": 359,
    "totalLikeCount": 50305906,
    "isVerified": true,
    "verificationTitle": "哔哩哔哩弹幕网官方账号",
    "scrapedAt": "2026-10-13T19:30:14+00:00"
}
```

A bullet comment row:

```json
{
    "recordType": "bulletComment",
    "bulletCommentId": "1755747789327410176",
    "bvid": "BV1XbrYY4E35",
    "cid": 27762362819,
    "text": "好的九三 一定看",
    "videoTimeSeconds": 14.229,
    "sentAt": "2025-01-09T03:17:26+00:00",
    "position": "scrolling",
    "fontSize": 25,
    "colorHex": "#ffffff",
    "scrapedAt": "2026-10-13T21:20:47+00:00"
}
```

### Limits you should know before you buy

- **Search stops at 1,000 results per keyword.** That is Bilibili's own limit, and after repeats and non-video results are removed you get fewer unique videos (862 for one keyword in a test). To go deeper, split one keyword into several date ranges, or run it with different sort orders.
- **The popular chart holds 500 videos.**
- **A creator's upload list is what Bilibili lists publicly.** The video count on a profile can be higher than the number of videos Bilibili actually lists. When that happens the run log says so, for example "The profile of creator 8047632 counts 359 videos, but Bilibili lists 292 of them publicly."
- **Joint uploads** appear in a creator's list with the account that owns the video in `creatorId` and `creatorName`.
- **Bullet comments are a pool, not the full history.** For a busy video Bilibili serves about a thousand, however many were ever sent. For a video with several parts, the Actor reads the first part.
- **The comments under a video are not included.** Bilibili shows visitors without an account only a handful of them, so the Actor does not offer a half-working comment export.
- **Some fields depend on where the row came from.** Search results have no `coinCount`, `shareCount` or `cid`. Creator upload lists and the popular chart have no `tags`. `category` comes only with search results and the popular chart. Switch on **full details** to fill in everything a video page has.
- **Bilibili sometimes pushes back.** It can answer with a challenge instead of data. The Actor then waits, starts a fresh visit and repeats the request, and the run log counts how often that happened. In tests this came in bursts and mostly with **full details** switched on: the same input passed on other runs.
- **If a video page stays blocked, the run carries on.** With **full details** on, that video is saved with the fields its list carried and `isDetailMissing` is `true`, so you can spot it and run it again later. In Videos mode a blocked video is skipped and not charged. If Bilibili blocks a search, creator or chart request for good, the run stops, keeps the rows saved so far and charges only for those.
- **It is paced on purpose**, at about one to two requests per second, so that it stays a polite visitor.

### FAQ

#### Do I need a Bilibili account, cookies or an API key?

No. The Actor opens Bilibili as a visitor who is not signed in, and reads only what such a visitor can see.

#### Can I use Bilibili Scraper as a Bilibili API?

Yes. Every Apify Actor can be started from the Apify API, and the rows can be read back as JSON, so you can use it as an unofficial Bilibili data API from Python, JavaScript or any tool that can send an HTTP request.

#### Why is a field empty?

Bilibili did not send it for that kind of row. See "Limits you should know before you buy" above, and switch on **full details** if you need the missing fields.

#### Why did a link get skipped?

The run log names every skipped link and the reason: no BV id in it, a video that was deleted or hidden, or an account that does not exist. Skipped links are not charged.

#### Is it legal to scrape Bilibili?

The Actor reads only pages that anyone can open without signing in, and it leaves out who sent each bullet comment. Creator profiles are still data about people, and laws such as the GDPR can apply to how you store and use it. You are responsible for your own use, including Bilibili's terms of service. If you are not sure, ask a lawyer.

#### Something is wrong or missing. Where do I report it?

Open an issue on the Issues tab of this Actor. Say which mode and input you used, and I will look at it.

# Actor input Schema

## `mode` (type: `string`):

Search uses the keywords list. Videos uses the video links list. Creators uses the creator links list. Popular needs no list: it reads the Bilibili popular chart.

## `searchKeywords` (type: `array`):

Used in Search mode. One keyword or phrase per line, in Chinese or English. Each keyword is searched separately. Bilibili shows at most 1,000 results for one keyword.

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

Used in Videos mode. One per line: a video link such as https://www.bilibili.com/video/BV1XbrYY4E35/ or only the BV id.

## `creatorUrls` (type: `array`):

Used in Creators mode. One per line: a channel link such as https://space.bilibili.com/8047632 or only the numeric id.

## `maxVideos` (type: `integer`):

The most videos to save for each keyword, for each creator, or from the popular chart. The run stops asking Bilibili for more once it has this many.

## `sortOrder` (type: `string`):

Search mode only. The order Bilibili returns the results in.

## `durationFilter` (type: `string`):

Search mode only. Keep videos of one length band.

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

Search mode only. Keep videos published on or after this day (China time). Leave empty for no lower bound.

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

Search mode only. Keep videos published on or before this day (China time). Leave empty for no upper bound.

## `includeVideoDetails` (type: `boolean`):

Search, Creators and Popular modes. Search results have no coin or share counts and can shorten the description. Creator upload lists and the popular chart have no tags. Switch this on to open each video and fill those in. It makes one more request per video, so the run is slower. Videos mode always returns full details.

## `includeCreatorVideos` (type: `boolean`):

Creators mode only. After the profile, save the uploads Bilibili lists for the creator, newest first, up to "Maximum videos". Each row already has views, likes, coins, favorites, shares and comment counts. Raise "Maximum videos" to get the whole list.

## `includeBulletComments` (type: `boolean`):

Save the bullet comments of every video collected, one row each, with the second of the video they appear at. Each bullet comment is a paid row.

## `maxBulletCommentsPerVideo` (type: `integer`):

Only used when bullet comments are switched on. Bilibili keeps a limited pool for each video, so popular videos return about a thousand, not every one ever sent.

## Actor input object example

```json
{
  "mode": "search",
  "searchKeywords": [
    "coffee"
  ],
  "videoUrls": [
    "https://www.bilibili.com/video/BV1XbrYY4E35/"
  ],
  "creatorUrls": [
    "https://space.bilibili.com/8047632"
  ],
  "maxVideos": 20,
  "sortOrder": "relevance",
  "durationFilter": "any",
  "includeVideoDetails": false,
  "includeCreatorVideos": false,
  "includeBulletComments": false,
  "maxBulletCommentsPerVideo": 1000
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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 = {
    "searchKeywords": [
        "coffee"
    ],
    "videoUrls": [
        "https://www.bilibili.com/video/BV1XbrYY4E35/"
    ],
    "creatorUrls": [
        "https://space.bilibili.com/8047632"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("idealistic_countryside/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 = {
    "searchKeywords": ["coffee"],
    "videoUrls": ["https://www.bilibili.com/video/BV1XbrYY4E35/"],
    "creatorUrls": ["https://space.bilibili.com/8047632"],
}

# Run the Actor and wait for it to finish
run = client.actor("idealistic_countryside/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 '{
  "searchKeywords": [
    "coffee"
  ],
  "videoUrls": [
    "https://www.bilibili.com/video/BV1XbrYY4E35/"
  ],
  "creatorUrls": [
    "https://space.bilibili.com/8047632"
  ]
}' |
apify call idealistic_countryside/bilibili-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,idealistic_countryside/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/cMSCHX92MCmzK78Pd/builds/Vxm1kjvrUfMqS4URe/openapi.json
