# Bilibili Scraper: Videos, Comments, Danmaku & Uploaders (`stratumics/bilibili-scraper`) Actor

Scrape Bilibili videos by search, link or uploader without logging in: views, likes, coins, tags, uploader profiles, comments with replies and danmaku, in clean rows.

- **URL**: https://apify.com/stratumics/bilibili-scraper.md
- **Developed by:** [Stratum ICS](https://apify.com/stratumics) (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.50 / 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

### What does Bilibili Scraper do?

**Bilibili Scraper** extracts **Bilibili (哔哩哔哩, B站) videos, uploader profiles, comments and danmaku** without logging in. Search Bilibili by keyword, paste video links or BV ids, or give uploader (UP主) links, and get **title, description, tags, category, views, likes, coins, favorites, shares, danmaku and comment counts, uploader, parts, cover and publish date** for every video, plus each uploader's **followers, level, video count and verification**.

Add the **comments with their replies** and the **danmaku** (弹幕, the comments that fly across the video) when you need them. Use it from the Apify Console, through the **Apify API** as a Bilibili API alternative, or from any AI agent connected to Apify.

### Why use this Bilibili scraper?

- **No login, no cookies, no Chinese phone number.** It reads Bilibili the way a logged-out visitor does, from anywhere in the world.
- **Full video details on every row.** Views, likes, coins (投币), favorites (收藏), shares, danmaku and comment counts, tags, category, parts (分P), resolution, joint-work credits and the uploader, not just what a search card shows.
- **Searches, links and uploaders in one run.** Up to 1,000 results per search term (Bilibili's own limit), sorted by best match, views, date, danmaku or favorites, with length and date filters.
- **All the comments you ask for.** Logged-out Bilibili pages show 3 comments per video; this scraper pages through them, most liked or newest first, with replies right after the comment they answer.
- **Danmaku for every part.** Text, the second it appears at, color, mode, font size and send time, in time order, at a fraction of a cent per thousand.
- **Follow uploaders on a schedule.** With **Only new videos**, each run saves only videos earlier runs have not saved.
- **Fast and cheap to run.** Plain HTTP requests, no browser: 330 videos from three searches took under a minute in our tests.

Typical uses: **brand and agency work on the Chinese market** (what is trending, who the creators are, how audiences react), **creator and competitor tracking**, **comment and danmaku sentiment analysis** for research and AI pipelines, and datasets of videos for media studies.

### What data can you extract from Bilibili?

| Field                                                                      | Example                                                          |
| -------------------------------------------------------------------------- | ---------------------------------------------------------------- |
| `bvid`, `aid`, `cid`, `url`                                                | BV1pTap6UE1w · 117353656356865 · 42306046424 · video link        |
| `title`, `description`, `tags`                                             | 《原神》过场动画-「遗赠」 · description · 原神, 米哈游, 过场动画 |
| `category`, `categoryId`, `publishedAt`, `duration`                        | 手机游戏 · 172 · 2026-10-10 · 450 seconds                        |
| `viewCount`, `likeCount`, `coinCount`, `favoriteCount`, `shareCount`       | 762,568 · 88,980 · 17,052 · 11,523 · 2,607                       |
| `danmakuCount`, `replyCount`                                               | 1,396 danmaku · 7,433 comments                                   |
| `ownerMid`, `ownerName`, `ownerFace`                                       | 401742377 · 原神 · picture link                                  |
| `cover`, `width`, `height`, `pagesCount`, `pages`                          | cover link · 2560 x 1440 · 4 parts with titles and lengths       |
| `isOriginal`, `isCooperation`, `staff`                                     | original work · joint work · credited uploaders and roles        |
| Uploaders: `name`, `sign`, `level`, `followers`, `following`, `videoCount` | 老番茄 · bio · 6 · 20,850,826 · 7 · 682                          |
| Uploaders: `likesCount`, `officialTitle`, `officialType`                   | 196,276,391 · verification title · personal or organization      |
| Comments: `text`, `memberName`, `createdAt`, `likeCount`, `replyCount`     | comment text · commenter · date · likes · replies                |
| Comments: `parentId`, `rootId`, `isPinned`                                 | thread links for replies · pinned by the uploader                |
| Danmaku: `text`, `time`, `mode`, `color`, `fontSize`, `sentAt`             | 【每周必看】 · 0.338 s · scrolling · #ffffff · 25 · send date    |

Video links Bilibili does not show logged out (deleted, private, under review or limited to some regions) and uploaders that do not exist come back as **free rows** with a `status` of `unavailable` or `notFound` and Bilibili's own message, so you can see what happened to every input. Each run also saves a free **summary** per input in the `SUMMARY` record of its key-value store.

### How to scrape Bilibili

1. Open the **Input** tab and enter **search terms** (in Chinese or any language), **video links or BV ids**, or **uploader links or ids**.
2. Set **Videos per search or uploader**. This caps what you pay.
3. Optionally pick the **search order** and **video length**, a date limit, or turn on **comments**, **replies** and **danmaku**.
4. Click **Start**. Rows appear in the **Output** tab as they are saved.
5. Download the results as **CSV, Excel, JSON or HTML**, or send them to Google Sheets, Zapier, Make or n8n.
6. To follow uploaders, turn on **Only new videos** and add a **schedule** to the saved task.

### How much does it cost to scrape Bilibili?

You pay per row saved:

| Event                                 | Price                     |
| ------------------------------------- | ------------------------- |
| Video saved (all fields above)        | $0.003 ($3.00 per 1,000)  |
| Uploader profile saved                | $0.003 ($3.00 per 1,000)  |
| Comment or reply saved                | $0.001 ($1.00 per 1,000)  |
| Danmaku saved                         | $0.0002 ($0.20 per 1,000) |
| Unavailable videos, missing uploaders | Free                      |

**1,000 videos cost $3.00.** The latest 100 videos of 10 uploaders with their profiles cost 10 x $0.003 + 1,000 x $0.003 = **$3.03**. The first 50 comments of 100 videos cost 5,000 x $0.001 = **$5**, and 1,000 danmaku from each of them 100,000 x $0.0002 = **$20**. Apify's free plan includes $5 of monthly credit, enough for more than 1,600 videos.

Larger Apify plans pay less automatically: videos and uploaders cost $2.50 per 1,000 on Starter, $2.00 on Scale and $1.50 on Business, comments $0.80, $0.60 and $0.50, and danmaku $0.16, $0.12 and $0.10. Each run also has a start fee of $0.002.

### Input

See the **Input** tab for every option. Three searches, 100 videos each, the newest first, from the last 30 days:

```json
{
    "searchTerms": ["原神", "美食", "minecraft"],
    "searchOrder": "pubdate",
    "maxResultsPerInput": 100,
    "newerThan": "30 days"
}
```

Two uploaders' latest videos with comments, replies and danmaku:

```json
{
    "uploaders": ["https://space.bilibili.com/401742377", "546195"],
    "maxResultsPerInput": 20,
    "includeComments": true,
    "includeReplies": true,
    "maxCommentsPerVideo": 100,
    "includeDanmaku": true
}
```

- **BV ids** are Bilibili's video ids: the `BV1...` part of a link such as `https://www.bilibili.com/video/BV1zd4y1Q7BE/`. Older `av` ids (`av386101383`) and `b23.tv` short links work too.
- **Uploader ids (mid)** are the numbers in space links: `https://space.bilibili.com/401742377`.
- **Search order**: best match (综合), most views (最多播放), newest (最新发布), most danmaku (最多弹幕) or most favorites (最多收藏).
- **Only videos newer than** is passed to Bilibili's search date filter, and reading an uploader stops at the first older video.

### Output

You can download the dataset in various formats such as JSON, HTML, CSV or Excel. A video, an uploader, a comment and a danmaku from real runs (long text trimmed):

```json
[
    {
        "type": "video",
        "status": "ok",
        "input": "原神",
        "bvid": "BV1pTap6UE1w",
        "aid": "117353656356865",
        "cid": "42306046424",
        "url": "https://www.bilibili.com/video/BV1pTap6UE1w/",
        "title": "《原神》过场动画-「遗赠」",
        "description": "唯有直面死亡才能理解其中的感受，死神也不例外。...",
        "category": "手机游戏",
        "categoryId": 172,
        "publishedAt": "2026-10-10T04:00:00.000Z",
        "duration": 450,
        "ownerMid": "401742377",
        "ownerName": "原神",
        "ownerFace": "https://i2.hdslb.com/bfs/face/e63bacc8b9e68f59f401cc41728a99262ba661a3.jpg",
        "viewCount": 762568,
        "danmakuCount": 1396,
        "replyCount": 7433,
        "favoriteCount": 11523,
        "coinCount": 17052,
        "shareCount": 2607,
        "likeCount": 88980,
        "cover": "https://i1.hdslb.com/bfs/archive/2063b8933f7ab4ad868ceda83d509af4bb92f996.jpg",
        "width": 2560,
        "height": 1440,
        "isOriginal": true,
        "isCooperation": false,
        "staff": [],
        "pagesCount": 4,
        "pages": [
            { "cid": "42306046424", "page": 1, "title": "《原神》过场动画-「遗赠」", "duration": 108 },
            { "cid": "42306634166", "page": 2, "title": "日-《原神》过场动画-「遗赠」", "duration": 114 }
        ],
        "tags": ["圣土化", "死之执政", "原神", "miHoYo", "米哈游", "过场动画"],
        "searchRank": 1,
        "scrapedAt": "2026-10-18T07:43:00.477Z"
    },
    {
        "type": "uploader",
        "status": "ok",
        "input": "https://space.bilibili.com/546195",
        "mid": "546195",
        "url": "https://space.bilibili.com/546195",
        "name": "老番茄",
        "sign": "新浪微博：_老番茄_",
        "level": 6,
        "followers": 20850826,
        "following": 7,
        "videoCount": 682,
        "likesCount": 196276391,
        "face": "https://i0.hdslb.com/bfs/face/bc5ca101313d4db223c395d64779e76eb3482d60.jpg",
        "officialTitle": "2025百大UP主、2025年度商业影响力奖UP主、2022年度联合创作奖UP主",
        "officialType": "personal",
        "scrapedAt": "2026-10-18T07:38:50.189Z"
    },
    {
        "type": "comment",
        "id": "121679744688",
        "videoBvid": "BV1zd4y1Q7BE",
        "videoAid": "386101383",
        "parentId": null,
        "rootId": null,
        "text": "感谢大家支持，感谢特邀嘉宾北子哥。大家别嫌短哦，我们录了好多局的，这是最有效果的一局！...",
        "createdAt": "2022-07-20T07:56:17.000Z",
        "likeCount": 50249,
        "replyCount": 463,
        "memberMid": "5970160",
        "memberName": "小潮院长",
        "memberLevel": 6,
        "isPinned": true,
        "scrapedAt": "2026-10-18T07:44:26.216Z"
    },
    {
        "type": "danmaku",
        "id": "2189970039698933504",
        "videoBvid": "BV1zd4y1Q7BE",
        "cid": "778227380",
        "time": 0.338,
        "text": "【每周必看】",
        "mode": 1,
        "color": "#ffffff",
        "fontSize": 25,
        "sentAt": "2026-08-31T05:59:32.000Z",
        "senderHash": "74fe548f",
        "scrapedAt": "2026-10-18T07:44:26.967Z"
    }
]
```

Replies look like comments, with `parentId` and `rootId` set to the comment they answer.

### Tips for better results

- **Only uploader videos**: turn off **Save uploader rows**. Only search results: leave the other lists empty.
- **Engagement rate**: divide `likeCount + coinCount + favoriteCount` by `viewCount`; coins and favorites show stronger interest than likes on Bilibili.
- **Danmaku timelines**: `time` is seconds into the part (`cid`), so you can line danmaku up with moments in the video.
- **Large comment threads**: with replies on, replies count toward **Comments per video**, so raise the limit for popular videos. If Bilibili ever stops serving the full comment list, the run saves the top comments its website shows (3 per video, with their replies) and says so in the status message and the run summary.
- **Uploader lists**: Bilibili checks its uploader endpoints harder, so the scraper spaces those requests and retries refusals with a fresh visitor session. A test run still read 60 videos from each of 3 uploaders, with details, in 36 seconds.
- **Proxy**: the default connects directly, moves to Apify Proxy datacenter IPs if Bilibili refuses it, and to residential IPs only if those are refused too. The price per row is the same whichever connection is used.

### Integrations and API

- **API**: start runs and download results from any language. The **API** tab has ready code in Python, JavaScript and cURL.
- **Python**: `from apify_client import ApifyClient`, then `client.actor("stratumics/bilibili-scraper").call(run_input={"searchTerms": ["原神"], "maxResultsPerInput": 100})`.
- **JavaScript**: `import { ApifyClient } from 'apify-client'`, then `client.actor('stratumics/bilibili-scraper').call({ searchTerms: ['原神'], maxResultsPerInput: 100 })`.
- **No-code**: Zapier, Make, n8n, Google Sheets and Slack from the **Integrations** tab, for example to add each new video of an uploader to a sheet.
- **AI agents**: connect any MCP-capable assistant to Apify's MCP server (`mcp.apify.com`) and it can call this scraper as a tool to look up Bilibili videos and comments.

### FAQ

#### Is it legal to scrape Bilibili?

This scraper reads only public information that Bilibili serves to every visitor without logging in, and it never logs in. Results can still contain personal data: uploader names and pictures, and commenters' names and levels when you turn comments on. Danmaku come with Bilibili's own hash of the sender, not the account. Personal data is protected by China's PIPL, the GDPR in the European Union and other laws around the world, so only collect it when you have a legitimate reason, and consult a lawyer if you are unsure. Also consider Bilibili's terms for your use case.

#### Do I need a Bilibili account, cookies or a Chinese IP?

No. It runs logged out, with no account or cookies, from Apify's servers outside China.

#### What are BV ids, av ids and cids?

A BV id (`BV1...`) is the id in a video link; the av id is the older numeric id of the same video; a cid is the id of one part (分P) of a video, which danmaku belong to. Every video row carries all three.

#### What are danmaku?

Danmaku (弹幕) are the short comments viewers send at a moment of the video, which fly across the screen at that second. Bilibili keeps a current pool per part (up to a few thousand on popular videos), and the scraper saves that pool in time order.

#### Why are some videos unavailable?

Bilibili hides some videos from logged-out visitors or from viewers outside some regions, and deleted, private or under-review videos answer with a message such as 稿件不可见 (not visible). Such links come back as free rows with `status` and `message`. Search results only list videos Bilibili shows.

#### Why is the category empty on a few videos?

Bilibili's logged-out video answers give the category id with an empty name. The scraper names it from search results and a built-in table of 99 categories read from Bilibili; a video in a category outside both keeps only `categoryId`.

#### Found a problem or need a field?

Open an issue in the **Issues** tab with the input you used, and we will look at it.

### Other tools from Stratum ICS

- [Airbnb Scraper](https://apify.com/stratumics/airbnb-scraper): Get every Airbnb listing in a city or from listing links: price per night, rating, reviews, guests, bedrooms, host and Superhost status.
- [App Store Reviews Scraper](https://apify.com/stratumics/app-store-reviews-scraper): Get Apple App Store reviews with star ratings, titles, text, app versions, helpful votes and developer replies, well past Apple's 500-review limit, for any country, plus app ratings.
- [Facebook Ads Library Scraper](https://apify.com/stratumics/facebook-ads-library-scraper): Get ads from the Meta (Facebook) Ad Library by keyword, advertiser page or library link: texts, images, videos, dates, platforms and versions, plus spend for political ads.
- [Facebook Posts Scraper](https://apify.com/stratumics/facebook-posts-scraper): Get posts from public Facebook pages: text, reactions by type, comments, shares, views and media, plus page details with followers, contacts, rating and creation date.
- [Google Ads Transparency Scraper](https://apify.com/stratumics/google-ads-transparency-scraper): Get the ads any advertiser runs on Google Search, YouTube, Shopping, Maps and Play, from the Ads Transparency Center: images, formats, dates, regions and EU reach.
- [Google Maps Reviews Scraper](https://apify.com/stratumics/google-maps-reviews-scraper): Get the Google Maps reviews of any place: rating, full text, exact date, photos, owner reply, reviewer details and food or service scores.
- [Google Maps Scraper](https://apify.com/stratumics/google-maps-scraper): Get the businesses on Google Maps for any search and area: name, address, phone, website, rating, review count, opening hours, plus emails and social profiles.
- [Google News Scraper](https://apify.com/stratumics/google-news-scraper): Get Google News articles with real publisher URLs (not Google redirects), source, date, image, author and optional full text.
- [Google Play Reviews Scraper](https://apify.com/stratumics/google-play-reviews-scraper): Get Google Play reviews with star ratings, text, app versions, thumbs-up counts, developer replies and feature ratings in any language, plus app details with installs and star histogram.
- [Google Trends Scraper](https://apify.com/stratumics/google-trends-scraper): Get Google Trends data as JSON, CSV or Excel: interest over time, interest by region and city, related queries, and trending searches by country.
- [Instagram Scraper](https://apify.com/stratumics/instagram-scraper): Scrape public Instagram profiles, posts, reels and comments without logging in: followers, bio, posts count, captions, likes, video views, media links, tags and music.
- [LinkedIn Jobs Scraper](https://apify.com/stratumics/linkedin-jobs-scraper): Scrape LinkedIn jobs with full descriptions, salary ranges, seniority, job type and applicant counts.
- [Reddit Scraper](https://apify.com/stratumics/reddit-scraper): Get Reddit posts and full comment threads from subreddits, searches, user profiles and post links: titles, text, scores, flair, media and replies.
- [Telegram Channel Scraper](https://apify.com/stratumics/telegram-channel-scraper): Get messages from public Telegram channels with views, dates, media, reactions, polls and forwards, plus channel info with exact subscriber counts.
- [Threads Scraper](https://apify.com/stratumics/threads-scraper): Scrape Threads profiles, posts, replies and keyword search: followers, bio, post text, likes, replies, reposts, quotes, media and links.
- [TikTok Comments Scraper](https://apify.com/stratumics/tiktok-comments-scraper): Export TikTok comments and replies from any video or photo post: text, date, likes, reply count, commenter, pinned and creator-liked flags, plus video stats.
- [TikTok Scraper](https://apify.com/stratumics/tiktok-scraper): Scrape TikTok profiles and videos: followers, likes, bio, the latest 10 to 12 videos of each profile, and full stats for any video link.
- [Website Contact Scraper](https://apify.com/stratumics/website-contact-scraper): Turn a list of websites into one row per company with verified emails, formatted phone numbers, social profiles (LinkedIn, Facebook, Instagram, X), address and contact page.
- [YouTube Scraper](https://apify.com/stratumics/youtube-scraper): Get YouTube videos from searches, channels, playlists and links with exact views, likes, comment counts, dates and tags, plus channel profiles and comments.
- [YouTube Transcript Scraper](https://apify.com/stratumics/youtube-transcript-scraper): Get YouTube transcripts and captions as plain text, timed segments, SRT or WebVTT, from video links, whole channels or playlists, in any language YouTube offers.

# Actor input Schema

## `searchTerms` (type: `array`):

Words to search Bilibili videos for, in Chinese or any language (原神, 美食, minecraft). Each term gives up to the maximum number of videos below, in the order you pick.

## `searchOrder` (type: `string`):

How Bilibili sorts search results.

## `searchDuration` (type: `string`):

Keep only search results of this length.

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

Bilibili video links (https://www.bilibili.com/video/BV1zd4y1Q7BE/), BV ids (BV1zd4y1Q7BE), av ids (av386101383) or b23.tv short links. Each gives one video row.

## `uploaders` (type: `array`):

Uploader (UP主) space links (https://space.bilibili.com/401742377) or numeric ids (401742377). Each gives the uploader's profile row and their latest videos, newest first.

## `maxResultsPerInput` (type: `integer`):

The most videos to save for each search term (Bilibili's search stops at 1,000) and each uploader.

## `includeUploaders` (type: `boolean`):

For uploader inputs, save one row per uploader with name, bio, level, followers, following, video count and verification. Turn off to save only their videos.

## `newerThan` (type: `string`):

Keep videos published on or after this date. Use a date (2026-10-01), an ISO date-time in UTC (2026-10-01T12:00:00Z), or a relative value such as "7 days". Searches pass it to Bilibili's date filter and uploader lists stop at the first older video, so you pay only for videos in the range. Leave empty for no limit.

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

Save the comments of each video saved, one row per comment with its text, author, date, likes and reply count. Comments are charged per comment.

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

The most comments to save for each video. With replies on, replies count toward this number too.

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

Save the replies under each comment, right after it, with parentId and rootId pointing to the comment they answer.

## `commentsSort` (type: `string`):

Most liked first (as Bilibili shows them) or newest first.

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

Save the danmaku (the comments that fly across the video) of each video saved: text, the second they appear at, color, mode and send time, in time order. Danmaku are charged per item at a much lower price.

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

The most danmaku to save for each video, across its parts. Bilibili serves the current pool of each part (up to a few thousand on popular videos).

## `onlyNewVideos` (type: `boolean`):

Save only videos that earlier runs with the same inputs have not saved. The Actor remembers video ids in the key-value store bilibili-scraper-monitor in your account and stops reading an uploader once it reaches videos it has seen. Pair it with a schedule to follow uploaders.

## `monitorName` (type: `string`):

Optional. A name for the remembered list (letters, digits and hyphens), so different schedules keep separate histories even with the same inputs. Leave empty to derive it from the inputs.

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

With Apify Proxy on (the default), the Actor connects directly, moves to Apify Proxy datacenter IPs if Bilibili refuses it, and to residential IPs only if the datacenter IPs are refused too. Turn it off to never use a proxy, or pick proxy groups or your own proxy URLs to send every request through them.

## Actor input object example

```json
{
  "searchTerms": [
    "原神"
  ],
  "searchOrder": "totalrank",
  "searchDuration": "all",
  "videoUrls": [],
  "uploaders": [],
  "maxResultsPerInput": 20,
  "includeUploaders": true,
  "newerThan": "",
  "includeComments": false,
  "maxCommentsPerVideo": 50,
  "includeReplies": false,
  "commentsSort": "hot",
  "includeDanmaku": false,
  "maxDanmakuPerVideo": 1000,
  "onlyNewVideos": false,
  "monitorName": "",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

No description

## `uploaders` (type: `string`):

No description

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

No description

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

No description

## `allFields` (type: `string`):

No description

## `summary` (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 = {
    "searchTerms": [
        "原神"
    ],
    "maxResultsPerInput": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("stratumics/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 = {
    "searchTerms": ["原神"],
    "maxResultsPerInput": 20,
}

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

```

## MCP server setup

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