Bilibili APIt.bilibili.com ↗
Access Bilibili trending searches, popular videos, and category rankings via 3 API endpoints. Get heat scores, engagement stats, and ranked video metadata.
What is the Bilibili API?
This API provides 3 endpoints covering trending search keywords, popular videos, and category-based video rankings on Bilibili, China's largest video-sharing platform. The get_trending_searches endpoint returns real-time keyword objects including heat_score and display names. get_popular_videos supports pagination to page through editorially ranked content, while get_ranking covers up to 100 top videos across categories like animation, music, gaming, and entertainment.
curl -X GET 'https://api.parse.bot/scraper/4ef30c47-7997-40e7-9ff5-4eef68ec61ac/get_trending_searches?limit=10' \ -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 t-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.
"""Walkthrough: Bilibili Trends API — trending searches, popular videos, rankings."""
from parse_apis.t_bilibili_com_api import Bilibili, CategoryId, CategoryNotFound
client = Bilibili()
# Get current trending/hot search keywords
for keyword in client.trending_searches.get(limit=5):
print(keyword.show_name, keyword.heat_score)
# Browse popular videos (auto-paginated)
video = client.populars.list(limit=1).first()
if video:
print(video.title, video.stat.view, video.owner.name)
# Get ranking for a specific category using typed enum
try:
for v in client.rankings.get(category_id=CategoryId.GAMING, limit=3):
print(v.title, v.bvid, v.stat.like)
except CategoryNotFound as exc:
print(f"Category error: {exc}")
print("exercised: trending_searches.get / populars.list / rankings.get")
Retrieves the current hot/trending search keywords on Bilibili. Each keyword includes a display name, optional icon, and a heat score indicating relative popularity. Results are ordered by popularity descending.
| Param | Type | Description |
|---|---|---|
| limit | integer | Maximum number of trending keywords to return. |
{
"type": "object",
"fields": {
"items": "array of trending keyword objects with keyword, show_name, icon, heat_score",
"title": "string"
},
"sample": {
"data": {
"items": [
{
"icon": "http://i0.hdslb.com/bfs/activity-plat/static/20221118/eaf2dd702d7cc14d8d9511190245d057/UF7B1wVKT2.png",
"keyword": "王冰冰解读世界杯",
"show_name": "王冰冰解读世界杯",
"heat_score": 12234418
}
],
"title": "bilibili热搜"
},
"status": "success"
}
}About the Bilibili API
Trending Searches
The get_trending_searches endpoint returns the current hot search keywords on Bilibili, ordered by popularity descending. Each object in the items array includes a keyword (the raw search term), show_name (the display label), an optional icon URL, and a heat_score indicating relative search volume. An optional limit parameter controls how many keywords are returned. The top-level title field reflects the label Bilibili applies to the trending section.
Popular Videos
The get_popular_videos endpoint returns the current editorially and algorithmically recommended videos on Bilibili. Each entry in the videos array includes video metadata (title, cover, duration, BV ID), owner information, and engagement statistics such as view count, danmaku count, and likes. Pagination is controlled via page (1-based) and page_size (1–50). The no_more boolean signals when you've reached the end of available results.
Video Rankings by Category
The get_ranking endpoint exposes Bilibili's video leaderboard for a given content category. Pass a category_id to target a specific vertical: 0 returns the all-site ranking, while IDs like 1 (animation), 3 (music), 4 (gaming), and 5 (entertainment) scope results to those genres. Up to 100 videos are returned per call. The note field describes the ranking criteria Bilibili applies — typically a combination of content quality signals and recent engagement. Rankings refresh dynamically as new content accumulates engagement.
The Bilibili API is a managed, monitored endpoint for t.bilibili.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when t.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 t.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 real-time trending topics on Bilibili to identify emerging content themes using
heat_scorevalues fromget_trending_searches. - Build a Bilibili content monitor that alerts when specific keywords enter the trending list.
- Aggregate popular video metadata for competitive benchmarking of Chinese video content performance.
- Pull the top 100 gaming videos from
get_rankingwithcategory_id=4to analyze what drives engagement in that category. - Feed ranked music video data into a playlist generator or music trend tracker using the
category_id=3ranking endpoint. - Paginate through
get_popular_videosto build a dataset of recommended content for machine learning or recommendation research. - Monitor shifts in Bilibili's animation category rankings over time to spot rising creators or franchises.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 200 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
| Team | $300/mo | 20,000 | 300 req/min |
| Company | $1,000/mo | 100,000 | 500 req/min |
Each endpoint has a fixed posted price per successful call — most fall between 1 and 10 credits — shown on this API's page before you run it. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does Bilibili have an official developer API?+
What does the `get_ranking` endpoint return, and which categories are available?+
note string describing the ranking criteria. Known category_id values are 0 (all), 1 (animation), 3 (music), 4 (gaming), and 5 (entertainment). Each video object includes metadata, owner details, and engagement statistics.Does `get_trending_searches` return historical trending data or search volume timeseries?+
heat_score for relative popularity at that moment, but no historical snapshots or time-series data are available from this endpoint. You can fork the API on Parse and revise it to add a scheduled polling layer that stores historical snapshots.Does the API cover user profiles, channel data, or individual video comments?+
Is there a pagination limit on `get_popular_videos`?+
page_size parameter accepts values from 1 to 50 per page. The no_more boolean in each response indicates whether additional pages exist. There is no documented hard cap on total pages, but content availability is determined by Bilibili's current popular feed at the time of the request.