Bilibili API

Get Bilibili data as clean JSON with one key: 15 endpoints, 1 to 3 credits per call, the same response shape as every other platform.

What you get#

Onekey exposes Bilibili as 15 endpoints behind one API key: 6 endpoints return one record (data is an object) and 9 endpoints return a list (data is an array). Every answer uses the same envelope (success, data, metadata, error), the cost is reported in metadata.credits_charged, and fields are mapped onto the unified schema so the code you write for Bilibili also works for the rest of the video & streaming category.

Endpoints#

EndpointWhat it doesParametersCreditsStatus
commentsTop-level comments on a Bilibili video (by aid).aid*, page3stable may need a pack
hot_searchBilibili trending search keywords.-3stable may need a pack
live_roomBilibili live room info: title, viewers, live status, area.room_id*1stable may need a pack
live_streamerBilibili live streamer profile (by uid).mid*1stable may need a pack
popularBilibili popular (hot) videos right now.-3stable may need a pack
rankingBilibili all-site ranking (3-day) of videos.-3stable may need a pack
relatedVideos related to a Bilibili video (by bvid).bvid*3stable may need a pack
search_usersSearch Bilibili users by keyword.q*3stable may need a pack
search_videosSearch Bilibili videos by keyword.q*, page3stable may need a pack
userBilibili user card: name, sign, followers, level, uploads, total likes.mid*1stable may need a pack
user_countsCounts of a Bilibili user's videos, bangumi, channels and articles.mid*1stable may need a pack
user_statsBilibili follower / following counts for a user.mid*1stable may need a pack
videoBilibili video details (view endpoint) by bvid.bvid*1beta may need a pack
video_pagesParts (pages) of a Bilibili video: part titles and durations.bvid*3stable may need a pack
video_tagsTags of a Bilibili video (by aid).aid*3stable may need a pack

A * marks a required parameter. Each endpoint name links to its reference page with the full parameter table, caching window and a recorded response.

Make a request#

This calls bilibili.live_room (1 credit, stable). Replace YOUR_API_KEY with your key; sign up, no card. 1,000 free credits cover the open-platform endpoints. Hard-to-reach platforms (X, TikTok, Instagram, Reddit, and others marked on their page) need a verified email and a purchased pack.

curl "https://api.onekey.dev/v1/bilibili/live_room?room_id=23058" \
  -H "x-api-key: YOUR_API_KEY"

Fields you get back#

These unified fields come back from Bilibili, with the same names as on every other platform. The count is how many of its 15 mapped endpoints return the field; a field the source lacks is null, never missing. 11 platform-specific fields (ext.<name>) come on top, documented on each endpoint page.

FieldTypeEndpoints
author.idstring11
author.displayNamestring9
content.idstring9
content.textstring8
content.titlestring8
author.avatarUrlURL7
content.createdAtISO 8601 date6
engagement.likesinteger6
engagement.viewsinteger6
media.thumbnailUrlURL6
engagement.commentsinteger5
author.followersinteger4
engagement.bookmarksinteger4
media.durationSecondsnumber4
author.contentCountinteger3
engagement.sharesinteger3
author.followinginteger2
content.categorystring1
content.typestring1
content.urlURL1
entity.idstring1
entity.namestring1
entity.stats.followersinteger1

The full schema is in Unified schema.

Pricing#

Bilibili calls cost 1 to 3 credits, flat per endpoint. Free when served from cache (0.2 credit for a cached response over 100 KB). Invalid, failed or not-found calls are not charged. See pricing for credit packs.