# Bilibili Scraper: Videos, Search, Comments & Creators (`rawtojson/bilibili-scraper`) Actor

Scrape Bilibili, the Chinese YouTube: search videos by keyword, get creator profiles, comments and trending lists as clean JSON. No login or API key. Results in under a minute, from $0.004 per video (5x cheaper than the top alternative).

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

## Pricing

Pay per event

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, search, comments and creators (no login)

**Bilibili Scraper** turns China's biggest video platform (the "Chinese YouTube") into clean, compact JSON: keyword search, video details, creator profiles, comments and the popular / top-100 lists. **No Bilibili account, no cookies, no API key.** The prefilled example returns data in under a minute.

### Who is it for?

- **Market researchers and brands** that want to see what is trending in China (tech, gaming, beauty, finance, anime).
- **Influencer and sourcing teams** building lists of Chinese creators (KOLs) with followers, level and latest videos.
- **AI and data teams** feeding agents, translation pipelines and RAG with Chinese titles, descriptions and comments.
- **Agencies** monitoring a keyword or competitor every day with a schedule.

### Quick start: input and real output

Paste this in the Console and press **Start**:

```json
{
  "searchQueries": ["python"],
  "searchOrder": "click",
  "maxItems": 5
}
```

You get items like this (real output of a local test run, shortened):

```json
{
  "type": "video",
  "bvid": "BV1rpWjevEip",
  "title": "【全748集】目前B站最全最细的Python零基础全套教程…",
  "authorName": "Python官方课程",
  "views": 21981594,
  "likes": 607510,
  "favorites": 929729,
  "comments": 374079,
  "publishedAt": "2024-08-22T14:59:18.000Z",
  "url": "https://www.bilibili.com/video/BV1rpWjevEip"
}
```

Bilibili sometimes answers a search with zero results on the first try. The Actor retries; if you still get nothing, run it again.

### Input

| Field | Type | Description |
|---|---|---|
| `searchQueries` | array | Keywords (Chinese or English). One search per keyword. |
| `searchOrder` | string | `totalrank` best match, `click` most viewed, `pubdate` newest, `dm` most danmaku, `stow` most favorited. |
| `videoUrls` | array | BV IDs (`BV1xx…`) or video links. |
| `userUrls` | array | Creator IDs or `space.bilibili.com/<id>` links. Returns the profile and latest videos. |
| `trending` | string | `none`, `popular` (popular now) or `ranking` (site-wide top 100). |
| `maxItems` | integer | Max videos per keyword, creator or list. Default 20, up to 1,000. |
| `includeComments` | boolean | Also return comments for every video found. |
| `maxCommentsPerVideo` | integer | Default 20. Bilibili shows up to about 1,000 per video without login. |
| `commentSort` | string | `hot` (most popular) or `time` (newest). |

```json
{
  "searchQueries": ["python", "人工智能"],
  "searchOrder": "click",
  "maxItems": 50,
  "includeComments": true,
  "maxCommentsPerVideo": 30
}
```

### Output

Every dataset item has a `type`: `video`, `user` or `comment`.

- **Video:** `bvid`, `url`, `title`, `description`, `publishedAt`, `durationSeconds`, `authorName`, `authorId`, `views`, `likes`, `coins`, `favorites`, `comments`, `danmaku`, `tags`.
- **Creator (`user`):** `userId`, `name`, `bio`, `avatar`, `level`, `followers`, `following`, `likes`, `videoCount`, `verified`.
- **Comment:** `commentId`, `bvid`, `text`, `likes`, `replyCount`, `publishedAt`, `authorName`, `authorId`, `authorLevel`, `location`.

Bilibili does not provide some counts (for example `likes`, `coins`) in search or creator lists; they are `null` there. Fetch the video with `videoUrls` to get all of them.

### Pricing compared with other Bilibili scrapers

Pay per event: you only pay for what you get. Items that cannot be found are not charged, and you can set a maximum cost per run.

| Actor | Per video | Per comment |
|---|---|---|
| **This Actor** | **$0.004** | **$0.002** |
| zhorex/bilibili-scraper | $0.020 per item | $0.020 per item |
| atomus/bilibili-scraper | $0.010 (search) / $0.020 (detail) | $0.008 |
| sian.agency/bilibili-video-scraper | $0.12 | n/a |

Prices as listed in the Apify Store in November 2026; check the other pages for current values. That is **$4 per 1,000 videos**, about 5 times less than the cheapest alternative above.

### Schedule it and send the data to Sheets, webhooks or n8n

- **Schedule:** in the Console open *Schedules* and run the Actor daily with a keyword and `searchOrder: "pubdate"` to get a feed of new videos.
- **Google Sheets:** add the *Google Sheets* integration (Integrations tab) to append every run's dataset to a sheet.
- **Webhook:** add a webhook on `ACTOR.RUN.SUCCEEDED` to call your own URL, Slack, Make or n8n when new data is ready.
- **API / MCP:** run it with the Apify API, the JavaScript or Python client, or through the Apify MCP server (`mcp.apify.com`). The input is small and flat, so agents can call it directly.

### FAQ

**Do I need a Bilibili account?** No. The Actor reads public data only and never logs in.

**Is the text translated?** No. Titles, descriptions and comments come in the original language, mostly Chinese. Translate them downstream with your favourite tool or LLM.

**How many results can I get?** About 1,000 search results per keyword and about 1,000 comments per video, which is what Bilibili shows to anonymous visitors.

**Can it download videos or subtitles?** No. It returns metadata, profiles and comments, not the video itself.

**Why only 25 videos for a creator sometimes?** Bilibili occasionally rejects requests at random. If a creator's full list stays blocked, the Actor falls back to the 25 most recent videos. Run again to get the full list.

**Does it work from outside China?** Yes, it runs from Apify's servers.

### Legal notice

The Actor only collects public information that any visitor can see, and does not log in or bypass access controls. You are responsible for using the data in line with Bilibili's terms, local law and data-protection rules such as GDPR. Names and comments can be personal data: handle them accordingly.

### En español

**Bilibili Scraper** extrae vídeos, resultados de búsqueda, perfiles de creadores, comentarios y listas de tendencias de Bilibili (el "YouTube chino") en JSON limpio, sin cuenta ni clave de API. Útil para estudios de mercado en China, búsqueda de creadores (KOL), monitorización de marcas y alimentar agentes de IA. Precio: 0,004 $ por vídeo o perfil y 0,002 $ por comentario (pago por evento). Los textos vienen en el idioma original (chino). Pega el ejemplo de entrada, pulsa **Start** y obtendrás datos en menos de un minuto. Usa solo datos públicos y respeta los términos de la plataforma y la normativa de protección de datos.

### Support

Found a bug or need a field? Open an issue on the Actor page; issues are answered within 24 hours. More Actors by rawtojson at **https://rawtojson.com**.

# Actor input Schema

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

Keywords to search for videos (Chinese or English). One search per keyword.

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

How to sort search results.

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

Specific videos: BV IDs (BV1xx...) or links like https://www.bilibili.com/video/BV1xx...

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

Creators: numeric IDs or links like https://space.bilibili.com/12345. Returns the profile and their latest videos.

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

Optionally add Bilibili's trending lists.

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

Maximum videos for each keyword, creator or trending list.

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

Also return the comments of every video found. Each comment is charged separately.

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

Only used when comments are included. Bilibili shows up to about 1,000 comments per video without login.

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

Sort comments by popularity or newest first.

## Actor input object example

```json
{
  "searchQueries": [
    "python"
  ],
  "searchOrder": "totalrank",
  "trending": "none",
  "maxItems": 10,
  "includeComments": false,
  "maxCommentsPerVideo": 20,
  "commentSort": "hot"
}
```

# Actor output Schema

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

All scraped items. The 'type' field is video, user or comment.

# 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": [
        "python"
    ],
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("rawtojson/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": ["python"],
    "maxItems": 10,
}

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

```

## MCP server setup

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