# Bilibili API

> Bilibili returns video details, statistics, and popular rankings as a workflow and API.

Bilibili, also called B站, provides video details and public statistics through Get video, which needs a video link, BV number, or title. List popular videos returns ranked videos overall or by category, with an optional maximum result count.

- Page: https://fous.com/tools/bilibili
- Handle: `@bilibili`
- Category: [Entertainment](https://fous.com/tools/category/entertainment)
- Source website: https://bilibili.com
- Last verified: Sep 29, 2026

## Methods

### Get video

Operation `get_video`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

Get public statistics and details for a Bilibili video link, BV number, or title. A title selects the top video search match. Category may be missing when Bilibili does not show a label.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `video` | string | yes | `"https://www.bilibili.com/video/BV14Baa6JENd"` | A Bilibili video link, BV number, or video title, for example 《原神》六周年主题曲《风的来信》. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "video"
  ],
  "properties": {
    "video": {
      "type": "string",
      "description": "A Bilibili video link, BV number, or video title, for example 《原神》六周年主题曲《风的来信》.",
      "examples": [
        "https://www.bilibili.com/video/BV14Baa6JENd",
        "原神"
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "video": "https://www.bilibili.com/video/BV14Baa6JENd"
    },
    {
      "video": "原神"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `tags` | array |  |  |
| `coins` | integer | `196562` |  |
| `likes` | integer | `318730` |  |
| `title` | string | `"《原神》六周年主题曲《风的来信》"` |  |
| `views` | integer | `2065683` |  |
| `length` | string | `"14:38"` |  |
| `shares` | integer | `39741` |  |
| `danmaku` | integer | `38132` |  |
| `category` | string or null | `"手机游戏"` |  |
| `comments` | integer | `17449` |  |
| `av_number` | integer | `117343120398899` |  |
| `bv_number` | string | `"BV14Baa6JENd"` |  |
| `favorites` | integer | `96879` |  |
| `video_link` | string | `"https://www.bilibili.com/video/BV14Baa6JENd"` |  |
| `description` | string | `"旅途有你，就是意义。\n——————————————————\n音乐出品：HOYO-MiX\n作曲：赵鑫（HOYO-MiX）\n \n中文演唱：孙晔\n英文演唱：Griffin Burns\n日文演唱：西川贵教\n韩文演唱：南度亨\n\n` |  |
| `uploader_link` | string | `"https://space.bilibili.com/401742377"` |  |
| `uploader_name` | string | `"原神"` |  |
| `length_seconds` | integer | `878` |  |
| `cover_image_link` | string | `"https://i2.hdslb.com/bfs/archive/e0fff47818224cf8016d5743fb8b35a2c3812eb8.jpg"` |  |
| `publish_date_time` | string | `"2026-09-28T12:00:00+08:00"` |  |

**Example input**

```json
{
  "video": "https://www.bilibili.com/video/BV14Baa6JENd"
}
```

**Example output**

```json
{
  "tags": [
    "风的来信",
    "原神6周年",
    "米哈游"
  ],
  "coins": 196562,
  "likes": 318730,
  "title": "《原神》六周年主题曲《风的来信》",
  "views": 2065683,
  "length": "14:38",
  "shares": 39741,
  "danmaku": 38132,
  "category": "手机游戏",
  "comments": 17449,
  "av_number": 117343120398899,
  "bv_number": "BV14Baa6JENd",
  "favorites": 96879,
  "video_link": "https://www.bilibili.com/video/BV14Baa6JENd",
  "description": "旅途有你，就是意义。\n——————————————————\n音乐出品：HOYO-MiX\n作曲：赵鑫（HOYO-MiX）\n \n中文演唱：孙晔\n英文演唱：Griffin Burns\n日文演唱：西川贵教\n韩文演唱：南度亨\n\n《原神》bilibili服下载地址： https://www.biligame.com/detail/?id=103496",
  "uploader_link": "https://space.bilibili.com/401742377",
  "uploader_name": "原神",
  "length_seconds": 878,
  "cover_image_link": "https://i2.hdslb.com/bfs/archive/e0fff47818224cf8016d5743fb8b35a2c3812eb8.jpg",
  "publish_date_time": "2026-09-28T12:00:00+08:00"
}
```

### List popular videos

Operation `list_popular_videos`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

List the current Bilibili ranking overall or in a selected category, in rank order. The Movies ranking does not provide uploader, likes, length or BV numbers.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `category` | string | no | `"all"` | Ranking category, such as music or gaming. |
| `max_results` | integer | no | `50` | Maximum number of ranked videos to return, for example 50. |

**Input schema**

```json
{
  "type": "object",
  "properties": {
    "category": {
      "enum": [
        "all",
        "anime",
        "music",
        "dance",
        "gaming",
        "knowledge",
        "tech",
        "food",
        "movies"
      ],
      "type": "string",
      "default": "all",
      "description": "Ranking category, such as music or gaming.",
      "examples": [
        "all",
        "music",
        "movies"
      ]
    },
    "max_results": {
      "type": "integer",
      "default": 50,
      "maximum": 100,
      "minimum": 1,
      "description": "Maximum number of ranked videos to return, for example 50.",
      "x-fous-developer": true,
      "examples": [
        50,
        7,
        5
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "category": "all",
      "max_results": 50
    },
    {
      "category": "music",
      "max_results": 7
    },
    {
      "category": "movies",
      "max_results": 5
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `videos` | array |  |  |
| `videos[].rank` | integer | `1` | Position in the selected ranking. |
| `videos[].likes` | integer or null | `318922` |  |
| `videos[].title` | string or null | `"《原神》六周年主题曲《风的来信》"` |  |
| `videos[].views` | integer or null | `2067214` |  |
| `videos[].length` | string or null | `"14:38"` |  |
| `videos[].danmaku` | integer or null | `38164` |  |
| `videos[].uploader` | string or null | `"原神"` |  |
| `videos[].bv_number` | string or null | `"BV14Baa6JENd"` |  |
| `videos[].video_link` | string or null | `"https://www.bilibili.com/video/BV14Baa6JENd"` |  |
| `videos[].cover_image_link` | string or null | `"https://i2.hdslb.com/bfs/archive/e0fff47818224cf8016d5743fb8b35a2c3812eb8.jpg"` |  |

**Example input**

```json
{
  "category": "all",
  "max_results": 50
}
```

**Example output**

```json
{
  "videos": [
    {
      "rank": 1,
      "likes": 318922,
      "title": "《原神》六周年主题曲《风的来信》",
      "views": 2067214,
      "length": "14:38",
      "danmaku": 38164,
      "uploader": "原神",
      "bv_number": "BV14Baa6JENd",
      "video_link": "https://www.bilibili.com/video/BV14Baa6JENd",
      "cover_image_link": "https://i2.hdslb.com/bfs/archive/e0fff47818224cf8016d5743fb8b35a2c3812eb8.jpg"
    },
    {
      "rank": 2,
      "likes": 233916,
      "title": "蛙跳爬泰山",
      "views": 1550502,
      "length": "9:20",
      "danmaku": 9179,
      "uploader": "爱健身小庞",
      "bv_number": "BV1Hxah6BEGy",
      "video_link": "https://www.bilibili.com/video/BV1Hxah6BEGy",
      "cover_image_link": "https://i1.hdslb.com/bfs/archive/7352ffb6b3855ae481e3588fccfc0b436e315119.jpg"
    },
    {
      "rank": 3,
      "likes": 164478,
      "title": "《三角洲行动》群星计划—代号：威龙",
      "views": 3074784,
      "length": "13:56",
      "danmaku": 22050,
      "uploader": "三角洲行动",
      "bv_number": "BV1fAh96ZELn",
      "video_link": "https://www.bilibili.com/video/BV1fAh96ZELn",
      "cover_image_link": "https://i2.hdslb.com/bfs/archive/67a46169420d507f3f1846d282d59be3472acb98.jpg"
    }
  ]
}
```

## Quick start

Replace `YOUR_API_KEY` with a Fous API key. To create one, open Developers at the bottom of Fous Studio, turn on Developer mode, then go to API keys (https://app.fous.com/keys). Change the values in `input` to run the same tool on new data.

```bash
curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 180 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@bilibili",
  "visibility": "public",
  "operation": "get_video",
  "version": 1,
  "input": {
    "video": "https://www.bilibili.com/video/BV14Baa6JENd"
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
import json
import urllib.error
import urllib.request

api_key = "YOUR_API_KEY"

body = json.loads("{\n  \"api\": \"@bilibili\",\n  \"visibility\": \"public\",\n  \"operation\": \"get_video\",\n  \"version\": 1,\n  \"input\": {\n    \"video\": \"https://www.bilibili.com/video/BV14Baa6JENd\"\n  },\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=180) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
const apiKey = "YOUR_API_KEY";

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(180_000),
  body: JSON.stringify({
  "api": "@bilibili",
  "visibility": "public",
  "operation": "get_video",
  "version": 1,
  "input": {
    "video": "https://www.bilibili.com/video/BV14Baa6JENd"
  },
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

## Use from an AI assistant

Connect this tool to Claude Code, Claude Desktop, Cursor, VS Code, Codex and any MCP client as its own MCP server. Each method is a typed tool whose arguments are the method’s input.

- Server URL: `https://api.fous.com/mcp/tools/bilibili`
- Authorization: `Authorization: Bearer <Fous API key>`

**Tools**

- `get_video`: Get video. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `list_popular_videos`: List popular videos. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `fous_get_run`: the result of a run that was still going, by its `request_id`. Free.

Claude Code:

```bash
claude mcp add --scope user --transport http fous-bilibili https://api.fous.com/mcp/tools/bilibili --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"
```

To give the assistant every tool, connect `https://api.fous.com/mcp`: it finds one with `fous_search_tools` and runs it with `fous_run_tool`. Setup for other clients: https://fous.com/llms-full.txt.

## Use cases

- Compare views, likes, comments, and shares across videos.
- Find popular videos by ranking category.
- Track video titles, publishers, and ranking positions.
- Review video length, tags, and publication dates.

## FAQ

### Can I run it with my own inputs?

Yes. Change the inputs in Studio and press Run, or send new inputs from your code, or ask a connected AI assistant.

### Can I call this Bilibili tool as an API?

Yes. Send a POST request to /v1/query with your Fous API key and the inputs, and get JSON back.

### How much does it cost?

Each completed run costs 1 credit. Failed runs without a completed receipt are free; completed work can remain charged if delivery is interrupted. With pay as you go, a credit costs 1¢. Monthly plans cost less per credit.

### Do I need a Bilibili account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from bilibili.com when you run it. Some results are reused for up to 24 hours, and results that use your account or key are never reused. It was last verified on Sep 29, 2026.

### How many views and likes does a video have?

Get video returns public statistics including views and likes for a video link, BV number, or title.

### Which videos are popular in a category?

List popular videos returns ranked videos overall or in a selected category.

### Who uploaded a video?

Get video returns the uploader name and link for a video.

## Related

- [YouTube API](https://fous.com/tools/youtube.md): YouTube returns public video, caption, comment and channel details, company channels, and the latest weekly Top Songs chart; inferred dates and some counts may be approximate.
- [MyAnimeList API](https://fous.com/tools/myanimelist.md): MyAnimeList provides anime, manga, manhwa and light novel details, ratings, seasonal and top rankings; streaming follows its listings, and unannounced or unavailable details may be missing.
- [Vimeo API](https://fous.com/tools/vimeo.md): Watch and share videos on Vimeo.
- [TikTok API](https://fous.com/tools/tiktok.md): TikTok returns public profiles and totals, recent pinned-first videos, and public video details and engagement; private content unavailable, and feeds may be incomplete or empty.
- [Twitch API](https://fous.com/tools/twitch.md): Twitch returns channel profiles, live status, up to 10 broadcasts, top streams, viewer-ranked categories, up to 100 public videos/clips, and 1–30-day schedules; counts change.
- [Netflix API](https://fous.com/tools/netflix.md): Netflix offers weekly global and country Top 10 rankings, all-time popularity rankings based on titles’ first 91 days, and title details with country availability that may lag.
- [WEBTOON API](https://fous.com/tools/webtoon.md): WEBTOON helps readers find comics and discover popular or trending series, with public series details and newest publicly listed episodes; app-only episodes and numeric series ratings aren’t shown.
- [Letterboxd API](https://fous.com/tools/letterboxd.md): Letterboxd provides films with ratings, cast, location-dependent watch services and popular reviews, plus popularity-ranked lists by time period, genre and decade; some details may be unavailable.
- [All Entertainment tools](https://fous.com/tools/category/entertainment)
