# Bilibili Comments & Replies Scraper (`fetch_cat/bilibili-comments-replies-scraper`) Actor

Extract public Bilibili video comments and nested replies for social listening, creator research, and AI datasets.

- **URL**: https://apify.com/fetch_cat/bilibili-comments-replies-scraper.md
- **Developed by:** [Fetch Cat](https://apify.com/fetch_cat) (community)
- **Categories:** Videos, Social media, AI
- **Features:** Limited permissions
- **Stats:** 14 total users, 3 monthly users, 97.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.30 / 1,000 comment or reply rows

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

Extract public comments and nested replies from known Bilibili videos. Provide BVIDs or video URLs and get structured rows for social listening, creator research, brand monitoring, market research, and AI dataset preparation.

### Quick start

Start with one public video and a small comment limit:

```json
{
  "bvidsOrUrls": ["BV1xx411c7mD"],
  "maxCommentsPerVideo": 10,
  "includeReplies": false,
  "proxyConfiguration": { "useApifyProxy": false }
}
```

Run the Actor, then open its dataset to export available rows as JSON, CSV, or Excel. This Actor does not discover videos or access login-only content.

Prefer a video guide? This short Apify walkthrough shows you how to set up and run an Actor. It uses a different Actor, but the setup steps are the same.

https://youtu.be/1OW8gOqlZbY?t=25

### What you get

Bilibili comment threads contain buyer opinions, fandom reactions, creator feedback, and community signals. This Actor turns public comment and reply text into exportable rows with stable IDs and parent-child links.

- Public top-level Bilibili video comments and optional nested replies.
- Comment text, timestamps, likes, and public commenter fields.
- Parent-child relationships through `rpid`, `rootRpid`, and `parentRpid`.
- Optional anonymization of public commenter fields while retaining a stable hash.
- Available video titles and creator names. Comment rows are retained when this optional information is unavailable.
- Video context on every row: publish date, duration and view, like, coin, favorite, share, danmaku and comment counts.
- Optional uploader's pinned comment, plus whether the uploader liked or replied to each comment.
- Attached comment pictures, @-mentions and commenter premium membership, verification and fan badge.

### Who is it for?

- **Social listening teams:** review audience reactions under campaign or brand videos.
- **Creator researchers:** study engagement, recurring topics, and reply chains.
- **Market researchers:** export Chinese video-platform discussions for qualitative analysis.
- **AI dataset builders:** prepare public CJK/emoji-rich conversation text with timestamps and IDs.

### Input settings

| Setting | API key | Description |
| --- | --- | --- |
| Videos | `bvidsOrUrls` | Public Bilibili BVIDs or video URLs to process. |
| Comment limit | `maxCommentsPerVideo` | Maximum top-level comments to save per video. |
| Include replies | `includeReplies` | Whether to collect nested replies. |
| Reply limit | `maxRepliesPerComment` | Maximum replies per top-level comment. |
| Order | `sort` | `hot` or `time`. |
| Include the pinned comment | `includePinnedComment` | Also saves the uploader's pinned comment as the first top-level row, marked `isPinned`. Off by default; it counts toward the comment limit. |
| Anonymize users | `anonymizeUsers` | Removes member ID, name, and avatar URL while keeping `memberHash`. |
| Request delay | `requestDelayMillis` | Delay between requests. |
| Request retries | `maxRequestRetries` | Retries for temporary request failures. |
| Proxy | `proxyConfiguration` | Optional Apify proxy settings. Direct access is the default. |

For a small discussion sample with replies:

```json
{
  "bvidsOrUrls": ["BV1xx411c7mD"],
  "maxCommentsPerVideo": 25,
  "includeReplies": true,
  "maxRepliesPerComment": 2,
  "sort": "hot",
  "includePinnedComment": true,
  "anonymizeUsers": true,
  "proxyConfiguration": { "useApifyProxy": false }
}
```

For top-level comments only, set `includeReplies` to `false`. Choose `time` to collect newest-first comments rather than the hot ordering.

### Output data

Each dataset item is a public comment or reply row.

| Fields | Description |
| --- | --- |
| `sourceUrl`, `bvid`, `aid` | Source input and resolved video identifiers. |
| `videoTitle`, `videoOwnerName` | Available video title and creator name, otherwise `null`. |
| `commentType`, `isReply` | Distinguish top-level comments from replies. |
| `rpid`, `rootRpid`, `parentRpid` | Stable comment/reply IDs and parent-child linkage. |
| `message`, `createdAt`, `likeCount`, `replyCount` | Comment text, time, and engagement. |
| `memberMid`, `memberName`, `memberLevel`, `memberAvatarUrl`, `memberHash` | Public commenter fields and stable hash. |
| `sort`, `repliesTruncated` | Collection order and reply-limit context. |
| `videoOwnerMid`, `videoPublishedAt`, `videoDurationSeconds` | Uploader member ID, publish time and length of the video. |
| `videoViewCount`, `videoLikeCount`, `videoCoinCount`, `videoFavoriteCount`, `videoShareCount`, `videoDanmakuCount`, `videoCommentCount` | Video statistics when the row was collected (`null` when video details are unavailable). |
| `isPinned`, `isUploaderLiked`, `isUploaderReplied` | Pinned uploader comment, and whether the uploader liked or replied to the comment. |
| `pictureUrls`, `mentionedUsers` | Images attached to the comment and @-mentioned display names. |
| `memberIsVip`, `memberVipLabel`, `memberVerification`, `memberFanBadge` | Commenter premium membership, official verification text and worn fan medal. |
| `apiCode`, `apiMessage`, `scrapedAt` | Response context and collection timestamp. |

Illustrative shape only. These values are not an observed extraction result:

```json
{
  "sourceUrl": "BV1xx411c7mD",
  "bvid": "BV1xx411c7mD",
  "aid": 2,
  "videoTitle": "Example Bilibili video",
  "commentType": "reply",
  "rpid": "1234567890",
  "rootRpid": "1234567000",
  "parentRpid": "1234567000",
  "message": "Public comment text",
  "createdAt": "2026-07-18T08:00:00.000Z",
  "likeCount": 12,
  "memberHash": "a1b2c3d4e5f6a7b8",
  "isReply": true,
  "videoPublishedAt": "2026-07-17T12:00:00.000Z",
  "videoViewCount": 154000,
  "videoCommentCount": 820,
  "isPinned": false,
  "isUploaderLiked": true,
  "pictureUrls": [],
  "memberIsVip": true,
  "memberVipLabel": "年度大会员",
  "scrapedAt": "2026-07-18T08:01:00.000Z"
}
```

#### Download your results

Open your run's dataset, choose **Export** and select JSON, CSV or Excel. JSON keeps nested fields together. CSV and Excel are useful when you want to review the records in a spreadsheet.

See [Apify's download and export guide](https://docs.apify.com/storage/dataset#apify-console) for the available formats and field options.

### Pricing

This Actor uses pay-per-event pricing. A **Start** event (`start`) is charged once per accepted run.

A **Comment or reply row** event (`item`) is charged for each saved comment or reply. No per-row event is charged without a saved comment or reply.

Input without any valid BVID is rejected before the start event. An accepted run can incur the start charge even when it saves no rows.

See the [live Pricing tab](https://apify.com/fetch_cat/bilibili-comments-replies-scraper/pricing) for current rates and discounts.

### Tips for best results

- **Start with one video.** Use a small comment limit to check the discussion before collecting a larger sample.
- **Bound reply collection.** Replies add saved rows. Both limits apply per video or comment, not to the whole run.
- **Keep the IDs when exporting.** Use the parent-child fields to reconstruct conversations in your analysis.
- **Review text before sharing.** Anonymizing commenter fields does not remove personal information embedded in messages.

### Limits and caveats

- Only public Bilibili video comments and replies are supported, not private, logged-in, paid, or restricted content. The Actor is not affiliated with Bilibili.
- Results depend on public availability and Bilibili's responses. Complete collection is not guaranteed, and optional video metadata can be missing.
- Explicitly empty comment threads can finish with zero rows. Temporary blocks or request failures do not prove that a video is private or deleted.
- Mixed batches can retain rows from successful videos when another video fails. Inspect the run summary for incomplete collection. If your run timeout or maximum cost per run is reached, the run stops before the limit, keeps the saved rows and a checkpoint, explains the stop in its status message and `RUN_SUMMARY`, and finishes successfully. You are never charged beyond your maximum cost.
- `anonymizeUsers` removes the public member ID, name, avatar URL, @-mentions, verification text and fan badge, but keeps `memberHash`. Comment text and other remaining fields still need review before sharing.

### Automation and integrations

#### Save your settings for next time

Once you have an input that works for you, [save it as an Apify task](https://docs.apify.com/actors/running/tasks). This keeps your settings together so you can use them again without filling in the form from scratch.

#### Run on a schedule

Need fresh results regularly? You can [schedule the Actor or a saved task](https://docs.apify.com/actors/running/schedules) to run at a time that suits you.

Each scheduled run collects the data again. If you want to compare results or highlight changes, add that step in your own workflow.

#### Send results to your other tools

Use **n8n, Make or Zapier** to connect this scraper to the rest of your workflow. For example, you could pass its results to an AI assistant or add records to a spreadsheet. Follow the [Apify integration guides](https://docs.apify.com/integrations) for your chosen tool.

For a custom connection, an [Apify webhook](https://docs.apify.com/integrations/webhooks) can notify your app when a run finishes or fails. Your app can then fetch the results or handle the failure.

### API usage

Want to collect this data from your own app or automation? The examples below send input to the scraper and show how to collect its results.

The Node.js and Python examples wait for the run to finish before reading its results. The cURL example starts the run and returns its details. Wait for that run to finish, then use its `defaultDatasetId` to fetch the results.

For setup instructions, see Apify's [JavaScript client guide](https://docs.apify.com/api/client/js), [Python client guide](https://docs.apify.com/api/client/python) and [Actor runs API reference](https://docs.apify.com/api/v2/acts-runs-post).

#### cURL

```bash
curl -X POST 'https://api.apify.com/v2/acts/fetch_cat~bilibili-comments-replies-scraper/runs' \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"bvidsOrUrls":["BV1xx411c7mD"],"maxCommentsPerVideo":10,"includeReplies":false}'

## Check the returned run ID until its status is SUCCEEDED.
curl 'https://api.apify.com/v2/actor-runs/RUN_ID' \
  -H "Authorization: Bearer $APIFY_TOKEN"

## Replace DATASET_ID with that run's defaultDatasetId to download its rows.
curl 'https://api.apify.com/v2/datasets/DATASET_ID/items?format=json&clean=true' \
  -H "Authorization: Bearer $APIFY_TOKEN"
```

#### Node.js

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('fetch_cat/bilibili-comments-replies-scraper').call({
  bvidsOrUrls: ['BV1xx411c7mD'],
  maxCommentsPerVideo: 10,
  includeReplies: false,
});
for await (const item of client.dataset(run.defaultDatasetId).iterateItems()) {
  console.log(item);
}
```

#### Python

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ['APIFY_TOKEN'])
run = client.actor('fetch_cat/bilibili-comments-replies-scraper').call(run_input={
    'bvidsOrUrls': ['BV1xx411c7mD'],
    'maxCommentsPerVideo': 10,
    'includeReplies': False,
})
for item in client.dataset(run['defaultDatasetId']).iterate_items():
    print(item)
```

### MCP and AI agents

You can ask your AI assistant to collect data with **Bilibili Comments & Replies Scraper** and help you work with the results. The scraper returns the data, and your assistant can then summarize it, compare records or prepare notes.

Connect your assistant through the [Apify MCP server](https://mcp.apify.com/). MCP gives your assistant a way to find this scraper, run it and read the results. Follow the [official setup and sign-in guide](https://docs.apify.com/mcp) for your app.

#### Easier setup with an Apify plugin

If you use a supported coding assistant, the [official Apify plugin](https://docs.apify.com/agents/plugins) can set up the connection for you. It connects your assistant to Apify and includes instructions for common tasks. Follow the guide for your particular app.

#### Use Apify AI in Console

Prefer to keep everything in Apify? Open [Apify AI in Console](https://docs.apify.com/account/apify-ai) and ask it to find Fetch Cat's **Bilibili Comments & Replies Scraper**. You can describe the data you want and ask questions about the results.

Apify AI is currently in beta. It asks for confirmation before starting an Actor, and normal run charges apply.

#### Choose your assistant

- **Claude and Claude Code (Anthropic):** [Apify setup guide](https://docs.apify.com/integrations/claude).
- **ChatGPT and Codex (OpenAI):** [Apify setup guides](https://docs.apify.com/integrations/openai).
- **Grok Bot (xAI):** [Apify plugin guide](https://docs.apify.com/integrations/grok-bot).
- **Gemini CLI (Google):** [MCP server setup guide](https://geminicli.com/docs/tools/mcp-server/). Use the server URL below with the HTTP configuration supported by Gemini CLI.

#### Connect just this scraper

To keep your setup focused on this scraper, add this server configuration to a compatible MCP client:

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=fetch_cat/bilibili-comments-replies-scraper"
    }
  }
}
```

Sign in to Apify when your client asks. If your client uses a Bearer token instead, follow its setup guide and keep the token in its secure configuration. Configuration formats vary by app, so use the linked guide if your client needs a different format.

#### Use Apify's general server

Already connected to the general Apify MCP server at `https://mcp.apify.com`? You can use it to find this scraper without adding another server. Ask your assistant to use **Bilibili Comments & Replies Scraper** by Fetch Cat, or give it the identifier `fetch_cat/bilibili-comments-replies-scraper`.

Your assistant should inspect the input schema before running and read results from the returned run's dataset. If the run is still working, it should follow that run rather than start it again. Both connection options use Apify's hosted service.

#### Example requests

- "Collect 20 public comments from this Bilibili video and summarize recurring audience reactions."
- "Get comments from these two Bilibili videos with commenter names removed, then prepare a comparison of the main discussion themes."
- "Collect ten comments and up to one reply per comment from this video, then organize the returned conversation rows into a spreadsheet."

Normal Apify charges apply. Check the [live Pricing tab](https://apify.com/fetch_cat/bilibili-comments-replies-scraper/pricing) before authorizing a run or asking your assistant to run a larger batch. Review comment text before sending it to an external assistant, even with anonymization enabled.

### Pay with x402

If your AI agent has a funded wallet, it can pay for Apify usage through [x402](https://docs.apify.com/integrations/x402). This experimental option lets an agent use Apify without a conventional account.

[Apify AGI](https://agi.apify.com/) provides a prepaid API token with a spending cap after payment. Your agent can use that token to run this scraper through the Apify API or an authenticated MCP connection. This Actor uses limited permissions, as required for prepaid-token access.

Some MCP setups also support paying for each request directly. That is a different payment option with separate eligibility rules. This Actor is not a Standby service, so use the prepaid-token flow rather than assuming direct per-request MCP payment is available.

Follow the official guide for wallet setup, supported payment options and current terms. Apify handles the payments. Keep wallet keys and payment tokens in your agent's secure configuration.

#### Other ways for agents to pay

Apify also supports **MPP** for prepaid access through AGI and **Skyfire** for eligible Actors. If your agent already uses one of these, see the [agentic payment guide](https://docs.apify.com/agents/payments) to choose the right setup.

### FAQ

**Does it scrape private or logged-in content?** No. Only public video comments and replies are supported.

**Can it discover videos by keyword?** No. Use the related video search Actor first, then pass selected BVIDs here.

**Why are there zero rows for a video?** An explicitly empty thread may have no available comments. An unavailable video or disabled comments can also prevent collection. Check the run summary rather than treating zero rows as proof that no discussion exists.

**Can I run it through an API or AI assistant?** Yes. Use the API examples or connect through Apify's hosted MCP server above.

**What affects the charge?** Each accepted run has a start charge, with an additional event per saved comment or reply. See Pricing above and start with a bounded sample.

### Related Actors

- [Bilibili Video Search Scraper](https://apify.com/fetch_cat/bilibili-video-search-scraper) — discover Bilibili videos before collecting comments.
- [YouTube Comments Scraper](https://apify.com/fetch_cat/youtube-comments-scraper) — collect discussions from YouTube videos.
- [TikTok Comments Scraper](https://apify.com/fetch_cat/tiktok-comments-scraper) — collect TikTok audience comments.
- [Instagram Comments Scraper](https://apify.com/fetch_cat/instagram-comments-scraper) — collect public Instagram comment threads.
- [YouTube Channel Videos Scraper](https://apify.com/fetch_cat/youtube-channel-videos-scraper) — find channel videos for a separate YouTube research workflow.

### Support and feedback

For custom additions or integrations, email <hello@fetchcat.dev>.

Found an error or have a feature request? [Open an issue](https://apify.com/fetch_cat/bilibili-comments-replies-scraper/issues) with the run URL, a non-sensitive input example and what you expected.

Need help sharing it? See [Apify’s guide to sharing a run when reporting an issue](https://docs.apify.com/account/collaboration/general-resource-access#automatically-sharing-runs-via-actor-issues). Sharing a run can give the developer access to its input, logs and results, so use a run that contains no sensitive data. Please leave out API tokens, passwords, cookies, private documents and personal data. Use a public sample URL or a redacted example instead.

Tried this scraper? We'd love to hear how it worked for you. [Leave a review](https://apify.com/fetch_cat/bilibili-comments-replies-scraper/reviews) to help others choose the right tool and help us improve it. Your feedback means a lot to us.

Made with care for curious people, AI agents and the possibilities in data. ♥

# Changelog

This Actor's version history is a separate document: https://apify.com/fetch_cat/bilibili-comments-replies-scraper/changelog.md

# Actor input Schema

## `bvidsOrUrls` (type: `array`):

One or more public Bilibili video URLs or BVID identifiers.

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

Maximum number of top-level comments to save for each input video.

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

Fetch replies under each top-level comment when available.

## `maxRepliesPerComment` (type: `integer`):

Maximum number of nested replies to save under each top-level comment.

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

Choose Bilibili hot/recommended comments or newest comments first.

## `includePinnedComment` (type: `boolean`):

Also save the uploader's pinned comment (and its replies, when replies are on) as the first top-level row of each video, marked with isPinned. It counts toward the comment limit and is charged like any other row.

## `anonymizeUsers` (type: `boolean`):

Remove public display names, avatar URLs, and member IDs while keeping a stable member hash.

## `requestDelayMillis` (type: `integer`):

Politeness delay between Bilibili API requests.

## `maxRequestRetries` (type: `integer`):

Retry count for transient HTTP/API errors.

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

Optional Apify proxy configuration. Direct HTTP is used by default.

## Actor input object example

```json
{
  "bvidsOrUrls": [
    "BV1xx411c7mD"
  ],
  "maxCommentsPerVideo": 20,
  "includeReplies": true,
  "maxRepliesPerComment": 5,
  "sort": "hot",
  "includePinnedComment": false,
  "anonymizeUsers": false,
  "requestDelayMillis": 500,
  "maxRequestRetries": 3,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (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 = {
    "bvidsOrUrls": [
        "BV1xx411c7mD"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("fetch_cat/bilibili-comments-replies-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 = { "bvidsOrUrls": ["BV1xx411c7mD"] }

# Run the Actor and wait for it to finish
run = client.actor("fetch_cat/bilibili-comments-replies-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 '{
  "bvidsOrUrls": [
    "BV1xx411c7mD"
  ]
}' |
apify call fetch_cat/bilibili-comments-replies-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,fetch_cat/bilibili-comments-replies-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/DSIoYXmmCR6qYsYjr/builds/wAkwrPILS3Jejnz6q/openapi.json
