# Bilibili Scraper (哔哩哔哩) - Video Stats, Comments & Search (`zaver.api/bilibili-scraper`) Actor

Scrape Bilibili (哔哩哔哩) videos and comments - no login, no cookie. Get views, likes, coins, favorites, shares, danmaku count, tags and uploader for any video by URL or keyword search, or export a video's comment threads. Export to CSV, JSON or Excel.

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

## Pricing

from $10.00 / 1,000 item scrapeds

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Bilibili Scraper (哔哩哔哩) 📺

**Bilibili Scraper** extracts **video statistics and comments** from Bilibili (哔哩哔哩) — **no login, no cookie, no API key**. Give it video URLs or search keywords and get **views, likes, coins, favorites, shares, danmaku count, tags and uploader** for any video, or export a video's full **comment threads**. Export to **CSV, Excel or JSON**, or pull it via the **API**.

Built for **creator and video analytics, trend research, competitor tracking and China-market social listening**.

- ✅ **No login, no cookie, no API key** — public Bilibili data, read anonymously
- ✅ **Full engagement set** — views, likes, **coins**, **favorites**, shares, comments, **danmaku** (弹幕) count
- ✅ **Video details** by URL, BV ID or av ID
- ✅ **Keyword search** — find videos by topic, with stats
- ✅ **Comment export** — full comment threads for any video
- ✅ **CSV, Excel, JSON, XML** export + full API, scheduler and integrations

***

### What data does it extract?

**Video details** — one row per video:

| Field | Description | Example |
|---|---|---|
| `title` | Video title | `我的视频` |
| `owner_name` / `owner_mid` | Uploader | `creator` / `1920908011` |
| `views` | Play count | `319635` |
| `likes` | Likes | `15760` |
| `coins` | Coins (Bilibili's paid upvote) | `1665` |
| `favorites` | Saves | `1435` |
| `shares` | Shares | `77` |
| `comments` | Comment count | `275` |
| `danmaku` | Bullet-comment count | `346` |
| `duration_seconds` | Length | `454` |
| `category` / `tags` | Topic | `Comedy` / `["funny","life"]` |
| `url` | Video URL | `https://www.bilibili.com/video/BV…/` |

**Comments mode** — one row per comment: `username`, `user_mid`, `message`, `likes`, `reply_count`, `ctime`, `video_aid`.

### What can it scrape?

- **Video URLs / BV IDs / av IDs** → full video details + stats (+ tags)
- **Search keywords** → matching videos with play counts and metadata
- **Comments** → set *Comments* mode and pass video URLs to export their comment threads

### How to scrape Bilibili (step by step)

1. Add **video URLs** (`https://www.bilibili.com/video/BV…`), **BV/av IDs**, and/or **search keywords**.
2. Choose **Video details & stats** or **Comments**.
3. Set **max items per input**.
4. Click **Start**, then download from the **Storage → Dataset** tab as **CSV, Excel, JSON or XML** — or read via the API.

#### Example input

```json
{
  "startUrls": ["https://www.bilibili.com/video/BV1fytx6LEB5"],
  "searchQueries": ["python tutorial"],
  "resultsType": "videoDetails",
  "maxItems": 100
}
```

#### Example output

```json
{
  "bvid": "BV1fytx6LEB5",
  "title": "我的视频",
  "owner_name": "creator",
  "views": 319635,
  "likes": 15760,
  "coins": 1665,
  "favorites": 1435,
  "shares": 77,
  "comments": 275,
  "danmaku": 346,
  "duration_seconds": 454,
  "category": "Comedy",
  "tags": ["funny", "life"],
  "url": "https://www.bilibili.com/video/BV1fytx6LEB5/"
}
```

#### Run it via the Apify API

```bash
curl "https://api.apify.com/v2/acts/YOUR~ACTOR/runs?token=YOUR_TOKEN" \
  -X POST -H "Content-Type: application/json" \
  -d '{"startUrls": ["https://www.bilibili.com/video/BV1fytx6LEB5"]}'
```

Works with the **Apify SDK**, **scheduled runs**, **webhooks**, and integrations for **Make, Zapier, n8n, Google Sheets and LangChain**.

### Pricing — pay only for results

You are billed **per item delivered** (a video or a comment). Failed or unavailable inputs cost **nothing**.

| Result type | Price |
|---|---|
| Video (details + stats) | **$0.01 per video** ($10 / 1,000) |
| Comment | **$0.01 per comment** ($10 / 1,000) |

That's **half** what the established Bilibili Actor charges (which bills items at $0.02 each), and proxies are included.

### Frequently asked questions

#### Do I need a Bilibili account or cookies?

No. The scraper reads Bilibili's public web data anonymously — no login, no cookie, no API key.

#### What are coins and danmaku?

**Coins** (硬币) are Bilibili's paid upvotes — a strong quality signal unique to the platform. **Danmaku** (弹幕) are the bullet comments that scroll over the video; this Actor returns the danmaku *count* per video.

#### Can I search by keyword?

Yes. Add keywords under *Search keywords* in video-details mode; each returns matching videos with their stats.

#### How do I export a video's comments?

Switch *What to scrape* to **Comments** and pass the video URLs — you'll get one row per comment.

#### Why did an input come back with an error?

The video may be deleted, private or region-locked, or the input wasn't a valid Bilibili video reference. Error rows are not billed.

#### Is this legal?

The scraper collects only **publicly available** data. You are responsible for using it in compliance with the laws that apply to you and Bilibili's terms.

### Support & roadmap

Open an issue on the Actor's **Issues** tab. On the roadmap: **danmaku text export**, **per-creator video lists**, and **popular/ranking feeds**.

# Actor input Schema

## `startUrls` (type: `array`):

Bilibili video URLs, BV IDs or av IDs. One per line, e.g. <code>https://www.bilibili.com/video/BV1fytx6LEB5</code>, <code>BV1fytx6LEB5</code>, or <code>av117188149120135</code>.

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

Keywords to search Bilibili videos for (video-details mode only). One per line, e.g. <code>python tutorial</code>. Each keyword is scraped up to the max-items limit.

## `resultsType` (type: `string`):

Video details = one row per video with full stats and tags. Comments = export the comments of each video URL.

## `maxItems` (type: `integer`):

Maximum videos per search keyword, or maximum comments per video. A single video URL returns one video. You are billed per item delivered.

## `includeTags` (type: `boolean`):

Fetch each video's tags (one extra request per video). Applies to video-details mode.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.bilibili.com/video/BV1fytx6LEB5"
  ],
  "searchQueries": [],
  "resultsType": "videoDetails",
  "maxItems": 100,
  "includeTags": true
}
```

# Actor output Schema

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

One dataset item per video (with full stats and tags) or per comment, depending on the mode.

## `resultsCsv` (type: `string`):

The same records as a CSV download, ready for Excel or Sheets.

## `runSummary` (type: `string`):

Counts for the run: requests, items delivered, and errors.

# 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 = {
    "startUrls": [
        "https://www.bilibili.com/video/BV1fytx6LEB5"
    ],
    "searchQueries": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("zaver.api/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 = {
    "startUrls": ["https://www.bilibili.com/video/BV1fytx6LEB5"],
    "searchQueries": [],
}

# Run the Actor and wait for it to finish
run = client.actor("zaver.api/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 '{
  "startUrls": [
    "https://www.bilibili.com/video/BV1fytx6LEB5"
  ],
  "searchQueries": []
}' |
apify call zaver.api/bilibili-scraper --silent --output-dataset

```

## MCP server setup

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