# Bilibili Video Scraper (`automatic/bilibili-video-scraper`) Actor

Track public Bilibili (哔哩哔哩) videos by topic or creator. Search by keyword or look up a URL or BVID. Export titles, channels, dates and engagement counts, and schedule runs to collect newly found videos.

- **URL**: https://apify.com/automatic/bilibili-video-scraper.md
- **Developed by:** [Philip Kirkbride](https://apify.com/automatic) (community)
- **Categories:** Social media, Videos
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 videos

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 Video Scraper

Find public Bilibili videos and export their titles, channels, publication dates, and engagement. Use keyword searches to track creators and topics, or look up specific videos by URL or BVID. Schedule repeat searches to collect newly discovered videos for a dashboard or research dataset.

Each result includes a canonical video link and thumbnail. View the results in Apify or export them as CSV, JSON, or Excel.

### Try a video lookup

The prefilled example returns one keyboard performance. An empty input `{}` runs the same lookup.

```json
{
  "videoUrls": ["https://www.bilibili.com/video/BV1BgLbzAEzQ/"],
  "maxItems": 1
}
```

### Find videos by keyword

Clear the sample URL for a keyword-only search. Chinese terms such as `机械键盘` work well. The Actor keeps videos whose title, description, tags, or channel includes the full term. Set `includeRelated` to `true` to expand to the broader matches ranked by Bilibili.

```json
{
  "keywords": ["机械键盘"],
  "maxItems": 10,
  "maxPagesPerKeyword": 2
}
```

Add `publishedFrom` and/or `publishedTo` in `YYYY-MM-DD` format to filter by publication date. Both dates are inclusive in UTC. You can combine URLs and keywords. URL lookups are processed first, and the dataset contains one row per BVID.

### Monitor new videos

Set `onlyNewSinceLastRun` to `true` and choose a `watchName`, such as `mechanical-keyboard-videos`. Reuse the name on successive runs. Keyword searches start with the latest published results. The first run collects unseen videos within its limits, and later runs skip BVIDs already saved with that name. Existing `monitorStore` runs share history with `watchName` when the names match (inputs that still send `stateKey` keep working). Use separate names for independent watches and schedule runs for a given name serially.

### What you get

| Field | Contains |
| --- | --- |
| `bvid`, `aid`, `url` | Bilibili identifiers and canonical video link |
| `title`, `description`, `tags`, `category` | Public video metadata |
| `channelName`, `channelId`, `channelUrl` | Public uploader metadata |
| `publishedAt`, `durationSeconds`, `thumbnailUrl` | UTC publication timestamp, duration in seconds, and thumbnail |
| `views`, `likes`, `danmaku`, `comments`, `favorites` | Public engagement counts where available |
| `coins`, `shares` | Additional counts from a direct video lookup |
| `keyword` | Search term that first returned the video, or `null` for a direct lookup |

The run summary in `OUTPUT` reports the number of saved videos, skipped entries, and the reason if the run finds nothing or stops early. When Bilibili returns an error, the Actor keeps any rows already saved and reports the error.

### Pricing

Batch runs cost **$1.50 per 1,000 videos saved** ($0.0015 per video).

### Use it as an API

Get a video's title, channel, publication date, and public engagement counts. Get the answer in JSON from one HTTPS call. Call it from an AI agent through an HTTP-capable MCP tool, or add an HTTP request step in n8n, Make, or Zapier.

```bash
curl --get 'https://automatic--bilibili-video-scraper.apify.actor/' \
  --header "Authorization: Bearer $APIFY_TOKEN" \
  --data-urlencode bvid=BV1BgLbzAEzQ
```

Send the same fields as a JSON object with `POST /`. Results are in `data`. See `GET /openapi.json` for the request and response definitions.

### Your feedback

Found a missing video field or an issue with a lookup? Share an example BVID on this Actor's **Issues** tab.

### Limits

- This Actor covers publicly accessible video metadata on Bilibili’s Simplified Chinese site. It accepts full Bilibili video URLs and BVIDs. Search results and metadata can vary with region and availability.
- Keyword searches scan up to 3 pages per term by default, configurable up to 20. Custom inputs return up to 100 unique videos by default, configurable up to 500.
- The scheduled monitor tracks first sightings within the scanned pages. Each run covers the dates and terms supplied in its input.

# Actor input Schema

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

Enter one keyword or phrase per line. Chinese terms work well, for example 机械键盘.

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

Enter public Bilibili video URLs or BVIDs, one per line.

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

Maximum unique videos across all lookups and keywords. Omit for 100.

## `maxPagesPerKeyword` (type: `integer`):

Scan up to this many pages for each keyword. Omit for 3.

## `includeRelated` (type: `boolean`):

Include all Bilibili-ranked matches. By default, the title, description, tags or channel must contain the full keyword.

## `publishedFrom` (type: `string`):

Earliest publication date in UTC, inclusive, as YYYY-MM-DD.

## `publishedTo` (type: `string`):

Latest publication date in UTC, inclusive, as YYYY-MM-DD.

## `monitorStore` (type: `string`):

Optional. Set a store name and reuse it on scheduled runs to export only previously unseen BVIDs. Use 3 to 63 letters, digits or hyphens.

## `onlyNewSinceLastRun` (type: `boolean`):

Save only BVIDs not previously delivered for the same watch name.

## `watchName` (type: `string`):

Required for Only new videos. Reuse the same name of 3 to 63 letters, digits or hyphens on repeat runs.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.bilibili.com/video/BV1BgLbzAEzQ/"
  ],
  "maxItems": 1
}
```

# Actor output Schema

## `videos` (type: `string`):

No description

## `summary` (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 = {
    "videoUrls": [
        "https://www.bilibili.com/video/BV1BgLbzAEzQ/"
    ],
    "maxItems": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("automatic/bilibili-video-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 = {
    "videoUrls": ["https://www.bilibili.com/video/BV1BgLbzAEzQ/"],
    "maxItems": 1,
}

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

```

## MCP server setup

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