# Bilibili Scraper - Videos, Comments, Uploader Profiles & Stats (`s-r/bilibili-scraper`) Actor

Export Bilibili video views, likes, coins, favorites and danmaku counts, uploader profiles and public comments. Start from keywords, video links, BV IDs, uploader IDs, popular videos or current category rankings. Built for agencies, China-focused marketers and researchers.

- **URL**: https://apify.com/s-r/bilibili-scraper.md
- **Developed by:** [SR](https://apify.com/s-r) (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 $4.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/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, Comments, Uploader Profiles & Stats

Bilibili Scraper collects video engagement, uploader profiles and public Bilibili comments for agencies, China-focused marketers and researchers. Start with keywords, video links, BV IDs, uploader IDs or the popular list, and export structured rows with views, likes, coins, favorites and danmaku counts. No Bilibili account, login or API key is needed.

### What Bilibili Scraper collects

Use keyword search to discover videos about a game, product, creator or campaign. Search terms can be Chinese or Latin text. Each video row includes a stable BV ID, public URL, title, uploader identity, publication time, thumbnail and duration in seconds. Engagement fields include views, likes, favorites, comments and danmaku counts. Coins and shares are populated when the source provides them. Missing values remain null, so an unavailable count is distinguishable from a measured zero.

Video mode retrieves the details of specific videos. It accepts full desktop or mobile video URLs, bare BV IDs, av IDs and b23.tv short links. You can therefore paste existing campaign URLs directly into the input. Video mode also retrieves video tags when available. The output keeps the original tags and adds a lowercase, deduplicated hashtags field for matching across datasets.

Profile mode collects uploader names, biographies, follower counts, following counts and the number of uploaded videos. Additional profile fields include total received likes, account level, public verification information and the avatar URL. Uploader video mode lists an uploader's videos rather than returning the profile itself. The uploader ID connects those records, making it possible to combine creator audience size with engagement on recent work.

Comments mode returns public top-level reactions with text, author identity, publication time and likes. Set include_replies to include the inline replies returned with each comment page as their own rows. These replies have parent and root identifiers. This option does not expand every reply thread, and the source may expose only a sample of replies. Danmaku is reported as a count on videos; danmaku text, sentiment analysis and private account information are outside this actor's scope.

### Bilibili Scraper input

Choose an explicit mode. The default is popular, which provides a useful first run without requiring a video or creator ID.

| Field | Purpose |
| --- | --- |
| mode | search, videos, comments, profiles, uploader_videos or popular |
| search_terms | A list of keywords for search mode |
| video_urls | Video URLs, BV IDs, av IDs or short links for videos and comments |
| uploader_ids | Numeric mid IDs or profile URLs for profiles and uploader_videos |
| max_results | From 1 to 1,000 rows per search term, uploader or comments video; default 20 |
| sort | Search relevance, views, publication date, danmaku or favorites; comments hot or newest |
| duration | Search filter: any, under_10, 10_30, 30_60 or over_60 minutes |
| category | Current category code: 1008 games, 1003 music, 1012 technology, or 0 all; omit for the popular list. Supported legacy main IDs are translated. |
| include_details | Add full video details to list results |
| include_replies | Include the inline replies exposed on comments pages |

A real example input using the video from the captured output below:

```json
{"mode":"videos","video_urls":["BV14sHj62EzS"]}
```

max_results applies separately to each input group. Two search terms with a limit of 20 can return up to 40 rows. Inline replies count toward the comments limit. Direct video and profile modes return one row per valid input; their input lists determine the requested volume. Deleted videos and unknown uploaders are skipped with a warning when other inputs succeed. If every requested input is unavailable, the run returns no dataset rows.

Search defaults to relevance. Its sort values are totalrank, click, pubdate, dm and stow. Comments use hot or newest. Uploader lists use pubdate by default, or click for most viewed and stow for most favorited. The latter two scan the uploader catalog before returning the selected videos, so large catalogs take longer. Collaboration videos can have a different primary uploader; the input field retains the requested uploader ID. Source ordering and available results may change between runs. A category ranking is a source list with its own finite size, rather than an unlimited search.

Category rankings use Bilibili's current category codes. Use 0 for all, 1001 film, 1002 entertainment, 1003 music, 1004 dance, 1005 animation, 1007 kichiku, 1008 games, 1010 knowledge, 1012 technology, 1013 cars, 1014 fashion, 1018 sports, 1020 food or 1024 animals. The corresponding legacy main IDs 181, 5, 3, 129, 1, 119, 4, 36, 188, 223, 155, 234, 211 and 217 still work as aliases. Obsolete subcategories and the split legacy category 160 are rejected for rankings. Keyword search translates the current codes to its supported search categories.

The actor checks the newest publication date in each primary ranking. A list whose newest video is older than 30 days, or which lacks publication dates, is rejected instead of being delivered as a current ranking. Individual videos in a current ranking can still be older: ranking reflects present attention, rather than a publication-date filter.

If the all-category ranking (category 0) is unavailable, the actor may return an alternative all-category list with a warning and partial set to true. Its coins, likes, favorites and publication times remain null unless include_details is enabled. Other category rankings report an unavailable source without substituting an obsolete list.

Keyword search returns standard video records with valid BV IDs. Bilibili can mix course listings into search results; those listings are skipped and do not count toward max_results or billing. The rank field preserves the original source position, so skipped listings can leave gaps in the rank numbers.

### Bilibili Scraper output

The dataset contains one row per video, profile or comment. record_type identifies video, profile or comment; \_type identifies the shared social record type post, profile or comment. Every row also contains source, platform, fetched_at and the input that produced it.

Video and comment rows share post_id in BV format. Profiles use profile_id in mid format. Comment rows add comment_id and parent_comment_id. These identifiers are suitable join keys for repeated research runs. Public URLs allow analysts to inspect the source material beside the exported data.

This excerpt comes from a real video response captured on 5 October 2026. Counts are a snapshot and will change:

```json
{
  "record_type": "video",
  "post_id": "BV14sHj62EzS",
  "author_id": "14471979",
  "author_handle": "冰尖の霜语",
  "views": 1054160,
  "likes": 37021,
  "coins": 17092,
  "favorites": 21863,
  "shares": 7683,
  "comments_count": 1898,
  "danmaku_count": 460,
  "duration_seconds": 269,
  "posted_at": "2026-10-04T07:51:19Z"
}
```

Export the default dataset as JSON, CSV or Excel through Apify. The OUTPUT record contains delivery information, warnings and charged events. Automated runs can be scheduled through Apify and their datasets consumed through the Apify API. Larger requests continue automatically while runtime and charging limits allow.

### Bilibili Scraper pricing

Delivered video, profile and comment rows use separate billing events. Full detail enrichment is part of the video row and does not add a second detail charge. Inline replies are delivered comment rows and count toward the comment event. The current monetary rates are shown in this actor's Pricing tab.

Empty results have no row charges and there is no actor start event in this product's charge map. Users without a paid Apify plan receive at most ten delivered rows per run. Missing records do not create paid placeholder rows. Apify usage or platform costs shown separately by Apify follow the platform's own rules.

### Use cases

- **Influencer and KOL discovery.** Search a product category or game title, sort by views, then collect the uploader profiles behind the top videos to compare follower counts, video counts and received likes.
- **Campaign tracking.** Paste the BV IDs of sponsored videos and schedule a run. Each run adds a fresh snapshot of views, likes, coins, favorites, shares and danmaku counts with a fetched_at time.
- **Audience and comment research.** Collect Bilibili comments for a set of videos, sorted hot or newest, and analyse what viewers ask, praise or criticise. Comment likes show which reactions resonate.
- **Trend monitoring.** Pull the popular list or a current category ranking every day to see which topics and creators break through on Chinese video platforms.
- **Academic and market research.** Build reproducible datasets of video metadata and public reactions, with stable IDs that join across runs.

### Research and campaign workflows

Search related terms separately to compare campaign themes, then join videos to uploader profiles using author_id and profile_id. Use full details when coins or shares are needed for analysis. Preserve fetched_at so you can compare successive engagement snapshots. Comment IDs help identify reactions already collected by an earlier scheduled run; this actor does not maintain a private delta database between runs.

### Bilibili Scraper compared with other options

**Compared with Bilibili downloaders.** Downloaders save video or audio files. This actor exports metadata and engagement numbers as rows, which is what reporting, dashboards and research need. It does not download media.

**Compared with single-purpose actors.** Some tools only search, only fetch comments or only fetch one video at a time. Bilibili Scraper covers keyword search, video details, uploader profiles, uploader video lists, comments, the popular list and current category rankings in one actor, with one dataset shape and shared join keys between videos, profiles and comments.

**Compared with building it yourself.** Open-source libraries for the Bilibili API exist, but you have to host them, keep up with source changes, handle pagination and normalise the fields yourself. This actor returns normalised rows with null for unavailable values and continues large requests automatically.

**What it does not do.** It reports the danmaku count per video, not the danmaku text, and it does not run sentiment analysis or translate keywords. If you need bullet-comment text, use a dedicated danmaku tool next to this one.

Billing is per delivered row, with separate events for videos, profiles and comments and no start fee, so an empty search costs no row charges.

### FAQ

#### Do I need a Bilibili API key or account?

No. The actor collects publicly visible data without logging in. You only need an Apify account to run it, and you can call it through the Apify API from your own code.

#### How do I scrape Bilibili comments for a video?

Choose comments mode, put the video URL or BV ID in video_urls and set max_results. Use sort hot for the most liked reactions or newest for the latest ones, and include_replies to add the inline replies on each page.

#### How does Bilibili search work in this actor?

Choose search mode and list one or more keywords in search_terms. Each term returns up to 1,000 video rows, sorted by relevance, views, publication date, danmaku or favorites, and optionally filtered by duration. Course listings that Bilibili mixes into search results are skipped and are not billed; the rank field keeps the original search position.

#### Does the actor translate my keywords?

No. It searches exactly the supplied terms. Supply Chinese and Latin variants as separate search_terms when your research needs both. A nonsense term that produces only unrelated source recommendations is treated as an empty search.

#### Are all engagement counters available on every video row?

No. Search results and uploader lists omit some details. Use include_details to retrieve full video records. A null count means the value was unavailable, while zero means the source actually reported zero.

#### Does include_replies collect complete comment threads?

No. It returns inline replies exposed on each collected page. Comment availability is controlled by Bilibili, and disabled comments produce an empty result. The reported video comment count can include replies and need not equal the number of exported top-level comments.

#### Can I collect the entire popular list?

Request a high enough max_results. Collection ends when the source indicates that its list is complete. Category rankings and keyword searches have their own source limits; requesting more does not create extra records.

#### Can I get Bilibili rankings by category?

Yes. Choose popular mode and set category to a current code such as 1008 for games, 1003 for music or 1012 for technology, or 0 for all categories. Legacy main codes such as 4, 3 and 188 are translated automatically. Each ranking contains up to 100 videos, and its newest publication date must be within 30 days. If a category source is unavailable, the run reports that limitation. Only category 0 can use an alternative list, with a warning and partial set to true; enable include_details when its missing coins, likes, favorites and publication times are needed.

#### Can I use this for private profiles or video downloads?

This actor collects publicly exposed metadata and reactions. It does not log in to private accounts or download video media. Use the video and profile URLs in the output to review public source material.

# Actor input Schema

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

Select keyword search, video details, comments, uploader profiles, uploader videos or popular videos.

## `search_terms` (type: `array`):

Chinese or Latin keywords. Required in search mode; the limit applies separately to each term.

## `video_urls` (type: `array`):

Bilibili video URLs, mobile URLs, BV IDs, av IDs or b23.tv links. Required for videos and comments.

## `uploader_ids` (type: `array`):

Numeric uploader mid IDs or space.bilibili.com profile URLs. Required for profiles and uploader_videos.

## `max_results` (type: `integer`):

Maximum delivered rows per keyword, uploader or comments video. Inline replies count toward the limit. Direct video and profile modes return one row per input.

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

Search: totalrank (default), click, pubdate, dm or stow. Uploader videos: pubdate (default), click or stow. Comments: hot (default) or newest.

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

Search video duration filter, in minutes.

## `category` (type: `integer`):

Popular rankings use current Bilibili tid_v2: 0 all, 1001 film, 1002 entertainment, 1003 music, 1004 dance, 1005 animation, 1007 kichiku, 1008 games, 1010 knowledge, 1012 technology, 1013 cars, 1014 fashion, 1018 sports, 1020 food, 1024 animals. Supported legacy main IDs are translated; obsolete ranking subcategories are rejected. Omit for the popular list. Search translates these tid_v2 IDs to legacy tids. Only the all-category ranking may use an alternative source with a warning. Rankings without recent publication dates are rejected.

## `include_details` (type: `boolean`):

Enrich each list video with full details, including coins and shares. Included in the video row event.

## `include_replies` (type: `boolean`):

Return the inline replies visible on each comments page as separate comment rows. Does not expand full reply threads.

## `cursor` (type: `string`):

Continuation string from next_cursor. Keep every other input unchanged. Apify follows it automatically.

## Actor input object example

```json
{
  "mode": "videos",
  "video_urls": [
    "BV14sHj62EzS"
  ],
  "max_results": 20,
  "duration": "any",
  "include_details": false,
  "include_replies": false
}
```

# Actor output Schema

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

Video, profile and comment records.

## `output` (type: `string`):

Delivered counts, warnings and charged events.

# 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 = {
    "mode": "videos",
    "video_urls": [
        "BV14sHj62EzS"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("s-r/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 = {
    "mode": "videos",
    "video_urls": ["BV14sHj62EzS"],
}

# Run the Actor and wait for it to finish
run = client.actor("s-r/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 '{
  "mode": "videos",
  "video_urls": [
    "BV14sHj62EzS"
  ]
}' |
apify call s-r/bilibili-scraper --silent --output-dataset

```

## MCP server setup

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