# Bilibili Videos and Rankings API

> Bilibili popular videos, site and category rankings, video details with stats, and related videos

- Vendor: `bilibilivideosandrankingsapi` · version 1.0 · category Video & Images · tags bilibili api, chinese video api, bilibili ranking api, video stats api, trending videos api, bilibili popular api
- Datasource: custom HTTP routes
- Marketplace page: https://apiclay.com/api/bilibilivideosandrankingsapi
- This document: https://apiclay.com/docs/bilibilivideosandrankingsapi.md
- OpenAPI 3.1: https://apiclay.com/api/bilibilivideosandrankingsapi/openapi.json
- MCP: connect https://api.apiclay.com/v1/mcp (see https://apiclay.com/llms.txt), then `apiclay_describe_api` with vendor `bilibilivideosandrankingsapi`
- Updated: 2026-11-18

## About

## Bilibili Videos and Rankings API

Public video data from Bilibili, China's largest youth video platform: the current popular feed, the all-site ranking, three-day rankings per category, one video's details (title, uploader, duration, category, publish time and view, like, coin, favourite, share and danmaku counts) and the videos related to it.

Data comes from **bilibili.com** (https://www.bilibili.com). Every route calls the source's own public API and returns it unchanged.

Typical flow: `/popular?ps=20`, `/ranking`, then `/video?bvid=` and `/related?bvid=`.

### Routes

#### GET `/popular` - Popular videos
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| ps | query | number | no | Videos per page (up to 50). |
| pn | query | number | no | Page, from 1. |

Returns: `data.list[]` with `bvid`, `aid`, `title`, `tname` (category), `pic`, `duration`, `pubdate`, `owner` (`mid`, `name`), `stat` (`view`, `like`, `coin`, `favorite`, `share`, `danmaku`, `reply`), `rcmd_reason`.

#### GET `/ranking` - Ranking
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| rid | query | number | no | `0` for the whole site, or a category id. |
| type | query | string | no | `all`, `origin` or `rookie`. |

Returns: `data.list[]` with the same video fields and a `score`.

#### GET `/category-ranking` - Category ranking
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| rid | query | number | yes | Category id, e.g. 36 (knowledge), 4 (games), 3 (music). |
| day | query | number | no | `3` or `7` days. |

Returns: `data[]` with `bvid`, `title`, `author`, `play`, `video_review`, `coins`, `duration`, `pts`.

#### GET `/video` - Video
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| bvid | query | string | yes | Video id `BV...` from the lists. |

Returns: `data` with `title`, `desc`, `tname`, `pubdate`, `duration`, `owner`, `stat`, `pages[]`, `dimension`.

#### GET `/related` - Related videos
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| bvid | query | string | yes | Video id `BV...`. |

Returns: `data[]` of related videos with the same fields as `/popular`.

### Caveats

- Titles and descriptions are mostly in Chinese. Video playback URLs are not included.
- Upstream responses can change over time. Verify fields before relying on them.
- Not affiliated with or endorsed by bilibili.com.

## Pricing

- Pay as you go: 0.0012 credits/request
- Trial: 1 free requests per buyer
- Billing order: trial requests -> subscribed plan requests -> pay as you go. 1 credit's USD value is shown on the marketplace page.

## HTTP routes

Only the public, buyer-facing parts of each route are listed; vendor-side credentials stay on the gateway.

### GET /popular — Popular videos
- Gateway: `GET https://api.apiclay.com/v1/api/bilibilivideosandrankingsapi/popular`
- Public query params: `ps` (number), `pn` (number)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### GET /ranking — Ranking
- Gateway: `GET https://api.apiclay.com/v1/api/bilibilivideosandrankingsapi/ranking`
- Public query params: `rid` (number), `type` (string)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### GET /category-ranking — Category ranking
- Gateway: `GET https://api.apiclay.com/v1/api/bilibilivideosandrankingsapi/category-ranking`
- Public query params: `rid` (number, required), `day` (number)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### GET /video — Video
- Gateway: `GET https://api.apiclay.com/v1/api/bilibilivideosandrankingsapi/video`
- Public query params: `bvid` (string, required)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### GET /related — Related videos
- Gateway: `GET https://api.apiclay.com/v1/api/bilibilivideosandrankingsapi/related`
- Public query params: `bvid` (string, required)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

## Call example

```bash
curl -X GET "https://api.apiclay.com/v1/api/bilibilivideosandrankingsapi/popular" \
  -H "token: <YOUR_APICLAY_TOKEN>"
```

Index of every published API: https://apiclay.com/llms.txt
