# Bilibili Scraper: Videos, Comments, Trending & UP主 Profiles (`s3nafps/bilibili-scraper`) Actor

Scrape Bilibili (B站) without login: video search, details, comments, trending boards and UP主 profiles. Use this when tracking a brand or trend in China. From $2.50 per 1,000 videos.

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

## Pricing

from $1.50 / 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

### What does Bilibili Scraper do?

**Bilibili Scraper** collects public data from [Bilibili](https://www.bilibili.com) (哔哩哔哩, B站), China's largest video community, **without login or cookies**. It works as a simple **Bilibili API alternative**: search **videos by keyword**, get **video details and stats**, download **comments and reply threads**, read **trending boards** and fetch **creator (UP主) profiles**, all in one clean, flat format.

![Bilibili Scraper — Search, Comments & Trending (No Login) demo](https://s3nafps.github.io/media/bilibili-scraper/promo.gif)

[▶ Watch the full video](https://s3nafps.github.io/media/bilibili-scraper/promo.mp4)

It does not download video files, danmaku (bullet comments) or data that needs a Bilibili account.

### Why scrape Bilibili?

Bilibili has hundreds of millions of monthly users and is where Chinese Gen Z talks about games, tech, anime, brands and products. Teams use this Actor to:

- 📈 **Monitor brands and products** in China: daily "only new" runs return just the new videos and comments that mention you.
- 🔎 **Do market and competitor research**: what gets views, likes, coins and favorites in your category.
- 🎮 **Track trends**: the overall popular board and category rankings (game, tech, knowledge, music…).
- 🤝 **Find creators** for influencer marketing: followers, total likes, video count, verification.
- 🤖 **Feed AI agents and dashboards** with structured Chinese social data.

On Apify you also get scheduling, an API, webhooks, integrations (Google Sheets, Make, Zapier, n8n), proxy rotation and run monitoring out of the box.

### What data can Bilibili Scraper extract?

| Field | Example | Description |
|---|---|---|
| `type` | `video` | `video`, `comment`, `trend`, `profile` or `error` |
| `id` | `BV1xx411c7mD` | BV id, comment id or creator id |
| `url` | `https://www.bilibili.com/video/BV1xx411c7mD` | Public link |
| `text` | `字幕君交流场所` | Title + description, comment text or profile bio |
| `authorName` / `authorId` | `老番茄` / `546195` | Creator or commenter |
| `createdAt` | `2026-10-20T18:01:45+08:00` | Publish time, Beijing time |
| `views`, `likes`, `comments`, `shares`, `favorites` | `21218` | Engagement counts (integers) |
| `authorFollowers`, `authorVerified` | `20854252`, `true` | Profiles only |
| `platformMetrics` | `{"coins": 49, "danmaku": 27, "duration": 8710}` | Bilibili extras: coins, danmaku count, duration (seconds), tags, categoryId, rank, aid, cid, level, video count |
| `mediaUrls` | `["https://i0.hdslb.com/…jpg"]` | Cover image or avatar |
| `keyword` | `原神` | Search keyword that found the row |
| `parentId` | `BV12ez4BHEDM` | For comments: the video; for replies: the parent comment |

### How to scrape Bilibili

1. Click **Try for free** and open the **Input** tab.
2. Pick a **mode**: search, video details, comments, trending or creator profiles.
3. Enter **keywords** (search) or **video / creator links or IDs** (other modes). Add the Chinese name of a brand for full coverage, e.g. `Nike` and `耐克`.
4. Set **Max results**, e.g. 20 for a quick check or 500 for a sweep.
5. Click **Start** and download the results as JSON, CSV, Excel or HTML, or read them through the API.

### How much will it cost to scrape Bilibili?

You pay only for results. **Error rows, duplicates and items skipped by "only new" are free**, and there is no extra charge for proxies or compute.

| Result | Free & Bronze plans | Silver plan | Gold plan and higher |
|---|---|---|---|
| Video (search or details) | $2.50 / 1,000 | $2.00 / 1,000 | $1.50 / 1,000 |
| Trending row | $2.50 / 1,000 | $2.00 / 1,000 | $1.50 / 1,000 |
| Comment or reply | $1.00 / 1,000 | $0.80 / 1,000 | $0.60 / 1,000 |
| Creator profile | $3.00 / 1,000 | $2.50 / 1,000 | $2.00 / 1,000 |

Plus a tiny **$0.00005 start fee per run**. Examples: 100 search results cost about **$0.25**; a daily check of 20 new videos costs about **$1.50 a month**. Apify's free plan includes $5 of monthly credit, which is about 2,000 videos.

### Input

See the **Input** tab for all options. Each run uses one mode; paste one of these to start.

**Search videos by keyword** (sort: relevance, newest, views, comments, danmaku, favorites; optional date and length filters):

```json
{"mode": "search", "keywords": ["Nike", "耐克"], "sort": "newest", "maxItems": 50}
```

**Video details**, optionally with the top comments:

```json
{"mode": "details", "urls": ["https://www.bilibili.com/video/BV1xx411c7mD", "av170001"], "includeComments": true}
```

**Comments** with reply threads:

```json
{"mode": "comments", "urls": ["BV1xx411c7mD"], "includeReplies": true, "maxCommentsPerItem": 100}
```

**Trending**, overall or by category (animation, music, dance, game, knowledge, tech, sports, car, life, food, animal, fashion, entertainment):

```json
{"mode": "trending", "trendingCategory": "tech", "maxItems": 50}
```

**Creator profiles** from space links or numeric IDs:

```json
{"mode": "profiles", "urls": ["https://space.bilibili.com/546195", "208259"]}
```

### Output

You can download the dataset in various formats such as JSON, HTML, CSV or Excel. Every row has the same fields; fields that don't apply are `null`. Example (shortened):

```json
[
  {
    "platform": "bilibili", "type": "video", "id": "BV1Wenc6aExW",
    "url": "https://www.bilibili.com/video/BV1Wenc6aExW",
    "text": "【原神】判测胜券本征，原魔战队表现排行",
    "authorId": "130929912", "authorName": "并非云某人", "authorUrl": "https://space.bilibili.com/130929912",
    "createdAt": "2026-10-20T18:01:45+08:00",
    "views": 21218, "likes": 806, "comments": 238, "favorites": 87,
    "platformMetrics": {"danmaku": 273, "duration": 384, "tags": "原神,搞笑", "aid": 117472640565470},
    "mediaUrls": ["https://i2.hdslb.com/bfs/archive/47c043847aef39fdaacc1ceed4e8db3468bcb4dd.jpg"],
    "keyword": "原神", "scrapedAt": "2026-10-20T21:05:36+00:00"
  },
  {
    "platform": "bilibili", "type": "profile", "id": "546195", "url": "https://space.bilibili.com/546195",
    "text": "新浪微博：_老番茄_", "authorName": "老番茄",
    "authorFollowers": 20854252, "authorVerified": true, "likes": 196347739,
    "platformMetrics": {"videoCount": 682, "following": 7, "level": 6, "verifiedTitle": "2025百大UP主"}
  },
  {
    "platform": "bilibili", "type": "error", "errorCode": "INVALID_INPUT",
    "errorMessage": "Not a Bilibili creator link or numeric ID.", "input": "not-a-creator"
  }
]
```

### Monitor a brand every day (only new)

1. Use `search` with your brand keywords and `"sort": "newest"`.
2. Turn on **Only new items** and give the monitor a name, e.g. `"monitorName": "nike-daily"`.
3. Save the input as an Apify task and add a daily schedule.

Each run returns **only videos and comments that earlier runs with the same monitor name did not deliver**, so you pay only for new items. Only-new also works in `comments` and `trending` mode.

### Use it from Claude, ChatGPT or any MCP client

This Actor is available as a tool through the Apify MCP server at https://mcp.apify.com. Connect your AI assistant and add `s3nafps/bilibili-scraper`; the agent calls it with the input JSON above, e.g. "What are Chinese viewers saying about the new iPhone on Bilibili this week?"

### Tips

- **Search returns up to about 1,000 videos per keyword** (Bilibili stops at 50 pages). Use several keywords, date filters (`publishedAfter`, `publishedBefore`) or different sort orders to go deeper.
- Keep the default 512 MB memory; more memory does not make runs faster.
- Set a **maximum cost per run** in the run options; the Actor stops cleanly at your limit.

### FAQ

#### Why do I get only 3 comments per video?

Without login, Bilibili shows only the top 3 top-level comments of each video to everyone. Turn on `includeReplies` to also collect the reply threads under them. This Actor never logs in.

#### What happens when Bilibili rate-limits a run?

The Actor slows down, rotates sessions and, if needed, proxies. If Bilibili still blocks it, the run ends successfully with the items it got plus one free `BLOCKED` row. Try again later.

#### Are short b23.tv links supported?

Not yet; paste the full `bilibili.com/video/…` link or the BV / av id.

#### Which timezone are dates in?

`createdAt` is Beijing time (+08:00). Date filters are read as Beijing time unless you add an offset.

#### Is it legal to scrape Bilibili?

Our Actors are ethical and do not extract any private user data, such as email addresses, gender, or location. They only extract what the user has chosen to share publicly. We therefore believe that our Actors, when used for ethical purposes by Apify users, are safe. However, you should be aware that your results could contain personal data. Personal data is protected by the GDPR in the European Union and by other regulations around the world. You should not scrape personal data unless you have a legitimate reason to do so. If you're unsure whether your reason is legitimate, consult your lawyers. This Actor is not affiliated with or endorsed by Bilibili.

#### Need help or a new feature?

Open the **Issues** tab and tell us what you need. For programmatic access, see the **API** tab.

# Actor input Schema

## `mode` (type: `string`):

What to collect. search = videos for keywords; details = full stats for given videos; comments = comments for given videos; trending = Bilibili's popular board; profiles = creator profiles.

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

One or more search terms, e.g. \["Nike", "耐克"]. Add the Chinese brand name too for full coverage.

## `sort` (type: `string`):

Order of search results, e.g. newest for monitoring.

## `publishedAfter` (type: `string`):

Only videos published on or after this date, e.g. 2026-09-01. Dates are Beijing time unless you add an offset.

## `publishedBefore` (type: `string`):

Only videos published on or before this date (end of day), e.g. 2026-09-30. Beijing time unless you add an offset.

## `duration` (type: `string`):

Limit search results by video length, e.g. under10 for short videos.

## `urls` (type: `array`):

For details and comments: video links or IDs, e.g. https://www.bilibili.com/video/BV1xx411c7mD, BV1xx411c7mD or av170001. For profiles: creator links or numeric IDs, e.g. https://space.bilibili.com/546195.

## `trendingCategory` (type: `string`):

Which trending board to read, e.g. tech. 'all' is Bilibili's overall popular list.

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

How many search results to read per keyword, or trending rows in total, e.g. 20 for a quick check or 500 for a sweep.

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

Add the top comments under each video found. Without login Bilibili shows only the top 3 comments per video.

## `maxCommentsPerItem` (type: `integer`):

Comments (and replies) to collect per video, e.g. 50. Without login Bilibili shows only the top 3 top-level comments per video; turn on 'Include replies' to also collect the replies under them.

## `includeReplies` (type: `boolean`):

Also collect the reply threads under each comment, e.g. to read a full discussion.

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

hot = most liked first, newest = most recent first.

## `onlyNew` (type: `boolean`):

Return only videos, comments or trending rows that earlier runs with the same monitor name did not deliver. Combine with an Apify schedule, e.g. daily brand monitoring.

## `monitorName` (type: `string`):

Separate 'only new' memory per monitor, e.g. nike-daily. Used only with 'Only new items'.

## `proxyConfiguration` (type: `object`):

Apify Proxy is used automatically; the Actor switches to residential proxies only if Bilibili blocks it.

## `debugLog` (type: `boolean`):

Log every request with its timing, e.g. to troubleshoot slow runs.

## Actor input object example

```json
{
  "mode": "search",
  "keywords": [
    "人工智能"
  ],
  "sort": "relevance",
  "duration": "any",
  "urls": [
    "https://www.bilibili.com/video/BV1xx411c7mD"
  ],
  "trendingCategory": "all",
  "maxItems": 10,
  "includeComments": false,
  "maxCommentsPerItem": 20,
  "includeReplies": false,
  "commentSort": "hot",
  "onlyNew": false,
  "monitorName": "default",
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "debugLog": false
}
```

# Actor output Schema

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

Videos, comments, trending rows, profiles and free error rows in a table.

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

Every row with all fields, including platformMetrics and mediaUrls.

# 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": [
        "人工智能"
    ],
    "urls": [
        "https://www.bilibili.com/video/BV1xx411c7mD"
    ],
    "maxItems": 10,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("s3nafps/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": ["人工智能"],
    "urls": ["https://www.bilibili.com/video/BV1xx411c7mD"],
    "maxItems": 10,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("s3nafps/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 '{
  "keywords": [
    "人工智能"
  ],
  "urls": [
    "https://www.bilibili.com/video/BV1xx411c7mD"
  ],
  "maxItems": 10,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call s3nafps/bilibili-scraper --silent --output-dataset

```

## MCP server setup

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