# 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/workflows/bilibili
- Handle: `@bilibili`
- Category: [Entertainment](https://fous.com/workflows/category/entertainment)
- Source website: https://bilibili.com
- Last verified: Sep 29, 2026
- Fous is not affiliated with Bilibili.

## Methods

### Get video

Operation `get_video`, version 1. 1 credit per call.

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 call.

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 | `1534620` |  |
| `videos[].title` | string or null | `"给我们的组合起个名！"` |  |
| `videos[].views` | integer or null | `17827272` |  |
| `videos[].length` | string or null | `"0:15"` |  |
| `videos[].danmaku` | integer or null | `125807` |  |
| `videos[].uploader` | string or null | `"田一名sir"` |  |
| `videos[].bv_number` | string or null | `"BV17VZpY1ENA"` |  |
| `videos[].video_link` | string or null | `"https://www.bilibili.com/video/BV17VZpY1ENA"` |  |
| `videos[].cover_image_link` | string or null | `"https://i1.hdslb.com/bfs/archive/51bc7808f99e37cff17c16e0b181b98b13b67ddd.jpg"` |  |

**Example input**

```json
{
  "category": "music",
  "max_results": 7
}
```

**Example output**

```json
{
  "videos": [
    {
      "rank": 1,
      "likes": 1534620,
      "title": "给我们的组合起个名！",
      "views": 17827272,
      "length": "0:15",
      "danmaku": 125807,
      "uploader": "田一名sir",
      "bv_number": "BV17VZpY1ENA",
      "video_link": "https://www.bilibili.com/video/BV17VZpY1ENA",
      "cover_image_link": "https://i1.hdslb.com/bfs/archive/51bc7808f99e37cff17c16e0b181b98b13b67ddd.jpg"
    },
    {
      "rank": 2,
      "likes": 312271,
      "title": "20世纪美国乡村经典民谣《阳光彩虹小白马》",
      "views": 5682507,
      "length": "1:00",
      "danmaku": 7468,
      "uploader": "我太高兴了",
      "bv_number": "BV1zKZrYAEi8",
      "video_link": "https://www.bilibili.com/video/BV1zKZrYAEi8",
      "cover_image_link": "https://i1.hdslb.com/bfs/archive/d303383bea066823493acd7a12673bf61805f086.jpg"
    },
    {
      "rank": 3,
      "likes": 68994,
      "title": "循环歌单|【八方来财】|“【来财の小曲】谁懂憋佬仔出来时的救赎感”",
      "views": 10057291,
      "length": "1:00:19",
      "danmaku": 7653,
      "uploader": "蛋某人音乐",
      "bv_number": "BV11eZ8Y5EVi",
      "video_link": "https://www.bilibili.com/video/BV11eZ8Y5EVi",
      "cover_image_link": "https://i0.hdslb.com/bfs/archive/45c78a47fc36c69ce9ebc8b465aed9ba4a8a2910.jpg"
    }
  ]
}
```

## Quick start

Call the API with a Fous API key (`FOUS_API_KEY`). To create one, turn on Developer mode in Fous Studio, then open Keys & connections → API keys (https://app.fous.com/keys).

```bash
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
: "${FOUS_API_KEY:?Set FOUS_API_KEY before running this example}"

curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 120 \
  -H "Authorization: Bearer $FOUS_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.
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
import json
import os
import urllib.error
import urllib.request

api_key = os.environ.get("FOUS_API_KEY")
if not api_key:
    raise RuntimeError("Set FOUS_API_KEY before running this example")

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=120) 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.
// First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
const apiKey = process.env.FOUS_API_KEY;
if (!apiKey) throw new Error("Set FOUS_API_KEY before running this example");

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(120_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);
```

Or describe the data in plain language: send `{"api":"@bilibili","prompt":"Describe the data you need, with every detail"}` to the same URL. Fous fills in the input, runs the method that fits and returns only the fields you asked for; `data.route.calls[].request` is the exact call it made. Routing is free; the run costs the same.

## 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

### Is Fous affiliated with Bilibili?

No. Fous is not affiliated with Bilibili. This workflow reads the public bilibili.com website and returns its data.

### How much does it cost?

Each run costs 1 credit. 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; repeating the same request within a day may return the saved result. Fous checks this workflow automatically; it last passed a check 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/workflows/youtube.md): YouTube returns public video, caption, comment, channel and upload details, plus the latest weekly Top Songs chart; inferred dates and some counts may be approximate.
- [MyAnimeList API](https://fous.com/workflows/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/workflows/vimeo.md): Watch and share videos on Vimeo.
- [TikTok API](https://fous.com/workflows/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/workflows/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/workflows/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/workflows/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/workflows/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 workflows](https://fous.com/workflows/category/entertainment)
