# Bilibili Scraper - Videos, Comments, Danmaku & Creators (`webdata_labs/bilibili-scraper`) Actor

\[$2.00 / 1K videos] Scrape Bilibili without login: keyword search, full video stats, top comments, raw danmaku with timestamps, creator search by niche and full upload lists. No start fee.

- **URL**: https://apify.com/webdata\_labs/bilibili-scraper.md
- **Developed by:** [WebData Labs](https://apify.com/webdata_labs) (community)
- **Categories:** Social media, Videos, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

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

## Bilibili Scraper - Videos, Comments, Danmaku & Creators

**Search Bilibili (哔哩哔哩, B站) by keyword, creator or trending board and get full video stats, top comments and raw danmaku as clean rows, with no login and at $2.00 per 1,000 videos.**

Bilibili is where China's under-35 audience watches, reviews and argues about games, anime, phones, cars and brands, and it carries a signal no Western platform has: danmaku, the comments viewers fire across the screen at a specific second of the video. The data is public, but getting it out means signing every request the way Bilibili's web client does, dodging per-IP bans, and knowing which endpoints quietly hand an anonymous visitor three comments instead of three hundred. This Actor does that and gives you videos, comments, danmaku and creators as sortable rows, priced per row at a fraction of what the Store usually charges for Bilibili.

### ✅ What you get / ❌ what this isn't

| ✅ What you get | ❌ What this isn't |
|---|---|
| Views, likes, coins, favourites, shares, comments and danmaku count on every video, plus an engagement rate | Not a title-and-link list |
| Every danmaku as its own row, with the second of the video it was sent at | Not a single summary row sold at $0.05 per video |
| A danmaku reaction profile on the video row: pool size, unique senders, peak minute | Not raw XML you have to parse yourself |
| Top comments ranked the way Bilibili ranks them, 20 per page, paged as deep as you ask | Not the 3 comments an anonymous visitor usually gets |
| Find creators (UP主) in a niche by keyword, sorted by followers | Not ID-only creator lookup |
| A creator's full upload list, newest first, paged to the end | Not "their videos that happen to show up in search" |
| Keyword search with sort, length and date filters that are checked to work | Not filters that are silently dropped |
| $2.00 per 1,000 videos, $0.50 per 1,000 comments, $0.10 per 1,000 danmaku, no start fee | Not $20 per 1,000 rows |

### 🔎 Why use this Actor

- **Priced per row type.** Videos, comments, danmaku and creators each have their own price, set by what they cost to collect. A danmaku costs a tenth of a comment because one request returns hundreds of them, so a 200-danmaku sample of a video costs $0.02.
- **Danmaku as data, not a teaser.** Each danmaku row carries its text, `videoSecond` and `m:ss` timestamp, the time it was sent, a stable hashed sender id and its display mode. The video row adds `danmakuPeakMinute`, which tells you the minute of a review or ad the audience reacted to most. Set `maxDanmakuPerVideo` to `0` to get only that profile.
- **Comments that go deep.** Bilibili gives anonymous visitors a crippled comment feed of about three comments. This Actor requests the ranked feed the way that returns 20 per page and pages on until `maxCommentsPerVideo`, and flags pinned comments and comments written by the uploader.
- **Creator discovery.** `creatorSearchQueries` finds creators by niche keyword (`美妆`, `数码`, `汽车`) sorted by followers, with follower count, video count, level and verification, so you can build a KOL shortlist without knowing a single UID first.
- **Complete upload lists.** `creatorIds` returns a creator's profile and then pages through their uploads to the end, newest first, instead of guessing from search results.
- **Filters verified against real results.** All five sort orders, all four length buckets and the date window were each run and checked before release. A one-sided date window, which Bilibili ignores without saying so, is sent as a two-sided window so it actually applies.
- **Survives Bilibili's IP bans.** Bilibili bans an IP for a while once it has seen enough requests. The Actor spots the ban (HTTP 412 or risk-control codes) and moves to a fresh exit IP instead of returning an empty run.

### 👥 Who it's for

Brand and market researchers watching Chinese consumer reaction, influencer and KOL agencies, game and anime publishers tracking a launch, and data teams building Chinese-language datasets.

- Pull every review video of a product launch and rank them by engagement rate.
- See which minute of a competitor's ad or review the audience reacted to, from the danmaku timeline.
- Build a shortlist of beauty or tech creators by follower count, then pull their full upload history.
- Collect top comments on a game trailer to read what players actually objected to.
- Track the daily top-100 ranking and the live popular board on a schedule.

### Example tasks

Ready-made runs you can open and start without configuring anything:

- [Scrape Bilibili videos by keyword](https://apify.com/webdata_labs/bilibili-scraper/examples/bilibili-video-search-scraper)
- [Scrape Bilibili comments on product reviews](https://apify.com/webdata_labs/bilibili-scraper/examples/bilibili-comments-scraper)
- [Scrape Bilibili danmaku with video timestamps](https://apify.com/webdata_labs/bilibili-scraper/examples/bilibili-danmaku-scraper)
- [Find Bilibili beauty creators (KOLs) by followers](https://apify.com/webdata_labs/bilibili-scraper/examples/bilibili-beauty-kol-finder)
- [Find Bilibili gaming creators by followers](https://apify.com/webdata_labs/bilibili-scraper/examples/bilibili-gaming-creators-list)
- [Scrape all videos from a Bilibili creator](https://apify.com/webdata_labs/bilibili-scraper/examples/bilibili-creator-videos-scraper)
- [Bilibili top 100 ranking (排行榜) today](https://apify.com/webdata_labs/bilibili-scraper/examples/bilibili-ranking-top-100)
- [Bilibili popular videos with danmaku reaction profile](https://apify.com/webdata_labs/bilibili-scraper/examples/bilibili-popular-videos-danmaku-profile)
- [Chinese gamer reaction to a game launch on Bilibili](https://apify.com/webdata_labs/bilibili-scraper/examples/bilibili-game-launch-reaction)
- [Monitor new Bilibili videos about a brand](https://apify.com/webdata_labs/bilibili-scraper/examples/bilibili-brand-mention-monitor)

### ⚙️ How to scrape Bilibili

1. Add one or more keywords to **Search keywords**. Chinese keywords return far more results than English ones (`原神` rather than `Genshin`).
2. Or paste **Video links**, **Creators (UID or space link)**, keywords to **Find creators by keyword**, or pick a **Trending board**. You can mix all of them in one run.
3. Set **Maximum videos per keyword, creator or board**. The default of 20 is a quick look; Bilibili serves up to about 1,000 per keyword.
4. Switch on **Include comments** and **Include danmaku** if you want them, and cap them per video.
5. Click **Start**. Rows stream in as each video finishes. Open the **Output** tab for the Videos, Comments, Danmaku and Creators tables, or export JSON, CSV or Excel from **Storage**.

#### Track a keyword or a board every day

Save your input as a task, set **Sort videos by** to **Newest** (or pick the **Top 100 ranking** board), and add a schedule. Each run returns the current state with fresh view, like and coin counts, so a daily export becomes a time series of how a launch or a creator is performing.

### 📥 Input

```json
{
  "searchQueries": ["iPhone 17"],
  "maxVideosPerSource": 20,
  "sortBy": "totalrank",
  "fetchVideoDetails": true,
  "includeComments": true,
  "maxCommentsPerVideo": 40,
  "includeDanmaku": true,
  "maxDanmakuPerVideo": 200
}
```

- `searchQueries` - keywords to search videos for. Each keyword is searched separately.
- `videoUrls` - video links, BV ids, av ids or b23.tv short links.
- `creatorIds` - creator UIDs or `space.bilibili.com` links. Returns the profile plus uploads, newest first.
- `creatorSearchQueries` - keywords to find creators for, one row per creator.
- `trending` - `none` (default), `popular` (the live 综合热门 feed) or `ranking` (the top-100 排行榜).
- `maxVideosPerSource` - videos per keyword, creator or board. Default `20`, up to `1000`.
- `maxCreatorsPerQuery` - creators per creator-search keyword. Default `20`.
- `creatorSortBy` - `fans` (default, most followers first), `relevance` or `level`.
- `sortBy` - keyword search order: `totalrank` (relevance, default), `click` (most viewed), `pubdate` (newest), `dm` (most danmaku), `stow` (most favourited).
- `durationFilter` - `0` any (default), `1` under 10 min, `2` 10-30 min, `3` 30-60 min, `4` over 60 min.
- `publishedAfter` / `publishedBefore` - date window for keyword search, `YYYY-MM-DD`, China time. Either side alone works.
- `fetchVideoDetails` - default `true`. Adds likes, coins, shares, originality, parts and engagement rate at one extra request per video. Turn off for a faster search-fields-only pull.
- `includeComments` / `maxCommentsPerVideo` - off by default; default cap 20 per video.
- `includeDanmaku` / `maxDanmakuPerVideo` - off by default; default cap 200 per video, sampled evenly across the timeline. `0` keeps only the reaction profile.

### 📤 Output

| title | views | likes | coins | engagementRate | danmakuPeakMinute | creatorName |
|---|---|---|---|---|---|---|
| 「小白」iPhone17全面测评：你想看的都在这了！ | 2,086,439 | 53,014 | 26,958 | 0.0479 | - | 小白测评 |
| 《原神》角色预告-「沃雅妮莎：此夜共沦」 | 2,099,652 | 259,693 | 101,311 | 0.2077 | 0 | 原神 |
| 和魔术师刘谦一起拉片魔术电影 | 7,346,132 | 320,422 | 128,642 | 0.0750 | 10 | 影视飓风 |

Every row has a `type`: `video`, `comment`, `danmaku` or `creator`, and the Output tab has a table for each. Video rows also carry `bvid`, `aid`, `url`, `description`, `coverUrl`, `durationSeconds`, `publishedAt`, `category`, `tags`, `favorites`, `shares`, `comments`, `danmakuCount`, `isOriginal`, `parts`, `creatorId` and `creatorUrl`, plus `searchQuery`, `source` and `position` so you know which input produced them. Comment rows carry the text, `likes`, `replyCount`, `postedAt`, the author's name, UID and level, and `isPinned` / `isByUploader`. Danmaku rows carry the text, `videoSecond`, `videoTimestamp`, `sentAt`, `senderHash`, `displayMode` and `color`. Creator rows carry `followers`, `following`, `videoCount`, `totalLikes`, `level`, `isVerified`, `verificationTitle`, `bio` and `avatarUrl`. A run summary with counts and anything that could not be fetched is saved as `OUTPUT` in the key-value store.

#### All output fields

| Field | Row types | What it is |
|---|---|---|
| `type` | all | video, comment, danmaku or creator |
| `source` | video, creator | search, video-url, creator-uploads, popular, ranking, creator-id or creator-search |
| `searchQuery` | video, creator | Keyword that produced the row |
| `position` | video, creator | Rank within its keyword, creator or board |
| `bvid` | video, comment, danmaku | Video id (BV...) |
| `aid` | video | Numeric video id |
| `url` | video, creator | Page URL |
| `title` | video | Title |
| `description` | video | Description |
| `coverUrl` | video | Cover image |
| `durationSeconds` | video | Length in seconds |
| `publishedAt` | video | Publish time, ISO 8601 UTC |
| `category` | video | Bilibili zone |
| `tags` | video | Tags (keyword search rows) |
| `views`, `likes`, `coins`, `favorites`, `shares` | video | Engagement counts |
| `comments`, `danmakuCount` | video | Comment and danmaku totals on the video |
| `engagementRate` | video | (likes + coins + favourites + shares) / views |
| `isOriginal` | video | Original upload vs repost |
| `parts` | video | Number of parts |
| `creatorId`, `creatorName`, `creatorUrl` | video | Uploader |
| `danmakuFetched`, `danmakuUniqueSenders` | video | Danmaku pool size and distinct senders (danmaku on) |
| `danmakuPeakMinute`, `danmakuPeakMinuteCount` | video | Busiest minute and its danmaku count (danmaku on) |
| `detailsFetched` | video | Whether full stats were fetched |
| `videoTitle`, `videoUrl` | comment, danmaku | The video the row belongs to |
| `commentId` | comment | Comment id |
| `text` | comment, danmaku | Comment or danmaku text |
| `likes`, `replyCount` | comment | Comment likes and replies |
| `postedAt` | comment | Comment time |
| `authorId`, `authorName`, `authorLevel` | comment | Commenter UID, name and level (0-6) |
| `isPinned`, `isByUploader` | comment | Pinned by, or written by, the uploader |
| `danmakuId` | danmaku | Danmaku id |
| `videoSecond`, `videoTimestamp` | danmaku | Moment of the video it was sent at |
| `sentAt` | danmaku | When it was sent |
| `senderHash` | danmaku | Stable hashed sender id |
| `displayMode`, `color` | danmaku | scroll, top, bottom and so on; hex colour |
| `creatorId`, `name`, `url`, `avatarUrl`, `bio` | creator | Identity |
| `followers`, `following`, `videoCount`, `totalLikes` | creator | Audience and output |
| `level`, `gender` | creator | Account level and gender as shown |
| `isVerified`, `verificationTitle` | creator | Bilibili verification |
| `isLive`, `liveRoomId` | creator | Live status (creator search rows) |
| `scrapedAt` | all | Collection time |

### 💵 How much does it cost?

You pay per row, by type, with **no start fee**, so a keyword that finds nothing costs nothing:

| Row | Charge event | Price per 1,000 (Free plan) |
|---|---|---|
| Video | `video-scraped` | $2.00 |
| Comment | `comment-scraped` | $0.50 |
| Danmaku | `danmaku-scraped` | $0.10 |
| Creator | `creator-scraped` | $2.00 |

Higher Apify plans get up to 20% off. A default run (20 videos for one keyword) costs **$0.04** and finished in 13 seconds in testing. A heavy measured run - 100 videos each from a keyword, a creator's uploads and the top-100 ranking, with up to 40 comments and 200 danmaku per video - returned 296 videos, 11,108 comments, 48,965 danmaku and 21 creators in 22 minutes, which bills about **$11**. Comments and danmaku are off by default and each has its own per-video cap, so the bill only grows when you ask for it to.

### 🔁 Run it on the Apify platform

Save any input as a task and schedule it daily or weekly to watch a keyword, a creator or the ranking board. Call it from the Apify API or client libraries, export results as JSON, CSV, Excel or XML, and push them onward with webhooks or the Make, Zapier and n8n integrations, into a sheet, a warehouse or a Slack alert when a creator posts.

#### Use with AI agents via MCP

Add Apify's MCP server to Claude Code, Claude Desktop or Cursor, then ask the agent to run `webdata_labs/bilibili-scraper` with a keyword, a creator or a video link and to analyze the dataset. A research agent can chain it: search a product name in Chinese, pull the top comments and danmaku on the most-viewed reviews, then summarize what viewers praised or complained about at which minute. Keep your Apify token in the client's secret or environment settings rather than in a prompt.

#### Use this Actor in n8n

Use an HTTP Request node against the Actor's run endpoint (or `run-sync-get-dataset-items` for small runs), then map the dataset items into your workflow. Store the Apify token in n8n credentials, never inside the workflow JSON. A typical flow: a daily schedule trigger, a run over your brand keywords sorted by newest, a filter on `views` above a threshold, and a Slack or email message for each new video.

### ⚠️ Limits and caveats

- **About 1,000 results per keyword.** Bilibili serves at most 50 pages of 20 for one search. To go further, split the period with `publishedAfter` / `publishedBefore` windows or run related keywords.
- **Comments are the top-ranked feed, not every comment.** Anonymous access returns Bilibili's ranked comments at 20 per page. Replies under a comment are counted in `replyCount` but not returned as rows, and newest-first comment order is not offered because Bilibili gives anonymous callers only a handful that way.
- **No commenter IP location.** Bilibili shows a commenter's province only to logged-in users, so this Actor does not return it.
- **Danmaku is the pool Bilibili keeps.** A long, busy video may have sent more danmaku than Bilibili still serves; `danmakuFetched` is what the pool holds, `danmakuCount` is Bilibili's own lifetime count. On multi-part uploads the danmaku comes from the first part.
- **Collaborations appear in a creator's upload list.** Videos the creator co-uploaded with another account are included, with the lead uploader as `creatorName`.
- **Upload-list rows are lighter unless details are on.** A creator's upload list carries only title, views, duration and date; with `fetchVideoDetails` on (the default) each one is opened for full stats.
- **Search rows without details lack coins and shares.** With `fetchVideoDetails` off you get the search fields only: views, danmaku count, favourites, comments and tags.
- **Region-locked, deleted or members-only videos** return an entry in the run summary instead of a row.

### 🧩 Related Actors

- **[Weibo Scraper](https://apify.com/webdata_labs/weibo-scraper)** - the same brand or topic on China's microblog, to compare reaction across platforms.
- **[RedNote (Xiaohongshu) & Douyin Scraper](https://apify.com/webdata_labs/rednote-xiaohongshu-douyin-scraper)** - lifestyle and beauty trends on RedNote and Douyin, next to Bilibili's gaming and tech audience.
- **[1688 Product Scraper](https://apify.com/webdata_labs/1688-scraper)** - price the product a Bilibili review is about at its Chinese wholesale source.
- **[TikTok Shop Scraper](https://apify.com/webdata_labs/tiktok-shop-scraper)** - see whether the product Chinese viewers are reviewing is already selling on TikTok Shop.
- **[WeChat Official Account Scraper](https://apify.com/webdata_labs/wechat-official-account-scraper)** - long-form articles from brands and media on the same topic.
- **[TikTok Comments Scraper](https://apify.com/webdata_labs/tiktok-comments-scraper)** - the international short-video side of the same launch.

### ❓ FAQ

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

No. Everything here is public and fetched without login. Proxy rotation and Bilibili's request signing are handled automatically and included in the price.

#### Am I charged when a keyword finds nothing?

No. There is no start fee and you are charged only per row delivered. Items that could not be fetched are listed in the run summary and never billed.

#### Why do my English keywords return so few videos?

Bilibili indexes Chinese text. Search `耐克` as well as `Nike`, `原神` as well as `Genshin`, and put both in `searchQueries`.

#### How do I get more than 1,000 videos for one keyword?

Run the keyword with several date windows (`publishedAfter` / `publishedBefore`), for example one per month. Each window has its own ~1,000 cap.

#### What is `senderHash` on danmaku?

Bilibili's own hashed sender id. The same viewer keeps the same hash, so you can count unique senders or spot one account flooding a video, but it does not reveal who they are.

#### Can I track a creator's followers over time?

Save a task with the creator in `creatorIds` and schedule it. Each run records the current follower, video and like counts with a timestamp.

#### I have input from another Bilibili Actor. Will it work?

Mostly, yes. `searchQuery`, `keywords`, `queries`, `startUrls`, `urls`, `userIds`, `maxResults` and `maxComments` are accepted as aliases for the fields above.

#### Is it legal to scrape Bilibili?

Scraping public data can be lawful in many situations, but legality depends on jurisdiction, purpose, platform terms and the data collected. This Actor collects only public video, comment, danmaku and creator information that Bilibili shows to any logged-out visitor, and never logs in or bypasses access controls. Comments and danmaku contain user-generated content and user names, so handle them under the privacy law that applies to you (for example GDPR or China's PIPL) and get legal advice for high-risk use.

#### Is this a Bilibili API?

Effectively yes. Run it through the Apify API, synchronously or asynchronously, and read structured JSON, CSV or Excel. The field names are stable and listed in the table above.

### Changelog

- **2026-09-25** - First release: keyword video search with sort, length and date filters; video links; creator profiles with full upload lists; creator search by keyword; popular and top-100 ranking boards; full video stats with engagement rate; top comments; raw danmaku rows with a per-video reaction profile; per-row-type pricing with no start fee.

### 🛠️ Support

Something wrong or missing? Open an Actor issue with the run URL, the input you used and what you expected. That is the fastest route to a fix.

### ⭐ Rate this Actor

If this saved you time, please leave a rating on the **Reviews** tab. Review count is the main trust signal buyers have on the Store, and reviews decide which Actors get improved next. If something is broken, please open an issue first so it can be fixed.

# Actor input Schema

## `searchQueries` (type: `array`):

Keywords to search Bilibili videos for, for example "原神" or "iPhone 17". Chinese keywords return far more results than English ones. Each keyword is searched separately.

## `videoUrls` (type: `array`):

Bilibili video links, BV ids (BV1xx411c7mD), av ids (av170001) or b23.tv short links. Each returns its full stats and, if switched on, its comments and danmaku.

## `creatorIds` (type: `array`):

Creator UIDs (946974) or space.bilibili.com links. Each returns the creator's profile (followers, likes, video count, verification) plus their uploads, newest first.

## `creatorSearchQueries` (type: `array`):

Keywords to search Bilibili creators (UP主) for, for example "数码" or "美妆". Returns one row per creator with followers, video count, level and verification.

## `trending` (type: `string`):

Also scrape one of Bilibili's trending boards. "popular" is the live 综合热门 feed, "ranking" is the top-100 排行榜.

## `maxVideosPerSource` (type: `integer`):

How many videos to return for each search keyword, each creator and the trending board. Bilibili serves at most about 1,000 per keyword.

## `maxCreatorsPerQuery` (type: `integer`):

How many creators to return for each creator-search keyword.

## `creatorSortBy` (type: `string`):

Order of creator search results. "Most followers" surfaces the established creators in a niche; "Relevance" favours exact name matches.

## `sortBy` (type: `string`):

Order of keyword search results.

## `durationFilter` (type: `string`):

Only return keyword search results of this length.

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

Only return keyword search results published on or after this date (YYYY-MM-DD, China time). Also the way to reach past the ~1,000-per-keyword cap: split a long period into several windows.

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

Only return keyword search results published on or before this date (YYYY-MM-DD, China time).

## `fetchVideoDetails` (type: `boolean`):

Open each video for likes, coins, shares, exact favourites, originality and part count, and compute an engagement rate. One extra request per video; turn off for a faster, search-fields-only pull.

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

Return each video's top comments, ranked the way Bilibili ranks them, with likes, reply count, author level and whether the uploader wrote or pinned it. Each comment is a billed row.

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

Caps the comment rows for each video. Comments come 20 per page.

## `includeDanmaku` (type: `boolean`):

Return the on-screen danmaku comments, each with the second of the video it was sent at, and add a reaction profile to the video row (danmaku fetched, unique senders, peak minute).

## `maxDanmakuPerVideo` (type: `integer`):

Caps the danmaku rows for each video, sampled evenly across the whole timeline. Set 0 to get only the reaction profile on the video row, with no danmaku rows.

## Actor input object example

```json
{
  "searchQueries": [
    "iPhone 17"
  ],
  "videoUrls": [],
  "creatorIds": [],
  "creatorSearchQueries": [],
  "trending": "none",
  "maxVideosPerSource": 20,
  "maxCreatorsPerQuery": 20,
  "creatorSortBy": "fans",
  "sortBy": "totalrank",
  "durationFilter": "0",
  "fetchVideoDetails": true,
  "includeComments": false,
  "maxCommentsPerVideo": 20,
  "includeDanmaku": false,
  "maxDanmakuPerVideo": 200
}
```

# Actor output Schema

## `videos` (type: `string`):

One row per video with views, likes, coins, favourites, shares and engagement rate.

## `comments` (type: `string`):

Top comments with likes, reply count and author level.

## `danmaku` (type: `string`):

On-screen danmaku with the second of the video each was sent at.

## `creators` (type: `string`):

Creator profiles with followers, video count and verification.

## `summary` (type: `string`):

Counts, requests made and any videos or creators that could not be fetched.

# 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 = {
    "searchQueries": [
        "iPhone 17"
    ],
    "maxVideosPerSource": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("webdata_labs/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 = {
    "searchQueries": ["iPhone 17"],
    "maxVideosPerSource": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("webdata_labs/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 '{
  "searchQueries": [
    "iPhone 17"
  ],
  "maxVideosPerSource": 20
}' |
apify call webdata_labs/bilibili-scraper --silent --output-dataset

```

## MCP server setup

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