# Bilibili Video Scraper & Comments (`scraper-fleet/bilibili-video-scraper`) Actor

Bilibili Video Scraper extracts and downloads Bilibili videos, titles, descriptions, metadata, and thumbnails automatically. 高效抓取和下载哔哩哔哩视频、标题、描述、元数据及封面，轻松实现自动化数据采集。

- **URL**: https://apify.com/scraper-fleet/bilibili-video-scraper.md
- **Developed by:** [Scraper Fleet](https://apify.com/scraper-fleet) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.90 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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 is Bilibili Video Scraper? · B站视频数据采集

![What is Bilibili Video Scraper? · B站视频数据采集](https://api.apify.com/v2/key-value-stores/Xhn7wWVmP2eTKrohd/records/readme-46da83060c9e2e4b.svg)
**Bilibili Video Scraper** extracts **video statistics, uploader details, tags, and optional top-level comments** from public Bilibili videos. Paste video URLs or BV ids into the Apify input form, choose whether you need comments, and export a structured dataset for research, reporting, or application development. No Bilibili login or user-supplied cookie is required.

The Actor returns one successful dataset row per video, including its identifiers, title, description, publication time, and available engagement measures. Apify adds cloud storage, API access, schedules, and integration tools so you can use the same collection settings in a recurring workflow. This is a video-data scraper: it does not download MP4 files, audio, subtitles, or raw danmaku messages.

中文说明：本工具采集哔哩哔哩视频的播放量、弹幕数量、互动指标、UP 主信息、标签，以及可选的一级评论。输入完整链接、BV 号或 `b23.tv` 短链接即可；无需提供 B站登录 Cookie。输出是结构化数据，不是视频文件下载。

### Why use Bilibili Video Scraper? · 功能与优势

![Why use Bilibili Video Scraper? · 功能与优势](https://api.apify.com/v2/key-value-stores/Xhn7wWVmP2eTKrohd/records/readme-9ce7b93832fd6bcd.svg)
The Bilibili scraper turns a selected list of video pages into records you can compare and reuse. Its extraction features are separate from the surrounding Apify platform capabilities.

- **Collect several video metrics together.** Retrieve view count, danmaku count, available reply totals, likes, coins, favorites, and shares without manually recording each page.
- **Keep video context.** Titles, descriptions, publication dates, tags, and author details help explain which content each row represents.
- **Add Bilibili comments when needed.** Comment collection is optional and disabled by default, keeping a statistics-only run simpler.
- **Accept practical link formats.** Use full Bilibili video pages, bare BV identifiers, or supported short links; duplicate targets are handled within a run.
- **Use a fallback extraction path.** The Actor tries the public video API and then embedded video-page data when the first path does not return a usable record.
- **Route requests through proxies.** Omitted or empty proxy configuration uses Apify residential proxy routing, and video retries request a fresh proxy URL.
- **Export or integrate the dataset.** Apify supports JSON, CSV, and Excel export, plus API retrieval for your own processing.
- **Automate repeat collections.** Platform schedules and webhooks let you revisit selected videos and send completed-run results to another workflow.

#### What happens after you submit a video link?

The Actor normalizes the supplied targets and processes videos sequentially. Each video can receive up to three extraction attempts. It first tries to retrieve the public video record, then falls back to data embedded in the page. Tags are collected when available; a missing tag response does not necessarily prevent a useful video row.

If comments are enabled and the video has a numeric identifier, the Actor requests top-level comments and attaches them to that video row. Comment-request failures can leave the comment array empty while preserving the video statistics. Failed video targets produce diagnostic rows, allowing you to separate extraction problems from successful video records.

### How to scrape Bilibili videos step by step · 快速开始

![How to scrape Bilibili videos step by step · 快速开始](https://api.apify.com/v2/key-value-stores/Xhn7wWVmP2eTKrohd/records/readme-b26ddabec7ac5e0e.svg)
Begin with one video and comments disabled. Review its fields before increasing the target list or adding extra comment requests.

1. Open [Bilibili Video Scraper](https://apify.com/scraper-fleet/bilibili-video-scraper) and sign in to Apify.
2. Add a public video link to the `urls` field. A bare identifier such as `BV1dj411E7vt` is also supported.
3. Leave `fetchComments` off for your first statistics sample.
4. Keep the default residential proxy configuration. When using the API, omitting this field selects that configuration automatically.
5. Click Start and inspect the run status and dataset.
6. Check the video's ID, title, source URL, and available counts against the source page.
7. Download JSON, CSV, or Excel, or retrieve the dataset through the API.
8. If you need discussion context, enable comments and choose a small `maxCommentsPerVideo` before your next collection.

#### Choose full links, short links, or identifiers

Full links are convenient when you collect URLs from a browser. Bare BV ids are useful when a spreadsheet or database already stores the video identifier. A `b23.tv` short link is resolved to its target before collection. Keep the original target list in your own project so you can identify links that later become unavailable.

The input is a list of specific videos. It does not search by keyword, crawl an uploader's entire channel, or discover all videos under a tag. Prepare your list from an appropriate source, then use this Actor to enrich those selected targets with current video data.

#### Add comments to a selected sample

Set `fetchComments` to true and use `maxCommentsPerVideo` to bound the requested sample. Comments are retrieved hottest first. The default is 20, which is useful for reviewing prominent discussion without requesting many pages for every video.

中文提示：评论开关默认关闭，开启后会增加网络请求。采集的是视频下方的一级评论，不包括楼中楼回复，也不包括播放器中滚动显示的弹幕内容。弹幕字段只提供数量。

### Bilibili Video Scraper input parameters · 输入参数

![Bilibili Video Scraper input parameters · 输入参数](https://api.apify.com/v2/key-value-stores/Xhn7wWVmP2eTKrohd/records/readme-dc69ed240464b4d7.svg)
The [input form](https://console.apify.com/actors/jmxwswkiHx6tJIIsB/input) contains the current schema and field descriptions. Although the schema declares no universally required fields, you need a nonempty target list to collect video records.

| Parameter | Description | Required | Example |
| --- | --- | --- | --- |
| `urls` | List of full video URLs, BV ids, or supported b23.tv short links | Needed for collection | `BV1dj411E7vt` |
| `fetchComments` | Attach top-level comments; default false | No | `true` |
| `maxCommentsPerVideo` | Requested comment cap; default 20, schema range 1–500 | No; used when comments are enabled | `20` |
| `proxyConfiguration` | Proxy routing; omitted or empty selects residential Apify Proxy | No; keep default for platform use | `RESIDENTIAL` group |

Illustrative input for one video with comments:

```json
{
  "urls": ["https://www.bilibili.com/video/BV1dj411E7vt/"],
  "fetchComments": true,
  "maxCommentsPerVideo": 20,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  }
}
```

#### Comment limits and fallback behavior

![Comment limits and fallback behavior](https://api.apify.com/v2/key-value-stores/Xhn7wWVmP2eTKrohd/records/readme-b531f7d24a2d7963.svg)
The input allows a value up to 500, but the implemented primary comment path reads at most ten pages, typically about 20 comments each. That makes approximately 200 comments the practical ceiling for this path, subject to what Bilibili returns. A value of 500 does not cause the Actor to fetch 25 pages.

If the primary comment endpoint is unavailable, an older fallback can return three hottest comments. Consequently, a successful video row may contain fewer comments than requested or an empty array. Treat the setting as a requested maximum rather than a completeness guarantee.

#### Proxy settings and retry expectations

Residential routing is the default for every Bilibili request. Turning proxies off can cause cloud requests to be blocked, and a fresh proxy URL on retry does not guarantee access to a restricted or removed video. Keep the default settings for a first test and inspect diagnostic statuses before changing advanced options.

The input has no concurrency, date-filter, or output-format setting. Videos are processed sequentially, and export formatting is selected from the resulting Apify dataset. Avoid adding undocumented input keys in an attempt to increase speed or change which videos are discovered.

### Bilibili Video Scraper output example · 数据输出

![Bilibili Video Scraper output example · 数据输出](https://api.apify.com/v2/key-value-stores/Xhn7wWVmP2eTKrohd/records/readme-a5568f6785b68329.svg)

![Bilibili Video Scraper output example · 数据输出](https://api.apify.com/v2/key-value-stores/Xhn7wWVmP2eTKrohd/records/readme-f5a657ada80379e7.svg)

![Bilibili Video Scraper output example · 数据输出](https://api.apify.com/v2/key-value-stores/Xhn7wWVmP2eTKrohd/records/readme-3b974ef0c1d2d3e3.svg)
The following example illustrates a successful row for the same BV identifier used in the input. Titles, identities, counts, dates, and comments are fictionalized to demonstrate field types; they are not reported measurements for that real video.

```json
{
  "id": "BV1dj411E7vt",
  "aid": 123456789,
  "title": "Illustrative product demonstration · 示例视频",
  "url": "https://www.bilibili.com/video/BV1dj411E7vt/",
  "view_count": 125000,
  "dm_count": 430,
  "reply_count": 210,
  "pubdate": "2026-11-01T08:00:00Z",
  "copyright": "Original",
  "like_count": "1.2万",
  "coin_count": "3400",
  "favorite_count": "2100",
  "share_count": "560",
  "note_count": "",
  "description": "Fictional description used to explain the dataset structure.",
  "topic_tag": "演示",
  "tags": ["演示", "产品"],
  "author": "示例UP主",
  "author_url": "https://space.bilibili.com/123456/",
  "avatar": "https://example.com/uploader-avatar.jpg",
  "cover": "https://example.com/uploader-avatar-96px.jpg",
  "comments": [
    {
      "author": "示例观众",
      "text": "这是一条用于展示格式的示例评论。",
      "like_count": 12,
      "timestamp": "2026-11-02T09:00:00Z"
    }
  ],
  "scrapedAt": "2026-11-08T00:00:00Z"
}
```

#### Video identifiers, dates, and author fields

`id` is the BV identifier and `aid` is the numeric AV id associated with the video. Preserve both when joining this dataset with another video-data source. `url` links to the video page; it is not a downloadable media URL.

`pubdate` is the video's publication timestamp in UTC when available, while `scrapedAt` is the collection time. They answer different questions: when was the video published, and when were these statistics observed? Use the collection timestamp to distinguish repeated snapshots of the same video.

`author`, `author_url`, and `avatar` describe the uploader. The `cover` field is retained for compatibility and contains a 96-pixel uploader-avatar thumbnail, not the video's cover artwork. If your report needs actual video cover images, do not use this field as a substitute.

#### Numeric counts and formatted engagement strings

`view_count`, `dm_count`, and `reply_count` are numeric values when supplied by the source. Danmaku refers to on-screen bullet comments; `dm_count` is their total count, not a transcript. `reply_count` describes available discussion volume and can be larger than the collected comment sample.

Video-level `like_count`, `coin_count`, `favorite_count`, and `share_count` are strings. Large values can use Bilibili-style formatting such as `1.2万`, and unavailable values can be empty strings. Comment-level `like_count` is numeric, so do not apply one type rule to both the video and its nested comments.

Keep the raw string when converting values for a chart. A displayed `1.2万` corresponds to approximately 12,000, but the formatted source loses precision. Mark converted values as approximate and keep missing strings separate from observed zero values.

#### Tags, labels, and optional data

`tags` is an array of available tag names. `topic_tag` uses the first available tag; it is not an independently inferred topic category. The `copyright` label can be Original, Reproduced/Reposted, or null, reflecting the source classification rather than a license for reuse.

`note_count` is often an empty string because note information is not consistently available through the extraction path. Empty tags or comments can reflect source availability or enrichment failure. Preserve these distinctions when designing a dashboard instead of treating every empty field as proof that the video has no associated activity.

#### Diagnostic output for failed targets

An unsuccessful target can return `status` and `error_message`, with id and title set to null. Recognized statuses include `invalid_url`, `no_results`, `blocked`, `fetch_failed`, and `parse_failed`. Filter diagnostic rows separately from successful video rows when calculating statistics or counting collected videos.

For CSV or Excel export, select the scalar fields needed for your report. Use JSON to retain tags and comment arrays. If you want one row per comment, expand the array in your own workflow and carry the parent video ID, URL, and collection time onto each row.

### Bilibili Video Scraper use cases · 应用场景

![Bilibili Video Scraper use cases · 应用场景](https://api.apify.com/v2/key-value-stores/Xhn7wWVmP2eTKrohd/records/readme-8a2b963d89340d0f.svg)

#### Video performance reports

Content teams can collect a selected campaign's video metrics into a spreadsheet for review. Publication time, uploader, title, and available counts provide context for comparing content. Keep each metric separate: views, likes, coins, favorites, and shares describe different audience actions.

For recurring reports, schedule the same video list and store successive snapshots. Calculate changes using matching BV identifiers and collection timestamps. The Actor retrieves current accessible data; it does not reconstruct statistics for dates before you began collecting.

#### Creator and topic research

Researchers can enrich a curated set of Bilibili videos with uploader details, tags, descriptions, and public metrics. Author profile links help organize videos by creator, while tags and titles help review topic coverage. The initial list still needs to be selected outside this Actor.

A tag is a source label rather than a guarantee that two videos cover the same subject. Combine it with titles, descriptions, and manual review when preparing a comparison. Avoid using the first tag alone as a complete classification of a creator's content.

#### Audience feedback and comment review

Optional top-level comments provide examples of prominent audience reactions. Product teams can review recurring questions, praise, or confusion around selected demonstrations. Store the source video link with any quoted comment so reviewers can examine the surrounding context.

The hottest-first sample has a selection bias toward prominent comments, and fallback behavior can reduce it further. It is useful for qualitative review, but it does not represent every viewer or the full conversation. Nested replies and raw bullet comments need a different collection capability.

#### Data pipelines and research datasets

Developers can join video IDs to internal campaign tables, store snapshots in a database, and send selected metrics to dashboards. Use JSON for the original records and a normalized table for analysis. A separate comment table is useful when analysts need to filter comments without duplicating video-level totals.

For a multilingual project, preserve Chinese titles, descriptions, tags, and comment text in their original encoding. Translate in a separate downstream column if needed so the collected text remains available for verification. 中文分析工作流应保留原始文本和采集时间，避免把格式化互动数字误当成精确原始值。

### How much does scraping Bilibili cost? · 价格

![How much does scraping Bilibili cost? · 价格](https://api.apify.com/v2/key-value-stores/Xhn7wWVmP2eTKrohd/records/readme-d1469374e67e8e9f.svg)
The Actor uses pay-per-event pricing, with platform resource usage charged separately. These USD result-event rates were checked on November 8, 2026:

| Plan tier | Successful result event | 1,000 result events |
| --- | --- | --- |
| Free | $0.00250 | $2.50 |
| Bronze | $0.00225 | $2.25 |
| Silver | $0.00200 | $2.00 |
| Gold, Platinum, Diamond | $0.00160 | $1.60 |

The Actor start event costs $0.00005 per GB of allocated memory, with a minimum of one event. At an illustrative 1 GB allocation, ten successful videos on the Free tier cost $0.025 plus $0.00005 to start: $0.02505 in Actor event charges. Compute, residential proxy traffic, storage, and other platform usage are additional.

Comments are attached to the video row, so they do not create a separate result event for every comment. Enabling them can still increase requests, runtime, and platform costs. Diagnostic failure rows are saved without a result charge, while start and infrastructure usage can still apply to the run.

#### Is this Bilibili scraper free to try?

Apify's [Free plan](https://apify.com/pricing) includes $5 in monthly usage credit and does not require a credit card to sign up. This Actor has paid result events, and accounts without a paid plan are capped at 20 successful video results per run. That cap is separate from the number of comments nested inside each video.

Use a small sample to review the actual usage breakdown, then consult the [Pricing tab](https://apify.com/scraper-fleet/bilibili-video-scraper/pricing) before increasing the job. The 1,000-result table explains unit pricing; it does not remove the unpaid-account run cap or include platform charges.

### Bilibili Video Scraper API and automation · API 与自动化

![Bilibili Video Scraper API and automation · API 与自动化](https://api.apify.com/v2/key-value-stores/Xhn7wWVmP2eTKrohd/records/readme-455952b690f91627.svg)
The Actor provides an Apify API interface for the same video-list workflow used in Console. See the [API tab](https://apify.com/scraper-fleet/bilibili-video-scraper/api) and the [Apify Python client](https://docs.apify.com/api/client/python/docs/quick-start):

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("scraper-fleet/bilibili-video-scraper").call(
    run_input={
        "urls": ["https://www.bilibili.com/video/BV1dj411E7vt/"],
        "fetchComments": True,
        "maxCommentsPerVideo": 20,
    }
)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item.get("id"), item.get("view_count"), item.get("status"))
```

Running this code starts a charged Actor run. Read the token from a protected environment, and check each row's status before treating it as a successful video record. This is an Apify collection interface, not an official Bilibili API product or an authenticated Bilibili account connection.

#### Schedules, webhooks, and integrations

Use Apify schedules to collect a stable video list at chosen intervals. Store the run date and dataset reference with your snapshots, then compare matching identifiers in your own analysis. Avoid repeatedly scraping videos that no longer matter to your report; update the target list as your project changes.

A successful-run webhook can trigger a workflow in Make, Zapier, n8n, or another application. Retrieve the dataset, separate failed rows, normalize selected fields, and write the result to Google Sheets or a database. These are platform integrations you configure; the scraper does not automatically create a dashboard or maintain a historical database.

#### Copy to your AI assistant · 复制给 AI 助手

```text
Help me use scraper-fleet/bilibili-video-scraper. Read https://apify.com/scraper-fleet/bilibili-video-scraper and its input instructions. I want video statistics and a small sample of top-level comments for selected BV ids. Prepare the input, explain formatted count strings and comment-page limits, and show how to export the dataset. Do not describe the output as MP4 downloads or raw danmaku messages. Ask before starting a charged run. Keep API tokens private. 可以用中文解释，JSON 字段保持英文。
```

An assistant can retrieve pages or execute tools only when its environment supplies those capabilities. Copying this prompt gives it the task context; connecting a tool is a separate step.

#### Bilibili Video Scraper MCP server · MCP 连接

Connect an MCP-capable client to Apify with this Actor selected:

```text
https://mcp.apify.com?tools=scraper-fleet/bilibili-video-scraper
```

Complete the client's supported Apify authorization flow and follow the [current MCP setup instructions](https://docs.apify.com/platform/integrations/mcp). A compatible assistant can use the exposed Actor input schema. Executing the tool starts a normal charged run and retains the same video-list and comment limits.

### More scrapers by Scraper Fleet · 更多工具

| Actor | Complementary task |
| --- | --- |
| [Zhihu Scraper](https://apify.com/scraper-fleet/zhihu-scraper) | Collect supported Zhihu discussions, articles, profiles, and trends with your own cookie |
| [Facebook Group Scraper](https://apify.com/scraper-fleet/facebook-group-scraper) | Collect accessible group posts, comments, group details, and exposed admin profiles |
| [TikTok Video Downloader](https://apify.com/scraper-fleet/tiktok-video-downloader) | Download authorized TikTok videos as MP4 files with metadata and file links |

### Bilibili Video Scraper FAQ · 常见问题

#### Do I need a Bilibili account or cookie?

No. The Actor uses public video requests and page data without a user-supplied Bilibili login. Keep the residential proxy configuration; no login requirement does not mean every video is available in every region or accessible after deletion.

#### Does it download Bilibili video files?

No. The output contains video metadata, statistics, author information, and optional comments. Source page URLs and uploader images are not MP4 or audio download links. Choose a separate media-download workflow if files are required.

#### Can I extract danmaku text or comment replies?

The Actor returns the danmaku count and optional top-level comment text. It does not collect individual danmaku messages or nested comment replies. The number of available replies can exceed the number of comments collected.

#### Why are tags or comments empty?

Tags and comments depend on source responses and optional enrichment. Comments are also empty when their input switch is off. A successful statistics row can survive an unsuccessful comment request; inspect the run log and settings before interpreting an empty array as absence of discussion.

#### Why did a video return a blocked or failed row?

Bilibili can restrict requests or remove content, and connection or parsing failures can prevent extraction. Confirm the URL, keep residential routing, and inspect the diagnostic status. A retry cannot restore a deleted video or guarantee access to restricted content.

#### Can I track historical performance?

You can build a history by scheduling repeated collections and saving each snapshot. The Actor retrieves current accessible statistics and does not provide past measurements from before those collections began. Match BV identifiers and timestamps when calculating changes.

#### What happens when the site changes?

A change to video responses or page structure can affect fields or parsing. Report the source URL, relevant settings, and a redacted error through this Actor's Issues tab so our team can investigate. This page does not promise a fixed maintenance frequency or repair deadline.

### Is scraping Bilibili legal? · 数据使用与版权

Legality and reuse rights depend on jurisdiction, purpose, data, access method, and applicable terms. Bilibili Video Scraper collects public video data without a supplied user login; public availability does not automatically authorize collection or commercial redistribution.

Review the terms and policies available through [Bilibili](https://www.bilibili.com/), and assess any privacy obligations for uploader names and comment text, including GDPR or CCPA where applicable. The source copyright label is a classification, not permission to reuse a video, image, or comment. Limit collection to your legitimate purpose, protect stored personal data, and assess rights before publishing or commercially reusing results.

### Need help with Bilibili Video Scraper? · 联系我们

[Contact our team through the Actor's Issues tab](https://apify.com/scraper-fleet/bilibili-video-scraper/issues) for bugs, feature requests, or custom workflows. Include a video URL, whether comments were enabled, the requested comment limit, expected fields, and a redacted diagnostic message or run reference. Keep API tokens out of public issues.

For a custom version, describe the target list size, required fields, collection frequency, and destination. Tell us whether you need a statistics report, comment processing, or an application integration so we can discuss the requirements directly. 中文用户可以通过 Issues 联系我们的团队，提供链接、设置和问题现象即可。

# Actor input Schema

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

📌 One link per line · 每行一个链接，例如 <code>https://www.bilibili.com/video/BV1dj411E7vt/</code><br>✅ Also works · 同样支持：BV号 <code>BV1dj411E7vt</code> · <code>b23.tv</code> 短链接<br>♻️ Duplicates are scraped once · 重复链接只采集一次<br>⚠️ Other links return a row with status <code>invalid_url</code> · 非B站链接会返回 <code>invalid_url</code> 状态行

## `fetchComments` (type: `boolean`):

🔥 Top-level comments of each video, hottest first · 每个视频的一级热门评论（按热度排序）<br>ℹ️ Replies to comments are not included · 不含楼中楼回复<br>⏱️ Adds extra requests per video · 每个视频会增加额外请求

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

📏 Used only when <b>Collect comments</b> is on · 仅在开启「采集评论」时生效<br>📄 Up to 10 pages (about 20 comments each) are read per video, so about 200 at most · 每个视频最多读取 10 页（每页约 20 条），最多约 200 条<br>🎯 Default · 默认：20

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

🌐 Used for every Bilibili request · 所有B站请求都会使用<br>🏠 Empty (e.g. via API) = Apify residential proxy · 留空（如通过API）= Apify 住宅代理<br>🔁 A new proxy URL is requested on each retry · 每次重试自动换新代理<br>🚫 Turning the proxy off usually gets blocked · 关闭代理通常会被B站拦截

## Actor input object example

```json
{
  "urls": [
    "https://www.bilibili.com/video/BV1dj411E7vt/"
  ],
  "fetchComments": false,
  "maxCommentsPerVideo": 20,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

All dataset rows: scraped videos and diagnostic failure rows.

# 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 = {
    "urls": [
        "https://www.bilibili.com/video/BV1dj411E7vt/"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("scraper-fleet/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 = {
    "urls": ["https://www.bilibili.com/video/BV1dj411E7vt/"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("scraper-fleet/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 '{
  "urls": [
    "https://www.bilibili.com/video/BV1dj411E7vt/"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call scraper-fleet/bilibili-video-scraper --silent --output-dataset

```

## MCP server setup

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