Bilibili Comments & Replies Scraper

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

Data fields

FieldTypeDescription
sourceUrlstring | nullValue exported as sourceUrl.
bvidstringValue exported as bvid.
aidintegerValue exported as aid.
videoTitlestring | nullValue exported as videoTitle.
videoOwnerNamestring | nullValue exported as videoOwnerName.
commentTypestringValue exported as commentType.
rpidstring | nullValue exported as rpid.
rootRpidstring | nullValue exported as rootRpid.

Input preview

bvidsOrUrlsBilibili video URLs or BVIDs *
maxCommentsPerVideoMax top-level comments per video
includeRepliesInclude nested replies
maxRepliesPerCommentMax replies per top-level comment
sortComment sort order
anonymizeUsersAnonymize public commenter fields

API and agents

This actor can be run through Apify API, datasets, webhooks, schedules, and the official Apify MCP server.

How this actor works

See example inputs, outputs, API usage, and practical limits before running this actor on Apify.

Open Apify page

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.

What does this Actor do?

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

  • Scrapes public top-level Bilibili video comments.
  • Optionally collects bounded nested replies for each comment.
  • Resolves video metadata such as BVID, AID, title, and owner name.
  • Preserves parent-child relationships with rpid, rootRpid, and parentRpid.
  • Supports anonymization of public commenter fields while keeping a stable hash.

Who uses it / use cases

Social listening teams: monitor public audience reactions under campaign or brand videos.

Creator researchers: study comment engagement, frequent topics, and reply chains.

Market researchers: export Chinese video-platform discussion data for qualitative analysis.

AI dataset builders: collect public CJK/emoji-rich conversation text with timestamps and IDs.

Input settings

Field Description
bvidsOrUrls Public Bilibili BVIDs or video URLs to process.
maxCommentsPerVideo Maximum top-level comments to save per video.
includeReplies Whether to fetch nested replies.
maxRepliesPerComment Maximum replies to save per top-level comment.
sort hot or time.
anonymizeUsers Removes member ID, name, and avatar URL while keeping memberHash.
requestDelayMillis Delay between API requests.
maxRequestRetries Retries for transient API/HTTP failures.
proxyConfiguration Optional Apify proxy settings; direct HTTP is the default.

Input example

{
  "bvidsOrUrls": ["BV1xx411c7mD"],
  "maxCommentsPerVideo": 25,
  "includeReplies": true,
  "maxRepliesPerComment": 2,
  "sort": "hot",
  "anonymizeUsers": false,
  "requestDelayMillis": 500,
  "maxRequestRetries": 3,
  "proxyConfiguration": { "useApifyProxy": false }
}

Input recipes

  • Known video comments: set includeReplies to false and maxCommentsPerVideo to 25.
  • Comments with replies: set includeReplies to true and maxRepliesPerComment to 2-5.
  • Anonymized research: set anonymizeUsers to true before sharing datasets.

Output example

{
  "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,
  "scrapedAt": "2026-07-18T08:01:00.000Z"
}

API examples

Node.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,
});
console.log(run.defaultDatasetId);

Python

from apify_client import ApifyClient
client = ApifyClient('YOUR_APIFY_TOKEN')
run = client.actor('fetch_cat/bilibili-comments-replies-scraper').call(run_input={
    'bvidsOrUrls': ['BV1xx411c7mD'],
    'maxCommentsPerVideo': 10,
})
print(run['defaultDatasetId'])

cURL

curl -X POST 'https://api.apify.com/v2/acts/fetch_cat~bilibili-comments-replies-scraper/runs?token=YOUR_APIFY_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"bvidsOrUrls":["BV1xx411c7mD"],"maxCommentsPerVideo":10}'

MCP / AI agents

Use this Actor from Apify MCP tools or agent workflows when an AI system needs public Bilibili comment rows. Keep limits small for interactive analysis, and enable anonymizeUsers when sending data to external LLMs or shared workspaces.

Claude CLI add command:

claude mcp add apify-bilibili-comments -- npx -y @apify/actors-mcp-server --actors fetch_cat/bilibili-comments-replies-scraper

JSON config block:

{
  "mcpServers": {
    "apify-bilibili-comments": {
      "command": "npx",
      "args": ["-y", "@apify/actors-mcp-server", "--actors", "fetch_cat/bilibili-comments-replies-scraper"],
      "env": { "APIFY_TOKEN": "YOUR_APIFY_TOKEN" }
    }
  }
}

Example prompts:

  • "Scrape 20 public comments from BV1xx411c7mD and summarize recurring themes."
  • "Collect Bilibili comments with anonymized users for this video URL."
  • "Get comments and one nested reply per comment, then export the dataset ID."

Responsible use

This actor collects only public Bilibili video comments and replies. Do not use it for private, logged-in, paid, or restricted content. Comments can contain personal or user-generated content; use anonymizeUsers when sharing datasets or building AI/sentiment workflows.

Support

If you need help, open an issue on the Actor page and include:

  • input JSON;
  • expected output;
  • actual output;
  • reproducible public URL (for example a Bilibili video URL) or BVID;
  • Apify run ID.

Common questions

Questions and answers reused from the canonical actor README.

Does it scrape private or logged-in content?

No. It only uses public Bilibili video/comment endpoints.

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?

The video may be unavailable, comments may be disabled, or Bilibili may return no public comments for the requested sort/region.