Bilibili APIspace.bilibili.com ↗
Fetch paginated video feeds from any Bilibili user channel. Returns titles, view counts, danmaku counts, thumbnails, durations, and category breakdowns.
What is the Bilibili API?
The Bilibili Channel Videos API exposes a single endpoint, get_channel_videos, that returns up to 50 videos per page from any Bilibili user space, with 10 response fields per video including bvid, play_count, danmaku_count, duration, and created timestamp. You can filter by category using tid values returned in the same response, sort by publish date or popularity, and search by keyword within a channel — all by specifying a channel's numeric mid.
curl -X GET 'https://api.parse.bot/scraper/e2c6ce2c-d987-4efe-9785-ce57978ea8ab/get_channel_videos?mid=261168118&order=pubdate' \ -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 space-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 Channel Videos API — browse a creator's uploads."""
from parse_apis.space_bilibili_com_api import Bilibili, VideoOrder, InputFormatInvalid
client = Bilibili()
# Paginate through the most-viewed videos for a channel, capped at 5 total.
for video in client.videos.list(mid="261168118", order=VideoOrder.CLICK, limit=5):
print(video.title, f"▶ {video.play_count}", video.duration)
# Drill into the first result from a keyword search.
hit = client.videos.list(mid="261168118", keyword="旅游", limit=1).first()
if hit is not None:
print(hit.bvid, hit.title, hit.comment_count, "comments")
# Fetch the full feed page to access category breakdown and pagination info.
try:
feed = client.video_feeds.get(mid="261168118", page_size=5)
except InputFormatInvalid:
print("Invalid channel ID format")
else:
print(f"Total videos: {feed.page.total}, this page: {feed.page.current}")
for tid, cat in feed.categories.items():
print(f" {cat.name}: {cat.count} videos")
print("exercised: videos.list / video_feeds.get / VideoOrder / InputFormatInvalid")
Fetches the paginated video list for a Bilibili channel (user space). Returns video metadata including title, description, thumbnail, duration, view/comment/danmaku counts, and publish timestamp. Also returns the channel's video category breakdown. Sorted by publish date by default; supports sorting by play count or favorites. Each call makes up to 8 upstream requests (session warmup + signed API call with one retry). Pagination is caller-controlled via page and page_size; total video count is returned in the response.
| Param | Type | Description |
|---|---|---|
| midrequired | string | Bilibili user/channel numeric ID (e.g. '261168118'). |
| tid | string | Category/type ID to filter videos. Use '0' for all categories. Category IDs are returned in the categories field of the response. |
| page | integer | Page number for pagination (1-indexed). |
| order | string | Sort order for videos. Omitted defaults to pubdate (newest first). |
| keyword | string | Search keyword to filter videos within this channel. Omitted returns all videos. |
| page_size | integer | Number of videos per page (1-50). |
{
"type": "object",
"fields": {
"page": "object with current page number, page_size, and total video count",
"videos": "array of video objects with bvid, aid, title, description, thumbnail, duration, play_count, comment_count, danmaku_count, created, author, mid, type_id, is_union_video",
"categories": "object mapping category tid to name and video count for this channel"
},
"sample": {
"data": {
"page": {
"total": 187,
"current": 1,
"page_size": 5
},
"videos": [
{
"aid": 117002676996042,
"mid": 261168118,
"bvid": "BV1wp326PEQH",
"title": "不到30岁就裸辞,现在后悔了吗?探访年薪10-90万职场女性",
"author": "Jane Doe",
"created": 1785320504,
"type_id": 209,
"duration": "27:11",
"thumbnail": "http://i2.hdslb.com/bfs/archive/02c730a2578d002ada1735e6bf20f712f0c282e2.jpg",
"play_count": 144831,
"description": "你会放弃一份年薪50万的工作吗?",
"comment_count": 323,
"danmaku_count": 444,
"is_union_video": false
}
],
"categories": {
"36": {
"tid": 36,
"name": "知识",
"count": 6
},
"160": {
"tid": 160,
"name": "生活",
"count": 173
}
}
},
"status": "success"
}
}About the Bilibili API
What the endpoint returns
get_channel_videos accepts a Bilibili user's numeric mid and returns a paginated list of their uploaded videos. Each video object includes identifiers (bvid, aid), display fields (title, description, thumbnail), engagement metrics (play_count, comment_count, danmaku_count), playback info (duration), and a Unix created timestamp. The response also includes a page object with the current page number, page size, and total video count across the channel.
Filtering and sorting
The tid parameter filters videos to a specific category. Valid category IDs for a given channel are returned in the categories field of every response — a mapping of tid to category name and video count — so you can enumerate available categories before filtering. Pass tid=0 to retrieve all categories. The order parameter controls sort order (defaulting to newest-first by publish date), and keyword filters results to videos whose metadata matches a search term within the channel.
Pagination
Results are paginated via the page and page_size parameters. page is 1-indexed, and page_size accepts values from 1 to 50. The page.total field in the response tells you the total number of videos, so you can calculate how many pages exist for a given channel and category combination before walking through them.
The Bilibili API is a managed, monitored endpoint for space.bilibili.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when space.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 space.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 a creator's upload history by paginating all videos sorted by
createdtimestamp. - Build a category-aware video browser using the
categoriesmap returned per channel. - Monitor engagement trends by polling
play_count,comment_count, anddanmaku_countover time. - Index channel thumbnails and titles for a Bilibili content discovery or recommendation feed.
- Search within a specific creator's uploads using the
keywordparameter to surface relevant clips. - Compare video output across channels by collecting
page.totalfrom multiplemidvalues. - Filter a prolific channel's content to a single content type by passing category
tidvalues.
| 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?+
How do I find the right `tid` value to filter a channel by category?+
get_channel_videos includes a categories field that maps each tid integer to a category name and the count of videos in that category for the requested channel. Call the endpoint once with tid=0 (all categories) to retrieve this map, then re-call with the specific tid you want.Does the API return private or members-only videos on a channel?+
Does the API return channel subscriber counts, channel-level bios, or live stream data?+
What is the maximum number of videos I can retrieve per request?+
page_size parameter accepts a maximum value of 50. To retrieve more videos, increment the page parameter and continue paginating. The page.total field in the response tells you the total number of videos available for the current filter, so you can determine upfront how many requests are needed.