# Bilibili Scraper - Trending, Search, Comments & Trend History (`crawlplant/bilibili-trending-history`) Actor

Bilibili (哔哩哔哩) popular board, Top 100 rankings by category, weekly must-watch issues back to 2019, hot searches, video search, video details with tags, comments, danmaku and creator profiles. Scheduled runs track what changed: new entries, rank moves, views gained. No login.

- **URL**: https://apify.com/crawlplant/bilibili-trending-history.md
- **Developed by:** [CrawlPlant](https://apify.com/crawlplant) (community)
- **Categories:** Social media, Videos, AI
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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 - Trending, Search, Comments & Trend History

*Independent tool, not affiliated with, endorsed by or connected to Bilibili (哔哩哔哩, Shanghai Kuanyu Digital Technology).
It reads the public pages and data that bilibili.com shows to every visitor.*

Everything that is **trending on Bilibili**, as clean rows: the **popular board** (综合热门, up to 500 videos), the **Top 100
rankings** (排行榜) of 17 categories, **every weekly must-watch issue since March 2019** (每周必看, 392 by September 2026), the
all-time **must-watch list** (入站必刷) and the **top 50 hot searches** (热搜). Plus **video search**, **video details**
(tags, honours such as "全站排行榜最高第1名"), **comments** with replies, **danmaku** (弹幕 bullet comments) and **creator
profiles** (UP主 followers, videos, likes). Every video row has views, likes, **coins**, favorites, shares, danmaku,
comments, an **engagement rate**, views per hour and an **English category name**.

**Schedule it and it becomes a trend tracker**: each row says when your runs first saw it on that board, how many runs
saw it, its previous and best position, how many places it moved and **how many views it gained since the last run**.

**Or let us do the scheduling: track any video or creator for up to 90 days** (`trackDays`). Our server reads it every
hour, also while the Actor is not running, and mode `tracked` returns the whole curve whenever you ask: views, likes,
coins, favorites, shares, comments and danmaku hour by hour, follower growth and every new upload of a creator. Every
video row also says how many hours the video has spent on the popular board and the rankings, from our hourly snapshots.

### Why this one

- **Hour-by-hour history without running anything hourly.** `trackDays: 30` on a few videos or creators, and our server
  reads them every hour for 30 days: a launch curve (views in the first hours, the day it peaked), follower growth after
  a campaign, each new upload of a competitor from its first hours. One run to start, one run to read
  ([examples 18-21](#ready-to-use-examples)); about $0.30 per video for a month.
- **The boards Bilibili itself promotes, not just search.** Popular board, 17 category rankings, weekly must-watch and hot
  searches in one Actor, each row with its position on the board and Bilibili's own "why featured" line (e.g. "13万点赞").
- **Trend history you build by scheduling.** Run it hourly and every row carries `firstSeenAt`, `timesSeen`,
  `previousPosition`, `positionChange`, `bestPosition` and `viewsGained`; hot searches get `heatChange`, creators
  `followersGained`. `onlyNew: true` turns any board or search into a feed of what is newly trending.
- **Seven years of weekly must-watch.** Issue 1 (March 2019) to the latest, 46-49 videos in each recent issue, with the
  issue's week and theme on every row: what China's biggest video community watched, week by week. Exact likes, coins
  and views with `includeDetails: true` (one request per video); without it, Bilibili's rounded view counts.
- **Numbers you can compare.** Engagement rate (likes + coins + favorites + shares + comments per view), like rate, views
  per hour since upload, Bilibili's `highestRank` (the best all-site ranking position a video ever reached), creator
  followers, English names for Bilibili's categories.
- **Fast and small.** Measured 2026-09-30: the default run (100 popular videos) took about 6 seconds; the full popular
  board is 10 requests; two requests per video give its whole danmaku pool (9,600 danmaku on a 2.5-hour video);
  1,500 comments of one video took 81 seconds.
- **Low price per row**: from $3.00 per 1,000 videos ([price table](#how-much-does-it-cost-to-scrape-bilibili)).

### What can you use it for?

- **China market and trend research**: what is trending today, which categories and creators dominate, what a week's
  must-watch says about youth culture.
- **Brand and campaign monitoring**: search your brand (in Chinese too: 耐克 for Nike), follow new videos with
  `onlyNew`, read the comments and danmaku of the videos that matter.
- **Influencer (UP主 / KOL) discovery**: find creators by topic, compare followers, likes and engagement, track follower
  growth over time.
- **Content strategy**: which titles, lengths and categories reach the popular board, and how fast views grow there.
- **Datasets for NLP and AI**: Chinese titles, tags, comments and time-coded danmaku.
- **AI agents**: "what is trending on Bilibili in gaming today, and how fast is it growing?" answered from rows.

### Quick start

1. Click **Try for free** (or **Start**) with the default input: the top 100 videos of the popular board with full
   stats. About 6 seconds; **about $0.30 on the Free plan**.
2. Pick a mode (rankings, weekly must-watch, hot searches, search, videos, comments, danmaku, creators) and set `maxItems`.
3. Save the input as a **task** and schedule it (hourly or daily) to build the trend history; export CSV, Excel or JSON.

#### Copy to your AI assistant

Paste this into ChatGPT, Claude or any agent so it knows how to use the Actor:

```
crawlplant/bilibili-trending-history on Apify: Bilibili (哔哩哔哩) data, one row per video / comment / danmaku / hot
search / creator. Input: mode = "popular" (default; the popular board, up to 500 videos) | "ranking" (Top 100 per
rankingCategories: all, animation, chinese-animation, music, dance, gaming, knowledge, tech, sports, cars, life, food,
animals, kichiku, fashion, entertainment, film-tv) | "weekly" (weeklyIssues: "latest", "392", "380-392"; issue 1 =
March 2019) | "mustWatch" (all-time list) | "hotSearches" (top 50) | "search" (searchQueries; searchType videos|creators;
sortBy relevance|views|newest|danmaku|favorites; durationFilter any|under10|10to30|30to60|over60; searchCategory;
publishedAfter/publishedBefore "2026-09-01" or "7 days") | "videos" / "comments" / "danmaku" (videos: BV ids, av numbers
or URLs; commentsSort hot|newest, maxCommentsPerVideo, includeReplies, maxRepliesPerComment (5); maxDanmakuPerVideo) | "creators" (creators: ids or
space.bilibili.com URLs; creatorVideos 0-50). Options: includeDetails (tags, honours, exact counts), minViews,
trackHistory (true), onlyNew, historyKey, maxItems (100).
Video row: board, position, bvid, aid, url, title, description, coverUrl, publishedAt, ageHours, durationSeconds,
duration, category, mainCategory, mainCategoryEn, authorMid, authorName, authorUrl, authorFollowers, views, likes, coins,
favorites, shares, danmaku, comments, statsApproximate, engagementRatePct, likeRatePct, viewsPerHour, highestRank,
recommendReason, publishLocation, tags, honors, rankingCategory, weeklyIssue, weeklyIssueSubject, weeklyStartDate,
weeklyEndDate, searchQuery, firstSeenAt, timesSeen, isNew, previousSeenAt, previousPosition, positionChange (+ = up),
bestPosition, viewsGained, viewsGainedPerHour. Comment row: videoBvid, position, commentId, rootId, isReply, text, likes,
replyCount, publishedAt, authorName, authorMid, authorLevel, isUploader, isPinned, videoCommentsTotal. Danmaku row:
videoBvid, part, videoTimeSeconds, videoTime, text, sentAt, mode, color, fontSize, poolSize. Hot search row: position,
keyword, heatScore, label (new|hot|live|meme), searchUrl + tracking fields, heatChange. Creator row: mid, url, name,
followers, following, videos, likes, level, verifiedTitle, sign, recentVideos, followersGained.
```

### Modes

| Mode | What you get | Typical run |
|---|---|---|
| `popular` (default) | The popular board (综合热门): up to 500 videos in board order, with Bilibili's reason for featuring them | 100 videos in ~6 s |
| `ranking` | Top 100 of each category you pick (排行榜), 17 categories, author followers included | 100 per category, seconds |
| `weekly` | Weekly must-watch issues (每周必看) by number or range, 1 (March 2019) to the latest | ~48 videos per issue, 8 issues in 13 s |
| `mustWatch` | The all-time must-watch list (入站必刷), about 100 videos | seconds |
| `hotSearches` | Top 50 hot searches (热搜) with heat score and badge (new, hot, live, meme) | 50 rows, 1 request |
| `search` | Videos by keyword (sort, length, category, dates) or creators by name | 1,000 per keyword max |
| `videos` | Details of videos by BV id, av number or URL: stats, tags, honours, creator numbers | ~2-3 per second |
| `comments` | Comments of videos, hot or newest first, optionally with replies | 1,500 in ~80 s |
| `danmaku` | Bullet comments (弹幕) with their second in the video and the time sent | whole pool, 2 requests per video |
| `creators` | Creator profiles by id or URL, optionally with their newest uploads | seconds |
| `tracked` | The hourly history of the videos and creators you track (`trackDays`), or of any video given | one row per video or creator |

### Ready-to-use examples

Paste one into the **JSON** tab of the input. Costs are for the Free plan (see [pricing](#how-much-does-it-cost-to-scrape-bilibili)).

**1. Top 100 of the popular board right now (the default, ~$0.30)**

```json
{}
```

**2. The whole popular board with tags and honours (500 videos, ~$2.50)**

```json
{ "maxItems": 500, "includeDetails": true }
```

**3. Hourly monitor: only videos that are new on the popular board since the last run**

```json
{ "mode": "popular", "onlyNew": true, "maxItems": 500, "historyKey": "hourly-popular" }
```

**4. Gaming and knowledge Top 100 (200 videos, ~$0.60)**

```json
{ "mode": "ranking", "rankingCategories": ["gaming", "knowledge"], "maxItems": 200 }
```

**5. Every category's Top 100 (1,700 videos, ~$5.10)**

```json
{ "mode": "ranking", "rankingCategories": ["all", "animation", "chinese-animation", "music", "dance", "gaming", "knowledge", "tech", "sports", "cars", "life", "food", "animals", "kichiku", "fashion", "entertainment", "film-tv"], "maxItems": 1700 }
```

**6. This week's must-watch issue (~$0.15)**

```json
{ "mode": "weekly" }
```

**7. Weekly must-watch history: every issue of the last year (~2,400 videos)**

```json
{ "mode": "weekly", "weeklyIssues": ["341-392"], "maxItems": 3000 }
```

**8. Top 50 hot searches, with rank moves since your last run (~$0.03)**

```json
{ "mode": "hotSearches" }
```

**9. Most-viewed videos about a keyword from the last 30 days**

```json
{ "mode": "search", "searchQueries": ["原神"], "sortBy": "views", "publishedAfter": "30 days", "maxItems": 200 }
```

**10. Brand monitor: newest videos mentioning a brand, only new ones each run**

```json
{ "mode": "search", "searchQueries": ["耐克", "Nike"], "sortBy": "newest", "onlyNew": true, "maxItems": 200 }
```

**11. Find creators (UP主) by topic, with followers and latest uploads**

```json
{ "mode": "search", "searchType": "creators", "searchQueries": ["数码测评"], "maxItems": 50 }
```

**12. Details of specific videos (stats, tags, honours, creator)**

```json
{ "mode": "videos", "videos": ["BV1Gtap6NEPB", "https://www.bilibili.com/video/BV14Baa6JENd"] }
```

**13. 500 hot comments of a video, with replies (~$0.75)**

```json
{ "mode": "comments", "videos": ["BV14Baa6JENd"], "maxCommentsPerVideo": 500, "includeReplies": true, "maxItems": 500 }
```

**14. Newest comments of several videos**

```json
{ "mode": "comments", "videos": ["BV1Gtap6NEPB", "BV14Baa6JENd"], "commentsSort": "newest", "maxCommentsPerVideo": 100, "maxItems": 200 }
```

**15. 2,000 danmaku of a video, spread over its whole length (~$0.60)**

```json
{ "mode": "danmaku", "videos": ["BV1Gtap6NEPB"], "maxDanmakuPerVideo": 2000, "maxItems": 2000 }
```

**16. Creator follower tracker with each creator's 10 newest videos**

```json
{ "mode": "creators", "creators": ["946974", "https://space.bilibili.com/15634833"], "creatorVideos": 10 }
```

**17. The all-time must-watch list**

```json
{ "mode": "mustWatch" }
```

**18. Track three videos hour by hour for 30 days (~$0.90 + $0.015 for the rows)**

```json
{ "mode": "videos", "videos": ["BV1GJ411x7h7", "BV1UGa961Ejt", "https://www.bilibili.com/video/BV1Gtap6NEPB"], "trackDays": 30 }
```

**19. Track competitors' channels for 90 days: followers and every new upload**

```json
{ "mode": "creators", "creators": ["946974", "15634833"], "trackDays": 90 }
```

**20. The history of everything you track, one point per day**

```json
{ "mode": "tracked" }
```

**21. One video's hour-by-hour curve**

```json
{ "mode": "tracked", "videos": ["BV1GJ411x7h7"], "historyResolution": "hourly" }
```

### How to…

#### Get Bilibili trending videos today

Run the default input: the popular board in Bilibili's order, with views, likes, coins, favorites, shares, danmaku,
comments, engagement rate and the featured reason. `maxItems: 500` gives the whole board.

#### Scrape the Bilibili ranking (排行榜) by category

`mode: "ranking"` with `rankingCategories` (gaming, knowledge, tech, music, ...): 100 videos per category, in ranking
order, with the author's follower count.

#### Bilibili weekly must-watch (每周必看) history since 2019

`mode: "weekly"` with `weeklyIssues`: "latest", one number or ranges such as "1-52" (2019) or "341-392" (the last year).
Each row has the issue number, theme, week start and end date and the video's place in the issue. Add
`includeDetails: true` for exact views, likes, coins and favorites (Bilibili shows rounded figures in the issue list).

#### Track Bilibili trends hourly: rank moves and views gained

Save any board as a task and schedule it hourly. From the second run on, each row says `timesSeen`, `previousPosition`,
`positionChange` (+3 = moved up three places), `bestPosition` and `viewsGained` / `viewsGainedPerHour` since the previous
run. `timesSeen` × your schedule interval ≈ how long a video has stayed on the board.

#### Track a Bilibili video's views hour by hour (no schedule needed)

Run `videos` mode with the videos and `trackDays` (1-90, example 18): you get their details now, and our server reads
their views, likes, coins, favorites, shares, comments and danmaku every hour from then on. Any time later, `mode:
"tracked"` (example 20) returns one row per video with `views`, `viewsGained24h`, `viewsGained7d`, `viewsGainedTracked`
and the `history` series (one point a day, or every hour with `historyResolution: "hourly"`). Running `videos` again with
`trackDays` extends the period; only the added days are charged.

#### Track a Bilibili creator's growth and new uploads

`creators` mode with `trackDays` (example 19): followers, video count and likes every hour, and each video the creator
uploads while tracked is read hourly from its first hours. Mode `tracked` gives `followersGained24h`, `followersGained7d`,
`followersGainedTracked`, the `history` series and `newUploads` with their latest views.

#### Bilibili hot search list (热搜) as data

`mode: "hotSearches"`: the top 50 keywords with heat score, badge (new, hot, live, meme) and a search link; scheduled,
each row also gets `heatChange`, `positionChange` and `isNew`.

#### Search Bilibili videos by keyword

`mode: "search"` with `searchQueries`, sorted by relevance, views, newest, danmaku or favorites, filtered by length,
category and publish dates. Keywords in Chinese find the most.

#### Scrape Bilibili comments

`mode: "comments"` with video ids or URLs: hot or newest order, up to `maxCommentsPerVideo`, with `includeReplies` for
the replies under each comment. Each row has likes, reply count, time, author name and level, and whether the uploader wrote it.

#### Download Bilibili danmaku (bullet comments)

`mode: "danmaku"`: each danmaku with the second of the video it appears at (`videoTimeSeconds`), when it was sent, its
text, mode (scroll, top, bottom) and colour. Larger pools are sampled evenly across the video, so peaks stay visible.

#### Track Bilibili creator (UP主) followers

`mode: "creators"` with creator ids or profile URLs, scheduled daily: `followers`, `videos`, `likes` and
`followersGained` since the last run. `creatorVideos` adds their newest uploads.

#### Find Bilibili influencers by keyword

`mode: "search"`, `searchType: "creators"`: creators whose name matches, with followers, number of videos, verification,
bio and their three latest uploads.

### Input options

| Field | Default | What it does |
|---|---|---|
| `mode` | `popular` | Which data to read (table above) |
| `rankingCategories` | `["all"]` | ranking: categories, 100 videos each |
| `weeklyIssues` | `["latest"]` | weekly: "latest", numbers, ranges ("380-392") |
| `searchQueries` | `[]` | search: keywords (maxItems is shared evenly between them) |
| `searchType` | `videos` | search: `videos` or `creators` |
| `sortBy` | `relevance` | search: `relevance`, `views`, `newest`, `danmaku`, `favorites` |
| `durationFilter` | `any` | search: `under10`, `10to30`, `30to60`, `over60` minutes |
| `searchCategory` | `all` | search: one of the ranking categories |
| `publishedAfter` / `publishedBefore` | - | search: `2026-09-01`, ISO time, or `7 days` / `24 hours` |
| `videos` | `[]` | videos, comments, danmaku (and tracked): BV ids, av numbers, URLs |
| `creators` | `[]` | creators (and tracked): ids or space.bilibili.com URLs |
| `commentsSort` | `hot` | comments: `hot` or `newest` |
| `maxCommentsPerVideo` | 100 | comments: per video, replies included |
| `includeReplies` | false | comments: add replies under each comment |
| `maxRepliesPerComment` | 5 | comments with replies: replies per comment (1-20); they count toward `maxCommentsPerVideo` |
| `maxDanmakuPerVideo` | 1000 | danmaku: per video (even sample of larger pools) |
| `creatorVideos` | 0 | creators: newest uploads per creator (0-50) |
| `includeDetails` | false | video modes: tags, honours, exact counts, creator numbers (one extra request per video) |
| `minViews` | 0 | video modes: skip videos with fewer views (not charged) |
| `trackHistory` | true | add first seen, times seen, position and views change since the previous run |
| `onlyNew` | false | return only rows earlier runs of the same board or search did not see |
| `historyKey` | - | keep this task's tracking separate from your other runs |
| `trackDays` | 0 | videos, creators: read them hourly on our server for this many days (1-90); 0 = off |
| `historyResolution` | `daily` | tracked: one point per day, or `hourly` |
| `maxItems` | 100 | total rows per run (also caps the cost) |

### Example output

A popular-board row (4th run of an hourly schedule, trimmed):

```
{
  "recordType": "video",
  "board": "popular",
  "position": 2,
  "bvid": "BV1i4aL6QEYX",
  "url": "https://www.bilibili.com/video/BV1i4aL6QEYX",
  "title": "手绘465张！One Last Kiss【EVA30周年回忆重逢计划】",
  "publishedAt": "2026-09-28T16:49:06.000Z",
  "ageHours": 32,
  "duration": "1:50",
  "category": "绘画",
  "mainCategoryEn": "Art",
  "authorName": "棕与灰9",
  "authorUrl": "https://space.bilibili.com/360861964",
  "views": 1007125,
  "likes": 143790,
  "coins": 49172,
  "favorites": 22663,
  "shares": 4181,
  "danmaku": 427,
  "comments": 1095,
  "engagementRatePct": 21.93,
  "likeRatePct": 14.28,
  "viewsPerHour": 31472.7,
  "highestRank": 14,
  "recommendReason": "13万点赞",
  "publishLocation": "北京",
  "firstSeenAt": "2026-09-30T00:31:20.688Z",
  "timesSeen": 4,
  "isNew": false,
  "previousPosition": 2,
  "positionChange": 0,
  "bestPosition": 2,
  "viewsGained": 1838,
  "scrapedAt": "2026-09-30T00:47:20.394Z",
  "source": "live",
  "store": "bilibili"
}
```

### Output fields

Video rows (`recordType: "video"`):

| Field | Meaning |
|---|---|
| `board`, `position` | Where the row comes from (popular, ranking, weekly, mustWatch, search, video, creator) and its place there |
| `bvid`, `aid`, `url` | Bilibili ids (BV id and av number) and the video link |
| `title`, `description`, `coverUrl` | As published |
| `publishedAt`, `ageHours`, `durationSeconds`, `duration`, `parts` | Upload time (UTC), hours since upload, length, number of parts |
| `category`, `mainCategory`, `mainCategoryEn` | Bilibili's sub-category and main category (Chinese) and the main category in English |
| `authorMid`, `authorName`, `authorUrl`, `authorFollowers` | The creator (followers in rankings, creator videos and with details) |
| `views`, `likes`, `coins`, `favorites`, `shares`, `danmaku`, `comments` | Counts at the time of the run (null when the source list lacks them; `includeDetails` fills them) |
| `statsApproximate` | true when counts are Bilibili's rounded display figures (e.g. 335.1万) |
| `engagementRatePct`, `likeRatePct`, `viewsPerHour` | (likes + coins + favorites + shares + comments) / views; likes / views; views per hour since upload |
| `highestRank` | Best position the video ever reached on Bilibili's all-site ranking |
| `recommendReason` | Why Bilibili features it ("13万点赞", "全体欣赏音乐", the must-watch line) |
| `publishLocation` | The region Bilibili shows under the video (e.g. 北京) |
| `tags`, `honors`, `authorVideos`, `authorLikes`, `authorVerified` | With details: tags, honours ("全站排行榜最高第1名", "热门收录"), creator's video count, likes, verification |
| `rankingCategory`, `weeklyIssue`, `weeklyIssueSubject`, `weeklyStartDate`, `weeklyEndDate`, `searchQuery` | Board context |
| `firstSeenAt`, `timesSeen`, `isNew`, `previousSeenAt`, `previousPosition`, `positionChange`, `bestPosition` | Trend tracking (null when off; `isNew` is null in the first tracked run) |
| `viewsGained`, `viewsGainedPerHour` | Views gained since the previous run that saw the video |
| `boardHistory`, `hoursOnPopular` | From our hourly board snapshots: each board the video was on (popular, `ranking:<category>`) with first and last time seen, hours there and best position; hours on the popular board |
| `scrapedAt`, `source`, `store` | When it was read, `live`, `bilibili` |

Comment rows: `videoBvid`, `videoUrl`, `position`, `sort`, `commentId`, `rootId` / `parentId` (for replies), `isReply`,
`text`, `likes`, `replyCount`, `publishedAt`, `authorMid`, `authorName`, `authorLevel`, `isUploader`, `isPinned`,
`videoCommentsTotal`. Danmaku rows: `videoBvid`, `cid`, `part`, `danmakuId`, `videoTimeSeconds`, `videoTime`, `text`,
`sentAt`, `mode`, `fontSize`, `color`, `pool`, `poolSize`. Hot search rows: `position`, `keyword`, `displayName`,
`heatScore`, `label`, `iconUrl`, `searchUrl`, the tracking fields and `heatChange`. Creator rows: `mid`, `url`, `name`,
`sign`, `avatarUrl`, `level`, `followers`, `following`, `videos`, `likes`, `verifiedTitle`, `verifiedType`, `isLive`,
`liveRoomUrl`, `recentVideos`, `position`, `searchQuery`, `firstSeenAt`, `previousSeenAt`, `followersGained`.

Tracked rows (mode `tracked`): `recordType: "trackedVideo"` with `bvid`, `url`, `title`, `authorName`, `publishedAt`,
`trackedSince`, `trackedUntil`, `trackingActive`, `unavailable` (deleted or private since), `statsAt` and the latest
`views`, `likes`, `coins`, `favorites`, `shares`, `comments`, `danmaku`, `viewsGained24h`, `viewsGained7d`,
`viewsGainedTracked`, `likesGainedTracked`, `points`, `history` (`at` + the seven counts) and `boardHistory`;
`recordType: "trackedCreator"` with `mid`, `url`, `name`, the tracking window, `followers`, `videos`, `likes`,
`followersGained24h`, `followersGained7d`, `followersGainedTracked`, `newUploads` and `history`.

### Alerts and scheduling

- **Trending tracker**: schedule example 1 or 3 every hour; send new rows to Google Sheets, Slack or e-mail with an Apify
  integration. Filter on `isNew` or `positionChange` for alerts.
- **Daily category report**: example 4 or 5 every morning (China time) for the day's Top 100s.
- **Weekly digest**: example 6 every Friday after 18:00 China time (10:00 UTC), when the new must-watch issue is out.
- **Brand watch**: example 10 every few hours; only new videos come back, so each run costs only what is new.
- **Webhooks**: add a webhook on "run succeeded" to push the dataset into your own system.

### Run it through the API

JavaScript:

```js
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('crawlplant/bilibili-trending-history').call({ mode: 'ranking', rankingCategories: ['gaming'] });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
for (const v of items) console.log(v.position, v.title, v.views, v.positionChange);
```

Python:

```python
from apify_client import ApifyClient
client = ApifyClient("<APIFY_TOKEN>")
run = client.actor("crawlplant/bilibili-trending-history").call(run_input={"mode": "hotSearches"})
for h in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(h["position"], h["keyword"], h["heatScore"], h["isNew"])
```

### Use with AI agents

Add the Actor as a tool through Apify's MCP server: `https://mcp.apify.com?tools=crawlplant/bilibili-trending-history`.
An agent can ask for today's popular board, a category's Top 100, the hot searches, a keyword search or one video's
comments, and read flat fields (numbers, ISO dates, English category names) straight from the rows. Chinese titles,
tags and comments are kept as published, ready for an LLM to translate or summarise.

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

Pay per row: platform usage is included.

| Event | Free plan | Starter | Scale | Business and up |
|---|---|---|---|---|
| Video row (per 1,000) | $3.00 | $2.70 | $2.40 | $2.10 |
| Video row with details (`includeDetails`, `videos` mode; per 1,000) | $5.00 | $4.50 | $4.00 | $3.50 |
| Creator row (per 1,000) | $3.00 | $2.70 | $2.40 | $2.10 |
| Comment row (per 1,000) | $1.50 | $1.35 | $1.20 | $1.05 |
| Hot search row (per 1,000) | $0.50 | $0.45 | $0.40 | $0.35 |
| Danmaku row (per 1,000) | $0.30 | $0.27 | $0.24 | $0.21 |
| Tracking day: one video or creator read hourly for a day (`trackDays`) | $0.01 | $0.009 | $0.008 | $0.007 |
| Tracked history row (mode `tracked`; per 1,000) | $5.00 | $4.50 | $4.00 | $3.50 |
| Actor start (per run) | $0.00005 | $0.00005 | $0.00005 | $0.00005 |

Each row is charged once, at its row price. Rows removed by `minViews` or `onlyNew` are not charged. Tracking days are
charged when a run starts or extends tracking, and only for days not already paid for.

| Example on the Free plan | Rows | Cost |
|---|---|---|
| Default run: top 100 of the popular board | 100 | ~$0.30 |
| The whole popular board with details | 500 | ~$2.50 |
| Hourly hot searches for a month | 36,000 | ~$18 |
| Top 100 of every category | 1,700 | ~$5.10 |
| One year of weekly must-watch issues | ~2,400 | ~$7.20 |
| 500 comments of a video | 500 | ~$0.75 |
| 2,000 danmaku of a video | 2,000 | ~$0.60 |
| Track 10 videos hour by hour for 30 days | 300 tracking days | ~$3.00 |
| Read their history (10 rows) | 10 | ~$0.05 |

Set a **maximum cost per run** in the run options to stop a large run at your budget.

Other Bilibili Actors on the Apify Store, Free-plan prices read from the Store on 2026-09-30:

| Actor | Users (30 days) | Price |
|---|---|---|
| zhorex/bilibili-scraper | 511 | $20.00 / 1,000 rows + $0.05 per danmaku profile + $0.00005 per run |
| socialdatax/socialdatax-bilibili-data-api | 95 | $2.99 / 1,000 rows + $0.00005 per run |
| lofomachines/bilibili-scraper | 49 | $4.50 / 1,000 rows + $0.00005 per run |
| atomus/bilibili-scraper | 35 | $10 / 1,000 videos, $20 details, $8 comments, $10 danmaku, $8 trends, $12 profiles |
| automation-lab/bilibili-scraper | 16 | $0.08 / 1,000 results + $0.005 per run |
| silentflow/bilibili-scraper | new | $5 / 1,000 videos, $1.50 comments, $0.10 danmaku, $4 creators |
| **This Actor** | new | $3.00 / 1,000 videos, $5.00 with details, $1.50 comments, $0.30 danmaku |

### Reliability

- Every request that fails is retried, and a refused address is replaced by another route; the run goes on with what it
  has and never fails because one page or one video could not be read.
- The run always finishes: it stops starting new requests shortly before the time limit and saves what it has.
- Every run writes a summary to the key-value store (`OUTPUT`): rows saved, requests, data read, warnings (a page that
  could not be read, ids not understood, videos not found) and the events charged.
- Each record is checked against the output schema before it is saved; a malformed one is skipped and counted.

### Data freshness

Every run reads Bilibili at that moment. The popular board and rankings update through the day, hot searches every few
minutes, the weekly must-watch every Friday at 18:00 China time. Counts (views, likes...) are Bilibili's current
figures, which it refreshes every few minutes. Trend fields compare with your own previous run of the same board.
Tracked videos and creators and the board snapshots are read by our server every hour; a new subscription gets its first
reading within the hour.

### Troubleshooting

- **Fewer rows than expected**: `maxItems` defaults to 100; with several search keywords it is shared between them.
  `minViews` and `onlyNew` remove rows before they are counted.
- **`isNew` is null / `viewsGained` is empty**: the first tracked run of a board has nothing to compare with; the second
  run fills them. Different tasks share the history of a board unless you set `historyKey`.
- **`coins` or `shares` are null**: rankings and search lists don't include them; `includeDetails: true` reads them.
- **`statsApproximate: true`**: the counts are Bilibili's rounded display figures; `includeDetails: true` gives exact ones.
- **A video is "not found"**: deleted, private, or not shown in every region.
- **A search returns few videos**: try the Chinese keyword, a wider date range or no category.
- **b23.tv links**: open them in a browser and paste the full bilibili.com URL.

### FAQ

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

About $0.30 for the default run of 100 trending videos; $3.00 per 1,000 videos, $1.50 per 1,000 comments, $0.30 per
1,000 danmaku. See [the price table](#how-much-does-it-cost-to-scrape-bilibili).

#### Is there a Bilibili API?

Bilibili has no open API for developers outside China. This Actor gives the same public data as clean JSON, CSV or Excel,
through Apify's API, with no key or account at Bilibili.

#### How do I see how long a video stayed trending?

Every video row has `hoursOnPopular` and `boardHistory`: the hours it has spent on the popular board and each category
ranking in our hourly snapshots, when it entered and left, and its best position. No schedule needed. Your own schedule
adds `timesSeen`, `firstSeenAt` and `bestPosition` per board as your runs saw them.

#### How far back does the history go?

The weekly must-watch archive goes back to issue 1 (March 2019). Our server has snapshotted the popular board, the 17
rankings and the hot searches every hour since October 2026; a tracked video or creator has its series from the hour
you start tracking it (and earlier hours if it was on the popular board). Your own board tracking keeps rows seen in the
last 14 days.

#### Can I get comments and danmaku of trending videos?

Yes: run a board, take the `bvid` values and run `comments` or `danmaku` mode with them (or chain two tasks with a webhook).

#### Does it translate titles?

Titles, tags and comments stay in the original Chinese; category names also come in English (`mainCategoryEn`).

#### Is it legal to scrape Bilibili?

The Actor reads public pages without logging in, at a polite pace. Comments and profiles contain personal data (user
names, ids, texts): collect only what you need and check data protection law (GDPR, China's PIPL, CCPA) and Bilibili's
terms for your use case.

### Limits

- Popular board: 500 videos. Rankings: 100 per category. Search: 1,000 results per keyword and filter combination.
- Comments: 20 per request, `maxCommentsPerVideo` up to 5,000 (1,500 measured in one run); replies: up to 20 under each
  comment.
- Danmaku: the pool Bilibili keeps for each video part (from about 1,000 to 8,000+).
- Creator uploads: the 50 newest per creator.
- Trend history keeps rows seen in the last 14 days, up to 20,000 per board.
- Tracking: up to 200 videos and creators per account at a time, up to 90 days per run (a later run extends it); mode
  `tracked` returns the last 90 days of each series.

### Privacy

Video and creator data is what Bilibili shows publicly. Comment rows include commenters' public names, ids and texts;
danmaku rows leave out the sender entirely. The trend history is stored only in your own Apify account (key-value store
`bilibili-trending-history`: video ids, keywords, positions and counts, no texts). Videos and creators you track with
`trackDays` are kept on our server with a one-way hash of your Apify account id (so mode `tracked` can list them), never
the id itself; their public counts are shared data, the same series for everyone who reads them. Each run sends the developer anonymous
feature-usage statistics (the mode and which options were used, never your keywords, videos or creators); your Apify
account id is replaced by a one-way hash on arrival.

# Actor input Schema

## `mode` (type: `string`):

popular = the popular board (综合热门, up to 500 videos, what Bilibili promotes right now); ranking = Top 100 per category (排行榜); weekly = weekly must-watch issues (每周必看, every issue since March 2019); mustWatch = the all-time must-watch list (入站必刷, ~100 videos); hotSearches = the top 50 hot searches (热搜); search = videos or creators by keyword; videos = details of videos by id or URL; comments = comments of videos; danmaku = bullet comments (弹幕) of videos; creators = creator profiles by id or URL; tracked = the hour-by-hour history of the videos and creators you track (trackDays).

## `rankingCategories` (type: `array`):

ranking mode: which Top 100 lists to read, 100 videos each. all = the all-site ranking.

## `weeklyIssues` (type: `array`):

weekly mode: latest, an issue number (392) or a range (380-392). Issue 1 is from March 2019; a new issue comes out every Friday evening (China time). About 40-50 videos per issue.

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

search mode: one or more keywords, in Chinese or English (Chinese finds more: 耐克 rather than Nike). Up to 1,000 results per keyword; maxItems is shared evenly between keywords.

## `searchType` (type: `string`):

search mode: videos, or creators (UP主) whose name matches, with followers, video count and their latest uploads.

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

search mode (videos): Bilibili's own sorts. relevance = its default ranking; views = most played; newest = newest uploads first; danmaku = most danmaku; favorites = most saved.

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

search mode (videos): only videos of this length.

## `searchCategory` (type: `string`):

search mode (videos): only videos of this category (the same categories as the rankings).

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

search mode (videos): only videos published on or after this date. 2026-09-01, an ISO time, or relative: 7 days, 24 hours.

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

search mode (videos): only videos published on or before this date (a date includes the whole day). Same formats as Published after.

## `videos` (type: `array`):

videos, comments and danmaku modes: BV ids (BV1Gtap6NEPB), av numbers (av80433022) or video URLs (bilibili.com/video/..., m.bilibili.com). Open b23.tv short links in a browser and paste the full URL.

## `creators` (type: `array`):

creators mode: creator ids (the number in space.bilibili.com/546195) or profile URLs.

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

comments mode: hot = Bilibili's own hot order (popular comments first, the pinned comment on top); newest = newest first.

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

comments mode: stop after this many comments per video (replies included when Include replies is on). 20 per request.

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

comments mode: after each comment, add its replies (oldest first, up to maxRepliesPerComment), marked isReply with the comment id in rootId.

## `maxRepliesPerComment` (type: `integer`):

comments mode with includeReplies: replies added under each comment (1-20). Replies count toward maxCommentsPerVideo, so a small number leaves room for more comments.

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

danmaku mode: Bilibili keeps a pool of up to 1,000-8,000+ danmaku per video part. When the pool is larger than this, the rows are an even sample across the whole video timeline (poolSize says how many there were).

## `creatorVideos` (type: `integer`):

creators mode: also return each creator's newest uploads as video rows (0-50).

## `includeDetails` (type: `boolean`):

popular, ranking, weekly, mustWatch, search and creator videos: read each video's page too, for tags, honours (e.g. 全站排行榜最高第1名), coins and shares where the list lacks them, exact weekly counts, and the creator's followers and video count. One extra request per video, priced as a detailed video row.

## `minViews` (type: `integer`):

Video modes: only videos with at least this many views (applied before rows are saved and charged). 0 = all.

## `trackHistory` (type: `boolean`):

Remember what earlier runs saw (popular board, each ranking, hot searches, each search, each creator's uploads, videos and creators by id) and add to each row: firstSeenAt, timesSeen, isNew, previousPosition, positionChange, bestPosition, and views gained (followers gained, heat change) since the previous run. Kept in a key-value store named bilibili-trending-history in your own account. Schedule the run (e.g. hourly) to build the history.

## `onlyNew` (type: `boolean`):

Return only videos, hot searches and search results that earlier runs of the same board or search did not see: a feed of what is newly trending. The first run returns everything.

## `historyKey` (type: `string`):

Optional: a name that keeps this task's tracking apart from your other runs of the same board (e.g. hourly-popular vs daily-popular). Empty = shared per board or search.

## `trackDays` (type: `integer`):

videos and creators modes: keep reading these videos and creators every hour on our server for this many days, also while this Actor is not running (views, likes, coins, favorites, shares, comments and danmaku of each video; followers, videos, likes and new uploads of each creator). Run mode tracked any time later for the curves. Charged per video or creator and day (tracking-day); running it again extends the period and charges only the added days. 0 = off.

## `historyResolution` (type: `string`):

tracked mode: one point per day (the day's last reading) or every hourly reading.

## `maxItems` (type: `integer`):

Stop after this many rows in total (after filters). Every row is charged, so this also caps the cost.

## Actor input object example

```json
{
  "mode": "popular",
  "rankingCategories": [
    "all"
  ],
  "weeklyIssues": [
    "latest"
  ],
  "searchQueries": [
    "原神"
  ],
  "searchType": "videos",
  "sortBy": "relevance",
  "durationFilter": "any",
  "searchCategory": "all",
  "videos": [
    "BV1Gtap6NEPB"
  ],
  "creators": [
    "946974"
  ],
  "commentsSort": "hot",
  "maxCommentsPerVideo": 100,
  "includeReplies": false,
  "maxRepliesPerComment": 5,
  "maxDanmakuPerVideo": 1000,
  "creatorVideos": 0,
  "includeDetails": false,
  "minViews": 0,
  "trackHistory": true,
  "onlyNew": false,
  "trackDays": 0,
  "historyResolution": "daily",
  "maxItems": 100
}
```

# Actor output Schema

## `results` (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 = {
    "searchQueries": [
        "原神"
    ],
    "videos": [
        "BV1Gtap6NEPB"
    ],
    "creators": [
        "946974"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlplant/bilibili-trending-history").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": ["原神"],
    "videos": ["BV1Gtap6NEPB"],
    "creators": ["946974"],
}

# Run the Actor and wait for it to finish
run = client.actor("crawlplant/bilibili-trending-history").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": [
    "原神"
  ],
  "videos": [
    "BV1Gtap6NEPB"
  ],
  "creators": [
    "946974"
  ]
}' |
apify call crawlplant/bilibili-trending-history --silent --output-dataset

```

## MCP server setup

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

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/diCnWBjdgDzQlSihU/builds/MgxX6fBN408IvRsgR/openapi.json
