# Bilibili 哔哩哔哩 Scraper - Videos, Creators & Comments (`vulnv/bilibili-scraper`) Actor

Scrape Bilibili (哔哩哔哩 / B站): keyword video search, full video details, creator profiles, a creator's uploaded videos, and video comments. Export views, likes, coins, danmaku, comments and creator data to JSON/CSV/Excel. No login, cookies or proxy needed.

- **URL**: https://apify.com/vulnv/bilibili-scraper.md
- **Developed by:** [VulnV](https://apify.com/vulnv) (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 $5.00 / 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/platform/actors/running/actors-in-store#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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use 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 - Search 哔哩哔哩 (B站) Videos, Creators & Comments

**Scrape Bilibili (哔哩哔哩 / B站) and export videos, creator profiles and comments to JSON, CSV or Excel.** Search videos by keyword, pull a single video's full details, get a creator's profile, list every video a creator has uploaded, or collect a video's comments - all from one Actor. Each result is one clean, flat row with views, likes, coins, danmaku, comments and creator data.

No login, no cookies, no proxies and no China IP to configure - data is fetched through a fast, managed pipeline. Just pick an operation, add your input and press **Start**.

> **Unofficial notice:** This is an independent tool and is **not** affiliated with, endorsed by, or connected to Bilibili, 哔哩哔哩 or Bilibili Inc. "Bilibili", "哔哩哔哩" and "B站" are trademarks of their respective owners, used here only to describe what the Actor scrapes.

### What is Bilibili?

Bilibili (哔哩哔哩, "B站") is one of China's largest video-sharing platforms, with over 300 million monthly users and a strong Gen-Z audience. It is known for long-form video, its "danmaku" (弹幕) bullet-comment overlay, and deep creator (UP主) communities across gaming, anime, tech, education, lifestyle and music. This scraper gives you programmatic access to Bilibili's search, videos, creators and comments so you can track trends, discover creators and analyze engagement at scale without a Bilibili account.

### Operations

Pick one **Operation** and fill in the matching field:

| Operation | Input field | What you get |
|-----------|-------------|--------------|
| **Search videos by keyword** | `keywords` | Videos matching each keyword, with plays, danmaku and creator data. |
| **Video details** | `videoUrls` | The full detail of each video (title, description, views, likes, coins, favorites). |
| **Video comments** | `videoUrls` | Top-level comments for each video, with likes, replies and commenter data. |
| **Creator profile** | `userUrls` | A creator's profile: followers, following, total likes, video count, level, bio. |
| **Creator's uploaded videos** | `userUrls` | Every video a creator has posted, paginated. |

`videoUrls` accept full video URLs, **BV IDs** (e.g. `BV1jzgh6VECw`) or **AV IDs** (e.g. `av12345`). `userUrls` accept `space.bilibili.com` URLs or bare **UIDs** - one per line.

### How to use it (step by step)

1. Choose an **Operation**.
2. Fill in the matching input:
   - Search videos -> add one or more **Search keywords** (Chinese, English, brands and emoji all work).
   - Video details / Video comments -> paste **Video URLs / IDs** (BV or AV).
   - Creator profile / Creator's videos -> paste **Creator URLs / UIDs**.
3. Set **Maximum results per input** (default 100, or 0 for all available) for the paginated operations.
4. For search, optionally set **Sort order**. For comments, optionally choose **Hot** or **Newest**.
5. Press **Start**. Export the dataset as JSON, CSV, Excel, XML or via the API.

### Input

| Field | Type | Description |
|-------|------|-------------|
| `operation` | string | **Required.** `search_videos`, `video_detail`, `video_comments`, `user_profile`, or `user_videos`. |
| `keywords` | array | Search keywords (for `search_videos`). |
| `videoUrls` | array | Video URLs, BV IDs or AV IDs (for `video_detail`, `video_comments`). |
| `userUrls` | array | Creator URLs or UIDs (for `user_profile`, `user_videos`). |
| `maxItems` | integer | Max results per keyword / creator / video. `0` = all available. Default `100`. |
| `searchOrder` | string | `comprehensive`, `most_played`, or `newest` (search only). |
| `commentSort` | string | `hot` or `time` (comments only). |

### Output

Every row carries a `record_type` of `video`, `user` or `comment`. Common video fields:

| Field | Description |
|-------|-------------|
| `aid`, `bvid`, `video_url` | Video identity and canonical URL. |
| `title`, `desc`, `category` | Video title, description and Bilibili partition. |
| `play_count`, `danmaku_count`, `like_count`, `reply_count`, `favorite_count`, `coin_count`, `share_count` | Engagement metrics (full stats on the detail operation). |
| `author_id`, `author_name`, `author_avatar_url` | Creator data. |
| `cover_url`, `duration_seconds` | Thumbnail and length. |
| `create_time`, `pub_location` | Publish time (ISO-8601 UTC) and region. |

Creator (`user`) rows add `followers_count`, `following_count`, `video_count`, `likes_total`, `level`, `profile_url` and `sign` (bio). Comment (`comment`) rows add `comment_id`, `content`, `like_count`, `reply_count` and `author_level`.

Example video row:

```json
{
  "record_type": "video",
  "operation": "video_detail",
  "input": "BV1jzgh6VECw",
  "aid": "116973031661109",
  "bvid": "BV1jzgh6VECw",
  "video_url": "https://www.bilibili.com/video/BV1jzgh6VECw",
  "title": "…",
  "category": "科技",
  "duration_seconds": 79,
  "play_count": 1780,
  "danmaku_count": 25,
  "like_count": 33,
  "reply_count": 18,
  "favorite_count": 30,
  "coin_count": 6,
  "author_name": "…"
}
````

### Common use cases

- **Trend tracking** - watch what is rising on Bilibili for any keyword, by comprehensive, most-played or newest.
- **Creator (UP主) discovery** - find creators for a niche, then pull their profile and full video history.
- **Competitor and channel monitoring** - track a channel's uploads, engagement and comment sentiment.
- **Market and AI research** - build datasets of Chinese Gen-Z video content, danmaku and comments.

### Notes on reliability

- Cover and media URLs are served by Bilibili's CDN and can change; fetch them promptly.
- View, like and comment counts reflect what Bilibili returns at scrape time.
- If a video or creator is private, deleted or region-locked, that input is skipped and the run continues.

### FAQ

**Do I need a Bilibili account, cookies or a proxy?** No. Just add your input and press Start.

**Can I use BV and AV IDs interchangeably?** Yes - `videoUrls` accepts full URLs, BV IDs and AV IDs.

**Can I run several keywords or URLs at once?** Yes - add multiple lines. For search and creator-videos, cross-input duplicate videos are removed automatically.

# Actor input Schema

## `operation` (type: `string`):

What to scrape. Each operation uses a different input field below:

• Search videos → Keywords
• Video details → Video URLs / IDs
• Video comments → Video URLs / IDs
• Creator profile → Creator URLs / UIDs
• Creator's videos → Creator URLs / UIDs

## `keywords` (type: `array`):

For the "Search videos" operation. Add one or more keywords - Chinese, English, brand names and emoji all work. Each keyword is searched independently and cross-keyword duplicates are removed.

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

For the "Video details" and "Video comments" operations. Paste full video URLs, BV IDs (e.g. BV1jzgh6VECw) or AV IDs (e.g. av12345) - one per line.

## `userUrls` (type: `array`):

For the "Creator profile" and "Creator's videos" operations. Paste full space.bilibili.com URLs or bare UIDs - one per line.

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

Upper bound on results per keyword / creator / video (for the paginated operations: search, creator's videos, comments). Cost scales linearly. Set 0 to fetch all available.

## `searchOrder` (type: `string`):

For "Search videos" only. How Bilibili orders results.

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

For "Video comments" only. Order comments by hot (top) or by time (newest).

## Actor input object example

```json
{
  "operation": "search_videos",
  "keywords": [
    "编程",
    "vlog"
  ],
  "maxItems": 100,
  "searchOrder": "comprehensive",
  "commentSort": "hot"
}
```

# Actor output Schema

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

All scraped Bilibili results in the default dataset.

## `overview` (type: `string`):

Overview table of the scraped results.

# 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 = {
    "keywords": [
        "编程",
        "vlog"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("vulnv/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 = { "keywords": [
        "编程",
        "vlog",
    ] }

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

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

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

```

## CLI example

```bash
echo '{
  "keywords": [
    "编程",
    "vlog"
  ]
}' |
apify call vulnv/bilibili-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=vulnv/bilibili-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Bilibili 哔哩哔哩 Scraper - Videos, Creators & Comments",
        "description": "Scrape Bilibili (哔哩哔哩 / B站): keyword video search, full video details, creator profiles, a creator's uploaded videos, and video comments. Export views, likes, coins, danmaku, comments and creator data to JSON/CSV/Excel. No login, cookies or proxy needed.",
        "version": "1.0",
        "x-build-id": "anSG9pSg9M5uQxff3"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/vulnv~bilibili-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-vulnv-bilibili-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/vulnv~bilibili-scraper/runs": {
            "post": {
                "operationId": "runs-sync-vulnv-bilibili-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/vulnv~bilibili-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-vulnv-bilibili-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "operation"
                ],
                "properties": {
                    "operation": {
                        "title": "⚙️ Operation",
                        "enum": [
                            "search_videos",
                            "video_detail",
                            "video_comments",
                            "user_profile",
                            "user_videos"
                        ],
                        "type": "string",
                        "description": "What to scrape. Each operation uses a different input field below:\n\n• Search videos → Keywords\n• Video details → Video URLs / IDs\n• Video comments → Video URLs / IDs\n• Creator profile → Creator URLs / UIDs\n• Creator's videos → Creator URLs / UIDs",
                        "default": "search_videos"
                    },
                    "keywords": {
                        "title": "🔎 Search keywords",
                        "type": "array",
                        "description": "For the \"Search videos\" operation. Add one or more keywords - Chinese, English, brand names and emoji all work. Each keyword is searched independently and cross-keyword duplicates are removed.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "videoUrls": {
                        "title": "🎬 Video URLs / IDs",
                        "type": "array",
                        "description": "For the \"Video details\" and \"Video comments\" operations. Paste full video URLs, BV IDs (e.g. BV1jzgh6VECw) or AV IDs (e.g. av12345) - one per line.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "userUrls": {
                        "title": "👤 Creator URLs / UIDs",
                        "type": "array",
                        "description": "For the \"Creator profile\" and \"Creator's videos\" operations. Paste full space.bilibili.com URLs or bare UIDs - one per line.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxItems": {
                        "title": "📊 Maximum results per input",
                        "minimum": 0,
                        "maximum": 5000,
                        "type": "integer",
                        "description": "Upper bound on results per keyword / creator / video (for the paginated operations: search, creator's videos, comments). Cost scales linearly. Set 0 to fetch all available.",
                        "default": 100
                    },
                    "searchOrder": {
                        "title": "📈 Search sort order",
                        "enum": [
                            "comprehensive",
                            "most_played",
                            "newest"
                        ],
                        "type": "string",
                        "description": "For \"Search videos\" only. How Bilibili orders results.",
                        "default": "comprehensive"
                    },
                    "commentSort": {
                        "title": "💬 Comment sort order",
                        "enum": [
                            "hot",
                            "time"
                        ],
                        "type": "string",
                        "description": "For \"Video comments\" only. Order comments by hot (top) or by time (newest).",
                        "default": "hot"
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
