# T Bilibili — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Discover what's trending on Bilibili by accessing real-time popular searches, viral videos, and video rankings all in one place. Stay ahead of trends on China's biggest video platform with up-to-date insights into what millions of users are watching and searching for.

**Category:** Streaming Video | **Website:** [t.bilibili.com/](https://t.bilibili.com/) | **Docs:** [parse.bot/marketplace/ff6138ec-acb0-4d31-976b-9006126c5b61/t-bilibili-com-api](https://parse.bot/marketplace/ff6138ec-acb0-4d31-976b-9006126c5b61/t-bilibili-com-api)

Pay-per-use API proxy for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/credits/t-bilibili/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## Endpoints

### Get popular videos

Retrieves the current popular/hot videos on Bilibili with pagination. Videos are ordered by editorial/algorithmic recommendation. Each video includes metadata, owner info, and engagement statistics.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `page` | integer | No | Page number for pagination (1-based). |
| `page_size` | integer | No | Number of videos per page (1-50). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/t-bilibili/get-popular-videos \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"page":"<integer>","page_size":"<integer>"}'
```

### Get ranking

Retrieves the video ranking for a specific content category on Bilibili. Rankings are based on content quality and recent engagement metrics, dynamically updated. Returns up to 100 top videos per category.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `category_id` | string | No | Numeric category ID. Known values: 0 (all/全站), 1 (animation/动画), 3 (music/音乐), 4 (gaming/游戏), 5 (entertainment/娱乐), 36 (technology/科技), 119 (kichiku/鬼畜), 129 (dance/舞蹈), 155 (fashion/时尚), 160 (lifestyle/生活), 168 (guochuang/国创), 211 (food/美食), 217 (animal/动物圈), 223 (automobile/汽车), 234 (sports/运动). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/t-bilibili/get-ranking \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"category_id":"<string>"}'
```

### Get trending searches

Retrieves the current hot/trending search keywords on Bilibili. Each keyword includes a display name, optional icon, and a heat score indicating relative popularity. Results are ordered by popularity descending.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Maximum number of trending keywords to return. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/t-bilibili/get-trending-searches \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>"}'
```

## Next steps

- [All wrapped API providers](https://paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://paywithlocus.com/agent/index.md): every Locus agent page.