# Bilibili Scraper & API | EveryInfra (`blushing_parachute/everyinfra-bilibili-api`) Actor

Unofficial Bilibili data via one Actor: search, profile, user_posts, video, comments, danmaku, subtitles, popular. Pay per request, no start fee. First 3 requests free across EveryInfra Actors.

- **URL**: https://apify.com/blushing_parachute/everyinfra-bilibili-api.md
- **Developed by:** [ECHO](https://apify.com/blushing_parachute) (community)
- **Categories:** Videos, Social media
- **Features:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 38.9% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $11.20 / 1,000 search requests

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 & API | EveryInfra

Retrieve video metadata, creator profiles, audience comments, bullet chats, and voice transcripts to analyze content engagement.

Look up creators via numeric identifiers and videos via sharing links, noting that automated transcripts differ from manual subtitles.

### Actions

| Action | What you get | Required | Optional | Results per request | Price per request |
|---|---|---|---|---|---|
| `search` | Search Bilibili for videos on a topic, with duration, views, likes, coins, favorites, danmaku and comment counts, uploader and publish time. Note that `most_liked` sorts by favorites rather than likes, and counts are a snapshot, not a history. | keyword | sort | 20 (up to 50) | $0.0112 |
| `profile` | Look up a Bilibili uploader by numeric ID. Get name, bio, level, follower and video counts, verification title and premium membership. Pass only the integer from the space.bilibili.com link in `user_id`. Their videos come from `user_posts`. | user_id | — | 1 | $0.0017 |
| `user_posts` | List the videos an uploader has posted on Bilibili, each with link, title, duration, views and engagement counts. Pass the numeric ID in `user_id`. One batch does not always cover the creator's full archive. | user_id | — | 20 (up to 50) | $0.0224 |
| `video` | Fetch one Bilibili video by its BV link for description, duration, publish date, uploader, category, tags and view, like, coin, favorite and share counts. Comments and danmaku come from the separate `comments` and `danmaku` actions. | url | — | 1 | $0.0012 |
| `comments` | Read viewer comments under a Bilibili video. Each comment has text, likes, reply count, commenter name and profile link, and post time. Replies are counted, but the full conversation tree is not rebuilt. | url | — | 10 (up to 10) | $0.0024 |
| `danmaku` | Pull the on-screen bullet comments (danmaku) from a Bilibili video, each with text, playback time, display mode, color and send time. On multi-part videos the rows come from the first part, and they are separate from the comments below the video. | url | — | 50 (up to 200) | $0.0017 |
| `subtitles` | Get the subtitle text of a Bilibili video. You get timed segments, a language code, the title, uploader and length in seconds. It covers what is said in the video, not viewer comments. The `language` label can be wrong. | url | — | 1 | $0.0017 |
| `popular` | Browse the videos on Bilibili's Popular page, 20 per page, each with BV and av IDs, views, likes, danmaku, coins, favorites, shares, comments, duration, category, uploader and upload IP region. `recommend_reason` carries the tag Bilibili puts on a video, such as one for passing a million views, in Chinese as shown. Pass `next_page_token` back as `page_token` for the next page; the list changes through the day. | — | page_token | all the source returns | $0.0200 |

### Input

Pick an `action` and fill the fields it uses. Example:

```json
{
  "action": "search",
  "keyword": "\u6444\u5f71\u5165\u95e8"
}
```

Fields that another action needs are ignored when left empty. API users can also pass `{"action": ..., "params": {...}}`.

### Output

Each result is one dataset row. Rows keep every field the source page exposes for that action; a field the platform hides or leaves empty for a record is omitted rather than filled with a placeholder. When there is a next page, the run's `OUTPUT` record holds `next_page_token`.

- `search`: `id`, `url`, `title`, `text`, `duration_seconds`, `duration_sec`, `duration_text`, `view_count`, `like_count`, `comment_count`, `danmaku_count`, `favorite_count`, `coin_count`, `share_count`, `thumbnail_url`, `posted_at`, `category`, `author_name`, `author_id`, `author_url`, `platform`, `tags`
- `profile`: `user_id`, `name`, `url`, `bio`, `avatar_url`, `gender`, `level`, `follower_count`, `following_count`, `video_count`, `like_count`, `is_verified`, `verified_title`, `is_vip`, `vip_label`, `birthday`, `school`, `platform`, `recent_videos`
- `user_posts`: `id`, `url`, `title`, `text`, `duration_seconds`, `duration_sec`, `duration_text`, `view_count`, `like_count`, `comment_count`, `danmaku_count`, `favorite_count`, `coin_count`, `share_count`, `thumbnail_url`, `posted_at`, `category`, `author_name`, `author_id`, `author_url`, `platform`, `tags`
- `video`: `id`, `url`, `title`, `text`, `duration_seconds`, `duration_sec`, `duration_text`, `view_count`, `like_count`, `comment_count`, `danmaku_count`, `favorite_count`, `coin_count`, `share_count`, `thumbnail_url`, `posted_at`, `category`, `author_name`, `author_id`, `author_url`, `platform`, `tags`, `video_streams`, `audio_streams`, `streams_expire_at`, `streams_referer`
- `comments`: `id`, `text`, `like_count`, `reply_count`, `author_name`, `author_id`, `author_url`, `posted_at`, `video_id`, `platform`
- `danmaku`: `id`, `text`, `video_id`, `video_time`, `video_time_seconds`, `mode`, `color`, `pool`, `sent_at`, `platform`
- `subtitles`: `video_id`, `title`, `author_name`, `duration_seconds`, `duration_sec`, `language`, `text`, `platform`, `segments`
- `popular`: `id`, `aid`, `url`, `title`, `text`, `duration_seconds`, `duration_sec`, `view_count`, `like_count`, `comment_count`, `danmaku_count`, `favorite_count`, `coin_count`, `share_count`, `thumbnail_url`, `posted_at`, `category`, `author_name`, `author_id`, `author_url`, `author_avatar_url`, `recommend_reason`, `ip_location`, `platform`

#### Field notes

- `duration_text`: Duration as displayed text (for example 12:34).
- `danmaku_count`: Danmaku (on-screen comment) count. **A Bilibili-specific engagement signal; read it alongside comment_count.**
- `favorite_count`: Favorites.
- `coin_count`: Coins given. Coins are a paid form of approval on Bilibili and weigh more than likes.
- `aid`: The video's numeric av ID (popular); it names the same video as the BV ID in id.
- `recommend_reason`: The tag Bilibili puts on a Popular video, as shown (popular), for example for passing a million views or many shares; absent when there is none.
- `ip_location`: Upload location (popular): the IP region Bilibili shows on the video page, a province or country.
- `author_avatar_url`: Uploader avatar link (popular).
- `audio_streams`: List of audio streams (DASH, .m4s, mp4a): id, codecs, bandwidth, url, backup_urls. Expiry time and Referer requirement are the same as for video_streams.
- `author_level`: Bilibili level of the replier (0–6, comment_replies).
- `birthday`: Birthday.
- `cid`: Part ID (video_parts): the numeric ID Bilibili assigns to each part of a video.
- `color`: Color of the bullet comment (danmaku).
- `episode_count`: Number of episodes (anime and film/TV rows in general_search).
- `gender`: Gender.
- `height`: Frame height, in pixels (video_parts).
- `is_by_uploader`: Whether the reply was posted by the video's uploader (comment_replies).
- `is_live`: Whether the user is live streaming now (user rows in user_search and general_search); the field may be absent when the user is not live.
- `is_senior_member`: Whether the user is a senior (hardcore) member (user rows in user_search and general_search); the field is absent when not.
- `is_vip`: Whether the user is a Big Member (Bilibili's paid membership).
- `level`: User level (0–6).
- `live_room_id`: Live room number of the user (user rows in user_search and general_search); absent when the user has never opened a live room.
- `mentions`: Nicknames of users @-mentioned in the reply (comment_replies), as an array; the field is absent when there is no @.
- `mode`: Bullet comment mode (scrolling, top, bottom).
- `part_number`: Which part of the video this is (video_parts), counting from 1.
- `pool`: Bullet comment pool.
- `recent_video_ids`: BV numbers of the user's most recent videos (user rows in user_search and general_search), as an array; each can be passed as the url of video.
- `reply_to_comment_id`: The reply this reply responds to (comment_replies); absent for a direct reply to a top-level comment.
- `root_comment_id`: ID of the top-level comment this reply belongs to (comment_replies); it matches the comment_id in the request.
- `school`: School.
- `sent_at`: Time the bullet comment was sent.
- `streams_expire_at`: Time when the stream URLs expire (ISO, the earliest of all the links; about 120 minutes after the call). After that, call video again to get new URLs.
- `streams_referer`: Value of the Referer request header that must be sent when downloading the stream URLs (without it the request gets a 403).
- `verified_title`: Verification title (such as well-known uploader).
- `verified_type`: Verification type (user rows in user_search and general_search): personal for personal verification, organization for organization verification; absent when not verified.
- `video_count`: Number of videos.
- `video_id`: BV number of the video.
- `video_streams`: List of video streams (DASH, .m4s, picture only with no sound, to be merged with an audio stream): id (quality code), quality (quality name, up to 480P without login), codecs (avc1 / hev1 / av01), width, height, frame_rate, bandwidth, url, backup_urls. The links expire after about 120 minutes, see streams_expire_at; send the Referer request header when downloading, see streams_referer.
- `video_time`: Time point within the video.
- `video_time_seconds`: Time point within the video, in seconds.
- `vip_label`: Membership label.
- `width`: Frame width, in pixels (video_parts).
- `duration_sec`: Video length in seconds, the same value as duration_seconds (both names are returned); on video_parts it is the length of that one part, elsewhere a multi-part video gives the total of all parts.
- `segments`: Line-by-line subtitle timeline (subtitles): each entry has start and end as timecodes (for example 00:00:00.830) and its text.

### Pricing

Pay per event, charged only when a run delivers data:

- `search`: $0.0112, one event per started block of 20 results.
- `profile`: $0.0017, one event per non-empty request, whatever the row count.
- `user_posts`: $0.0224, one event per started block of 20 results.
- `video`: $0.0012, one event per non-empty request, whatever the row count.
- `comments`: $0.0024, one event per non-empty request, whatever the row count.
- `danmaku`: $0.0017, one event per started block of 50 results.
- `subtitles`: $0.0017, one event per non-empty request, whatever the row count.
- `popular`: $0.0200, one event per non-empty request, whatever the row count.

Empty or failed requests are never charged. There is no actor-start fee and no per-row fee, and platform usage is included in these prices.

### Free trial

The first 3 accepted data requests per Apify account are free across all EveryInfra Actors combined (a lifetime total, not per Actor and not reset). Invalid input does not use a trial; an accepted request that returns no data still does. After that a paid Apify plan is required.

### Notes

- Results reflect what is publicly visible when the run happens; counts can be lower than requested.
- One run makes one request. For more pages, start another run with `page_token` where the action supports it.
- This is an independent Actor. It is not affiliated with, sponsored by, or endorsed by Bilibili or its owner; names and trademarks belong to their respective owners.

### Support

Open an issue on this Actor's Issues tab with the run ID.

# Actor input Schema

## `action` (type: `string`):

What to fetch. Each action uses only the fields listed for it below; other fields are ignored when empty.

## `keyword` (type: `string`):

Used by `search` (required). Specifies video search terms for Bilibili based on titles or topics, rather than an exact uploader nickname search. Use user_id to query uploader profiles or user submissions.

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

Used by `search`. Specifies the video sort order: relevance, newest for latest, most_viewed for view count, most_commented for comment relevance, and most_liked for favorites rather than likes. It applies to video search only and does not set the order of comments.

## `user_id` (type: `string`):

Used by `profile` (required), `user_posts` (required). Specifies a Bilibili uploader's numeric mid, extracted from https://space.bilibili.com/<mid>. Provide only the raw integer in user_id, without nicknames, BV IDs, or full space URLs.

## `url` (type: `string`):

Used by `video` (required), `comments` (required), `danmaku` (required), `subtitles` (required). Specifies a full Bilibili video URL, formatted as https://www.bilibili.com/video/<BVID>. The url parameter fetches video comments on comments, first-part timed comments on danmaku, and audio transcription on subtitles, treating each as distinct text sources. The danmaku action must be able to extract a valid BV ID from the provided path.

## `page_token` (type: `string`):

Used by `popular`. Page token for `popular`: pass back the previous response's `next_page_token` exactly as received to get the next 20 videos; leave it out to start at the first page. Tokens last 24 hours and each page is one call.

## `limit` (type: `integer`):

How many results to request for list actions. Defaults and maximums per action: `search` 20 (max 50); `user_posts` 20 (max 50); `comments` 10 (max 10); `danmaku` 50 (max 200). Billing: `search` one event per started block of 20 results; `user_posts` one event per started block of 20 results; `comments` one event per non-empty request, whatever the row count; `danmaku` one event per started block of 50 results.

## `params` (type: `object`):

Optional JSON object with the same fields as above, for API and integration use. Flat fields and params must not disagree.

## Actor input object example

```json
{
  "action": "search",
  "keyword": "摄影入门"
}
```

# Actor output Schema

## `records` (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 = {
    "keyword": "摄影入门"
};

// Run the Actor and wait for it to finish
const run = await client.actor("blushing_parachute/everyinfra-bilibili-api").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 = { "keyword": "摄影入门" }

# Run the Actor and wait for it to finish
run = client.actor("blushing_parachute/everyinfra-bilibili-api").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 '{
  "keyword": "摄影入门"
}' |
apify call blushing_parachute/everyinfra-bilibili-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,blushing_parachute/everyinfra-bilibili-api"
        }
    }
}
```

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/lgqkw3IajYpNFflzv/builds/8WzKTbxP3c5NZ8H4c/openapi.json
