# Bilibili User Videos (`opspilot.cc/bilibili-user-videos`) Actor

📺 Bilibili User Videos | A channel's catalogue with the numbers that show its reach\n\nGive it Bilibili uids or space URLs and get every video as a row: title, views, comments, danmaku, duration, publish time and cover — plus a per-channel summary with median views, the danmaku-to-view ratio, publ…

- **URL**: https://apify.com/opspilot.cc/bilibili-user-videos.md
- **Developed by:** [wang wei](https://apify.com/opspilot.cc) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.008 / actor start

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 User Videos

> A channel's catalogue with the numbers that show its reach — and with views, comments and danmaku kept as three separate things.

### ✨ What you get

One dataset row per video:

| Field | What it is |
|---|---|
| `title` / `description` | the video's title and description |
| `viewCount` | views |
| `commentCount` | comments — **not** the same as danmaku |
| `danmakuCount` | danmaku (bullet comments), which Bilibili counts separately |
| `favorites` | favourites, when the source reports them |
| `durationSeconds` / `durationText` | length parsed into seconds, with the original text kept |
| `publishedAt` | a real timestamp |
| `coverUrl` / `url` / `bvid` / `aid` | the video and its identifiers |
| `countersAvailable` | whether this row actually got comment/danmaku numbers — see the FAQ |
| `isPaid` / `isLessonVideo` | paid and course content, flagged |
| `order` / `position` | the sort you asked for and the row's place in it |

The run summary gives, per channel: videos collected vs the channel's **own reported total** and your `coveragePct`, median and total views, median comments and danmaku, the **danmaku-to-view ratio**, how many rows got counters vs how many are still missing them, the publish date range, and the 5 most-viewed videos.

### 💼 Use cases

- **Deciding whether a channel's audience watches or just clicks** — `medianDanmakuToView` is the sharpest signal here. Bilibili caps danmaku per video, so a channel with huge views and a tiny ratio is buying attention; the opposite is a loyal audience you can brief for.
- **Comparing channels before you buy reach** — read `medianViews`, not `totalViews`. A channel with 2,000 uploads will always win on totals, so the totals tell you catalogue size, not reach.
- **Pricing a sponsorship against the catalogue, not the channel** — `isPaid` / `isLessonVideo` flag paid and course content so you can exclude monetised rows from an organic-reach comparison and see what the brand is actually paying attention for.
- **Running a recurring competitor watch** — schedule it on the same uids and diff `publishedAt` plus `medianViews`. A channel whose typical reach is climbing while cadence stays flat is a channel worth approaching; one drifting the other way is not.

### ✅ Who this is for

- **Media and sponsorship planners** who need a defensible reach number for a Bilibili channel before a budget meeting, and who care about view count (播放量) as a buying criterion rather than a vanity metric.
- **Content and social teams benchmarking competitor channels** — publish cadence, median reach and the top 5 videos per channel come out of one run.
- **Agencies producing recurring channel reviews** for clients, where the same uid list is re-run monthly and the diff is the deliverable.
- **Overseas brands entering the Chinese market** who need to know whether a Bilibili channel's audience is a real viewership or an inflated follower count, and can read Chinese titles but not judge the metrics.

### ❌ Who this is NOT for

- **Comment and danmaku (bullet comment) numbers on every row** — the listing source carries view counts only, so comment and danmaku come from a second lookup limited to the top `enrichTop` videos (max 30) per channel. Rows outside that keep `null` with `countersAvailable: false`, and `rowsMissingCounters` in the summary tells you how many. With `enrichTop: 0` you get none at all.
- **Exact view counts, or a channel's full back catalogue** — Bilibili rounds views (592,937 vs 592,985 on the same video across the two sources), and `coveragePct` states how much of the channel's own reported total you actually collected. Neither number is a precision figure.
- **Assuming your sort order came from the platform** — every ordering value the source documents is rejected by its API, so the ordering is applied to the collected rows locally and `position` reflects your request. Trust `sortApplied: local`, and do not read `position` as Bilibili's own ranking.
- **Private or non-listable channels** — the endpoint only serves publicly listable channels, and an unsuitable uid fails generically instead of returning an empty list. Check `warnings` before concluding a channel has no videos.
- **Judging engagement on Bilibili against other platforms** — view count here is Bilibili's rounded display number and danmaku is a Bilibili-specific behaviour. It is not comparable to Douyin view counts or Kuaishou play counts; use each platform's own actor.

### 🚀 Quick start

1. Open the Actor and press **Start** (defaults to one public channel).
2. Paste uids or `space.bilibili.com/<uid>` links — one per line, up to 20.
3. Read `medianViews` (not `totalViews`) to compare channels, and `medianDanmakuToView` to see whether a channel's audience actually watches.

### 📥 Input parameters

| Parameter | Type | Default | What it does |
|---|---|---|---|
| `channels` | list | one public channel | Channel uids or space URLs, one per line, up to 20 per run. |
| `order` | select | `pubdate` | `pubdate` (newest), `click` (most played), `dm` (most danmaku), `stow` (most favourited). |
| `maxVideosPerChannel` | number | `60` | 1–200 videos per channel. |
| `enrichTop` | number | `20` | How many videos per channel get a second lookup that adds comment and danmaku counts (0–30). Set `0` for the cheapest run. |

### 📤 Output

- **Dataset** — one row per video (or a notice when nothing was collected)
- **SUMMARY** — per-channel view distribution, danmaku ratio, counter coverage, top videos, warnings

### ⚙️ How it works

1. Each input is reduced to a channel uid; ids and space URLs both work, and anything else is refused up front because a wrong uid fails with a generic error rather than an empty list.
2. Videos are paged and de-duplicated by bvid. The channel's own video total is recorded so the summary can state coverage instead of implying completeness.
3. The listing source reports **view counts only**, so the top `enrichTop` videos get a second lookup that adds comment and danmaku numbers. If that lookup is unavailable, those columns stay `null` and the summary's `rowsMissingCounters` says how many rows are affected — the run still succeeds.
4. Sorting is applied to the collected rows after collection, and the summary reports `sortApplied: local` so nobody assumes the source ordered anything.

### 💰 Billing

Pay per result — you are charged for the video rows this Actor actually returns, not for the run. Cost has two parts and both are visible in the summary: one listing request per page, plus one enrichment request per enriched video. Lower `enrichTop` to spend less. There is no daily run cap.

**Free plan limit.** One run fetches up to **2 channels × 30 videos over 2 pages each**, with **no** comment/danmaku counters. That is a hard ceiling on the upstream bill, so it cannot be raised from the input form. A capped run still succeeds: it writes a `notice` row to the dataset, sets `appliedLimits.capped: true` in `SUMMARY`, and logs why. Any paid Apify plan lifts the cap to the full 20 channels × 200 videos over 10 pages, with counters on the top 30 per channel.

### ❓ FAQ

**Why are `commentCount` and `danmakuCount` null on some rows?**
The listing source carries view counts only, so comment and danmaku numbers come from a second lookup limited to `enrichTop` videos per channel. Rows without them keep `null` rather than a misleading zero, `countersAvailable` is `false`, and the summary reports `rowsWithCounters` / `rowsMissingCounters`. Raise `enrichTop` to widen it.

**What is the danmaku-to-view ratio good for?**
Bilibili caps danmaku per video, so a high ratio means viewers stayed and typed rather than clicked and left. A channel with huge views and a tiny ratio is buying attention; the opposite is a loyal audience.

**Why is `totalViews` not enough to compare channels?**
It scales with how many videos a channel has. Compare `medianViews` instead — that is the typical reach per video.

**Are views exact?**
No. Bilibili rounds view counts, and the two sources differ slightly (592,937 vs 592,985 on the same video during testing). Treat them as the platform's own rounded display numbers.

**The sort order I picked doesn't match the source.**
Expected: every ordering value the source documents is rejected by its API, so the ordering is applied to the collected rows. `position` reflects your request, and `sortApplied: local` in the summary records that this happened.

**A channel returned nothing.**
Check the uid first — this endpoint only serves channels that are publicly listable, and an unsuitable uid produces a generic failure rather than an empty list. The reason is in `warnings`.

### 📚 Resources

- Bilibili public channel data (no login required)
- Apify free plan: monthly credit covers usage, no separate daily cap

# Changelog

This Actor's version history is a separate document: https://apify.com/opspilot.cc/bilibili-user-videos/changelog.md

# Actor input Schema

## `channels` (type: `array`):

One per line, up to 20 per run. The uid is the number in space.bilibili.com/<uid>.

## `order` (type: `string`):

Most played for a channel's best-known work, newest for what it is publishing now. The ordering is applied to the collected rows after collection.

## `maxVideosPerChannel` (type: `integer`):

Cap on videos collected per channel. Cost scales linearly with pages × channels.

## `enrichTop` (type: `integer`):

The listing leg reports view counts only, so this many videos per channel get a second lookup that adds comment and danmaku counts. Set 0 for the fastest, cheapest run.

## Actor input object example

```json
{
  "channels": [
    "517327498"
  ],
  "order": "pubdate",
  "maxVideosPerChannel": 60,
  "enrichTop": 20
}
```

# Actor output Schema

## `dataset` (type: `string`):

One row per video, or a single notice when nothing was collected.

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

Per-channel view distribution, danmaku ratio, top videos, coverage and warnings.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("opspilot.cc/bilibili-user-videos").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("opspilot.cc/bilibili-user-videos").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 '{}' |
apify call opspilot.cc/bilibili-user-videos --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,opspilot.cc/bilibili-user-videos"
        }
    }
}
```

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/Arn8BeDDM75yLb3tD/builds/HbHhDOuQEVGkJcw3P/openapi.json
