# Bilibili Scraper: Videos, Stats, Search & Uploaders (哔哩哔哩) (`datadesk-io/bilibili-scraper`) Actor

Scrape Bilibili (哔哩哔哩, B站) videos by keyword, video URL, uploader (UP主) or the Popular feed. Get views, likes, coins, favorites, shares, danmaku, comments, duration, publish date, tags and uploader. No login, no cookies needed. $1 per 1,000 videos.

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

## Pricing

from $0.80 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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, Stats, Search & Uploaders (哔哩哔哩 / B站)

Scrape **Bilibili (哔哩哔哩, B站)** videos by **keyword search**, **video URL / BV id**, **uploader (UP主)** or the **Popular (热门) feed**. Every video comes with **views, likes, coins, favorites, shares, danmaku (弹幕), comments, duration, publish date, category, tags and uploader**. No login, no cookies, no proxy setup. **$1 per 1,000 videos.**

### Try it now (one click)

1. Click **Start**. The prefilled input searches "lofi" and returns 20 videos with full stats. In our latest check (Nov 19, 2026) it returned **20 videos in about 6 seconds**. An empty input runs a small demo too.
2. Add keywords (Chinese or English), video links/BV ids, uploader space links or tick "Popular feed"; choose the sort order and how many videos per source.
3. Download the results as CSV, Excel or JSON, or get them via API, webhooks, Make or Zapier.

**Price example:** 100 videos = **$0.105**, 1,000 videos = **$1.005** ($1.00 per 1,000 videos + $0.005 per run). Silver and Gold plan users pay 10% and 20% less per video. Apify's free plan includes $5 of usage every month, enough for about 4,995 videos. Runs that find nothing are not charged.

#### Sample of real results

*Real rows from a local test run on Nov 19, 2026 (some columns). Each video also includes the other fields listed below.*

| Title | Uploader | Views | Likes | Coins | Danmaku | Published |
|---|---|---|---|---|---|---|
| Lofi Chill Music🌧️丨这条路通往幽静之地丨静谧雨声LoFi乐曲助你清空思绪 | 高粱地里吃过虧 | 1474 | 59 | 12 | 2 | 2026-11-13T13:09:01+00:00 |
| 寒风轻轻的冬日，一组安静治愈的动漫 lofi 节奏，工作学习、发呆放空都很搭❄️ | 欢昔- | 1105 | 33 | 7 | 0 | 2026-11-14T11:49:49+00:00 |
| 我是高手 | 老番茄 | 1,590,522 | 86,363 | 6179 | 1222 | 2026-11-13T09:00:00+00:00 |
| 我是奸商 | 老番茄 | 3,010,611 | 223,401 | 26,994 | 3829 | 2026-11-06T09:00:00+00:00 |

### What you get

| Field group | Fields |
|---|---|
| Video | BV id, av id, URL, title, description, duration, parts, category, tags, thumbnail |
| Engagement | views, likes, coins, favorites, shares, danmaku, comments |
| Uploader | name, mid, space URL |
| Context | source (search/url/uploader/popular), query, publish time, scrape time, alerts flag |

### Why this Actor

- **Full Bilibili stats** including coins, shares and danmaku, not just views.
- **4 inputs in one Actor:** keyword search, video URLs, uploader videos and the Popular feed.
- **Cheap:** $1 per 1,000 videos (other Bilibili Actors charge $2-20 per 1,000).
- **No login or cookies needed**; a guest session is created automatically.
- **Alerts mode** to get only new videos for a keyword or creator.

### How to use it

1. Click **Try for free** (or **Start**): the prefilled input runs a quick test.
2. Add keywords (Chinese or English), video links/BV ids, uploader space links or tick "Popular feed"; choose the sort order and how many videos per source.
3. Click **Start** and wait a few seconds.
4. Open the **Output** tab and export as **JSON, CSV, Excel, XML or HTML**, or read the dataset via API.

### Input examples

**Keyword search (prefill):**

```json
{"searchQueries": ["lofi"], "maxVideosPerSource": 20}
```

**Most viewed Genshin videos + one creator:**

```json
{"searchQueries": ["原神"], "sortBy": "views", "uploaderUrls": ["https://space.bilibili.com/546195"], "maxVideosPerSource": 100}
```

**Daily: what is trending on Bilibili:**

```json
{"includePopular": true, "maxVideosPerSource": 100}
```

#### Input fields

| Field | Type | Description |
|---|---|---|
| `searchQueries` | array | Search Bilibili videos by keyword (Chinese or English), one per line, e.g. "lofi" or "原神". Leave everything empty for a demo search ("lofi"). |
| `videoUrls` | array | Bilibili video links (https://www.bilibili.com/video/BV...), BV ids or av numbers. Returns full stats for each video. |
| `uploaderUrls` | array | Creator space links (https://space.bilibili.com/<mid>) or numeric mids. Returns their latest videos. |
| `includePopular` | boolean | Also collect videos from Bilibili's Popular feed (trending now). |
| `sortBy` | string | Order of keyword search results. |
| `fetchFullStats` | boolean | Open each video to add coins, shares, exact likes and full description (slower, same price). Turn off for the fastest runs. |
| `maxVideosPerSource` | integer | Cap for each keyword, uploader and the Popular feed (Bilibili search returns up to 1,000 per keyword). |
| `maxVideos` | integer | Hard cap for the whole run (cost control). |
| `onlyNewVideos` | boolean | Return only videos not returned in earlier runs with the same alerts key. Schedule it to monitor a keyword or creator. |
| `alertsKey` | string | Name for this alert memory (one key per monitor). |

### Output example

*Example record from a local test run (long lists shortened).*

```json
{
  "bvid": "BV1CMWz6CEfD",
  "aid": 117609240532424,
  "url": "https://www.bilibili.com/video/BV1CMWz6CEfD",
  "title": "Lofi Chill Music🌧️丨这条路通往幽静之地丨静谧雨声LoFi乐曲助你清空思绪",
  "description": "https://www.youtube.com/watch?v=CBL6VnuELzQ",
  "author": "高粱地里吃过虧",
  "authorMid": 37044453,
  "authorUrl": "https://space.bilibili.com/37044453",
  "views": 1474,
  "likes": 59,
  "coins": 12,
  "favorites": 95,
  "shares": 3,
  "danmaku": 2,
  "comments": 5,
  "durationSeconds": 11617,
  "publishedAt": "2026-11-13T13:09:01+00:00",
  "category": "音乐综合",
  "tags": [
    "冥想",
    "LOFI",
    "雨声",
    "放松"
  ],
  "parts": 1,
  "thumbnailUrl": "https://i1.hdslb.com/bfs/archive/6901d58c9578702f10bc251f0df184ceb83f3d34.jpg",
  "source": "search",
  "query": "lofi",
  "scrapedAt": "2026-11-19T23:13:56.150031+00:00",
  "isNew": false
}
```

#### Output fields

| Field | Description |
|---|---|
| `bvid` | Bilibili video id (BV...) |
| `aid` | Numeric video id (av number) |
| `url` | Video page link |
| `title` | Video title |
| `description` | Video description |
| `author` | Uploader (UP主) name |
| `authorMid` | Uploader numeric id |
| `authorUrl` | Uploader space link |
| `views` | Play count |
| `likes` | Like count |
| `coins` | Coins given (full stats only) |
| `favorites` | Times saved to favorites |
| `shares` | Share count (full stats only) |
| `danmaku` | Bullet comments (弹幕) count |
| `comments` | Comment count |
| `durationSeconds` | Video length in seconds |
| `publishedAt` | Publish time (UTC, ISO 8601) |
| `category` | Bilibili category (分区) |
| `tags` | Tags from search results |
| `parts` | Number of parts (分P) |
| `thumbnailUrl` | Cover image URL |
| `source` | search, url, uploader or popular |
| `query` | Keyword or uploader mid that found the video |
| `scrapedAt` | When the row was saved (UTC) |
| `isNew` | True when the run used "Only new videos" |

### Pricing

Pay-per-event: **$0.005** once per run that saves results + **$0.001 per video** ($1.00 / 1,000). Runs that save nothing are not charged.

| Videos saved | Approx. cost |
|---|---|
| 20 | $0.025 |
| 100 | $0.105 |
| 1,000 | $1.005 |
| 10,000 | $10.005 |

### Use cases

- Market research on Chinese audiences and trends
- Influencer (UP主) discovery and benchmarking
- Brand and competitor monitoring on Bilibili
- Content and danmaku engagement analysis
- Datasets for AI and analytics

### Integrations / API

Works with the Apify API, Schedules, webhooks, Make, Zapier, n8n and MCP. Example:

```bash
curl "https://api.apify.com/v2/acts/datadesk-io~bilibili-scraper/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" -H "Content-Type: application/json" \
  -d '{"searchQueries": ["lofi"], "maxVideosPerSource": 20}'
```

Python:

```python
from apify_client import ApifyClient
client = ApifyClient("<APIFY_TOKEN>")
run = client.actor("datadesk-io/bilibili-scraper").call(run_input={"searchQueries": ["lofi"], "maxVideosPerSource": 20})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

### MCP

Use this Actor from an MCP client (Cursor, Claude Desktop, etc.) through the Apify MCP server (`datadesk-io/bilibili-scraper`).

### Alerts mode

Turn on **Only new videos** with an **Alerts key** and schedule the run: each run returns only videos not seen before for that key, and nothing is charged when there is nothing new.

### FAQ

**Do I need a Bilibili account or cookies?** No. The Actor creates a guest session like a normal logged-out visitor.

**Why are coins/shares empty for some rows?** They come from the video page. Keep "Fetch full stats" on (default). If Bilibili refuses a page, the row keeps the search stats.

**Can I search in Chinese?** Yes. Chinese, English and mixed keywords work.

**What does an empty input do?** It searches "lofi" and returns 20 videos.

**Is it legal?** It collects publicly visible video data only. Use it in line with Bilibili terms and local law.

### Limitations

- Bilibili search returns at most about 1,000 videos per keyword (50 pages).
- Very high request volumes can be rate-limited by Bilibili; the Actor retries with backoff.
- Danmaku text and comment text are not included (counts only).
- Tags are filled for search results only.

### Start now

Click **Start** to run the prefilled example, then adjust the input. Missing a field or filter? Open an issue on the **Issues** tab and tell us what you need.

### Support

Questions, bugs or a missing field? Email **datadesk.io@proton.me** or open an issue on the Actor page.

***

**ES:** Extrae videos de Bilibili (B站) por palabra clave, URL, UP主 o feed Popular: vistas, likes, monedas, favoritos, compartidos, danmaku, comentarios, duración y fecha. Sin login. $1 por 1.000 videos.
**PT:** Extraia vídeos do Bilibili (B站) por palavra-chave, URL, UP主 ou feed Popular: visualizações, curtidas, moedas, favoritos, compartilhamentos, danmaku, comentários, duração e data. Sem login. US$1 por 1.000 vídeos.

# Actor input Schema

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

Search Bilibili videos by keyword (Chinese or English), one per line, e.g. "lofi" or "原神". Leave everything empty for a demo search ("lofi").

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

Bilibili video links (https://www.bilibili.com/video/BV...), BV ids or av numbers. Returns full stats for each video.

## `uploaderUrls` (type: `array`):

Creator space links (https://space.bilibili.com/<mid>) or numeric mids. Returns their latest videos.

## `includePopular` (type: `boolean`):

Also collect videos from Bilibili's Popular feed (trending now).

## `sortBy` (type: `string`):

Order of keyword search results.

## `fetchFullStats` (type: `boolean`):

Open each video to add coins, shares, exact likes and full description (slower, same price). Turn off for the fastest runs.

## `maxVideosPerSource` (type: `integer`):

Cap for each keyword, uploader and the Popular feed (Bilibili search returns up to 1,000 per keyword).

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

Hard cap for the whole run (cost control).

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

Return only videos not returned in earlier runs with the same alerts key. Schedule it to monitor a keyword or creator.

## `alertsKey` (type: `string`):

Name for this alert memory (one key per monitor).

## Actor input object example

```json
{
  "searchQueries": [
    "lofi",
    "原神"
  ],
  "videoUrls": [
    "https://www.bilibili.com/video/BV1xx411c7mD"
  ],
  "uploaderUrls": [
    "https://space.bilibili.com/546195"
  ],
  "includePopular": true,
  "sortBy": "views",
  "fetchFullStats": true,
  "maxVideosPerSource": 100,
  "maxVideos": 1000,
  "onlyNewVideos": false
}
```

# 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 = {
    "searchQueries": [
        "lofi"
    ],
    "maxVideosPerSource": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("datadesk-io/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": ["lofi"],
    "maxVideosPerSource": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("datadesk-io/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": [
    "lofi"
  ],
  "maxVideosPerSource": 20
}' |
apify call datadesk-io/bilibili-scraper --silent --output-dataset

```

## MCP server setup

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