Bilibili APIbilibili.com ↗
Fetch trending Bilibili videos with metadata including title, view count, duration, uploader info, and upload date via a single paginated endpoint.
What is the Bilibili API?
The Bilibili API provides access to trending video listings from bilibili.com through a single get_popular_videos endpoint, returning up to 20 videos per page with 10 distinct fields per video — including view counts, comment counts, duration, uploader details, and both canonical and short-form URLs. It covers the popular/trending feed and supports pagination to walk through the full rankings list.
curl -X GET 'https://api.parse.bot/scraper/1ec49d42-c5e3-4f48-bc10-1be2b9a4afbb/get_popular_videos?page=1&page_size=5' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace bilibili-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
from parse_apis.bilibili_popular_videos_api import Bilibili
bilibili = Bilibili()
for video in bilibili.videos.list(page_size=10, limit=5):
print(video.title, video.bvid)
print(video.uploader.name, video.uploader.mid)
print(video.stats.views, video.stats.likes, video.stats.comments)
print(video.category, video.duration, video.url)
Get popular/trending videos from Bilibili with full metadata including title, URL, view count, comments, duration, uploader info, and upload date. Returns a paginated list ordered by trending rank. Each page contains up to 20 videos. The upstream API returns a fixed pool of ~100 trending videos; pages beyond the pool return empty.
| Param | Type | Description |
|---|---|---|
| page | integer | Page number (starts from 1). |
| page_size | integer | Number of videos per page (1-20, capped at 20). |
{
"type": "object",
"fields": {
"page": "integer, current page number",
"count": "integer, number of videos returned on this page",
"videos": "array of Video objects with metadata, uploader info, and engagement stats",
"page_size": "integer, number of videos requested per page"
},
"sample": {
"data": {
"page": 1,
"count": 5,
"videos": [
{
"aid": 116720383625056,
"url": "https://www.bilibili.com/video/BV1HAEm6HEox",
"bvid": "BV1HAEm6HEox",
"stats": {
"coins": 7167,
"likes": 28778,
"views": 534909,
"shares": 877,
"danmaku": 2569,
"comments": 2216,
"favorites": 3228
},
"title": "小米 VS 大G VS 911",
"category": "汽车生活",
"duration": "18:05",
"uploader": {
"mid": 25150941,
"name": "John Doe",
"avatar": "http://i0.hdslb.com/bfs/face/e9035c3a7089ce7e11d72cb0cf15fa92064b14ef.jpg"
},
"short_url": "https://b23.tv/BV1HAEm6HEox",
"thumbnail": "http://i1.hdslb.com/bfs/archive/d7d8ba8c68eb137b7b9d648d40a60c142f5ea89f.jpg",
"description": "",
"upload_date": "2026-06-10 03:00:00",
"duration_seconds": 1085,
"recommendation_reason": ""
}
],
"page_size": 5
},
"status": "success"
}
}About the Bilibili API
What the API Returns
The get_popular_videos endpoint returns the current popular/trending video feed from Bilibili. Each response includes a videos array along with top-level pagination fields: page, page_size, and count. Individual video objects carry both Bilibili identifier formats — aid (the legacy numeric ID) and bvid (the current alphanumeric ID) — so downstream systems can reference videos in whichever format their integration requires.
Video Metadata Fields
Each video object exposes title, description, url, short_url, and thumbnail for content display or deduplication. Timing data is available in two forms: duration_seconds (integer, machine-readable) and duration (human-formatted string). The upload_date field records when the video was published. Uploader information is included within the video object, allowing you to track which creators appear most frequently in the trending feed.
Engagement and Popularity Signals
View count and comment count are returned per video, giving a direct signal of audience engagement for each trending entry. These figures reflect the state of the trending feed at the time of the request. Since Bilibili's popular feed refreshes continuously, polling the endpoint at regular intervals is the standard pattern for monitoring shifts in ranking or detecting newly viral content.
Pagination
The page parameter accepts an integer starting from 1, and page_size accepts values between 1 and 20 (capped at 20). Use these to page through the full popular list. The count field in each response confirms how many videos were returned for the current page, which is useful for detecting the end of the feed.
The Bilibili API is a managed, monitored endpoint for bilibili.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when bilibili.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official bilibili.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Track which video categories and topics dominate Bilibili's trending feed over time using
titleanddescriptionfields. - Monitor emerging creators by watching for new uploaders appearing in trending results via the uploader info fields.
- Build a Bilibili trend dashboard that polls the popular feed and stores
view_countandcomment_counttime series perbvid. - Seed a content recommendation engine with the current top 20 trending videos using
thumbnail,title, andurl. - Detect viral content early by comparing
upload_dateagainst ranking position for recently uploaded videos. - Aggregate trending video metadata for research into platform popularity patterns across different time windows.
- Cross-reference
bvididentifiers with external datasets to enrich Bilibili trending data with additional signals.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does Bilibili have an official developer API?+
What does `get_popular_videos` return beyond basic titles and URLs?+
aid and bvid identifiers, title, description, url, short_url, thumbnail, duration_seconds, duration, upload_date, uploader info, view count, and comment count. The dual-identifier format means you can reference videos using either the legacy numeric ID or the current alphanumeric BV ID.