# Bilibili API for AI agents and LLMs: fewer tokens, called from Claude and Cursor (2026)

DataXAPI has 9 Bilibili endpoints, and what an AI reads of them through MCP takes 96% fewer tokens than the platform's raw JSON: a page of 20 video search results is 10k tokens raw and 3,325 as the AI reads it. One key, no Bilibili account of yours. The free trial covers up to 333 calls; a failed call is not charged.

Updated 2026-11-06

## Why does an agent care how big an answer is?

Every token of a tool's answer goes into the agent's context and is paid for as input. Bilibili's raw JSON is made for its own app, with many fields nested deep. Across DataXAPI's 9 Bilibili endpoints, one recorded real response each, the raw JSON comes to 477k tokens and what an AI reads through MCP to 21k. With the context saved, an agent reads more pages and takes more steps in one conversation, and sooner.

Every platform uses the same names: the author in `author`, counts in `metrics`, the time in `published_at` as UTC, the next page in `page.next_cursor`. A field the platform does not give is listed in `meta.unavailable`, so the AI does not read it as 0.

## How do I connect it?

To connect: paste this to your AI assistant: “Read https://dataxapi.com/agents.md and set up DataXAPI here. My API key is dx_…; use it for every DataXAPI call.” A client that takes a remote MCP server can be given `https://api.dataxapi.com/mcp` with the header `Authorization: Bearer <key>` instead.

## What to ask once it is connected

Say what you want: the agent finds the endpoint and its price, then calls it; finding and reading parameters are free.

| You say | What it calls |
| --- | --- |
| Bilibili mechanical keyboard reviews, most played first | `bilibili.videos.search` |
| This video's plays, danmaku and coins (a BV ID) | `bilibili.videos.get` |
| The top comments under this video | `bilibili.videos.comments.list` |
| This uploader's recent videos | `bilibili.users.videos.list` |

## What does it cost?

Paid per call; a failed call is not charged. A page of 20 video search results is $0.0020; the free trial covers up to 333 calls. Give the agent its own key with a limit; `X-Max-Price` caps what one call may cost.

## Why DataXAPI

- Steady: endpoints were available 100% of the last 30 days, on a public status page you can check.
- Fast: a paid call took 1.6 seconds at the median over the last 7 days (counted 2026-11-06).
- Fewer tokens: across 9 endpoints on Bilibili, one recorded real response each, the platform's own JSON comes to 477k tokens and what an AI reads through DataXAPI's MCP server to 21k, 96% fewer; the JSON of a direct API call is 95% fewer too (counted 2026-11-06). Every platform answers in one shape: the author in `author`, counts in `metrics`, the next page in `page.next_cursor`, so another platform needs no new parser.
- See before you pay: every endpoint's page shows a recorded real response, field by field.
- Spending you control: a failed call is not charged; each key can have a limit, `X-Max-Price` caps one call, and the same `Idempotency-Key` within 24 hours is never charged twice.
- Ready for AI: a remote MCP server listed in the official MCP registry as `com.dataxapi/mcp`, usable from Claude, Cursor and ChatGPT.
- Free trial of up to 333 calls, no card.

## Endpoints

- [Bilibili video search](https://dataxapi.com/apis/bilibili/videos/search/) ($0.0020 / a call): Get a page of Bilibili videos for search terms, by relevance, newest or most played: title, uploader, views, likes, saves, comments, length.
- [Bilibili video detail](https://dataxapi.com/apis/bilibili/videos/get/) ($0.0020 / a call): Get one Bilibili video by BV number or link: title, description, uploader, views, likes, coins, saves, danmaku count, length.
- [Bilibili video comments](https://dataxapi.com/apis/bilibili/videos/comments/list/) ($0.0020 / a call): Get a page of comments on a Bilibili video by BV number, most liked first: text, commenter, likes, reply count, time posted.
- [Bilibili user videos](https://dataxapi.com/apis/bilibili/users/videos/list/) ($0.0020 / a call): Get a page of the videos a Bilibili user uploaded, newest first: title, description, views, comments, danmaku count, length, time published.

## How-to guides

- [Bilibili API in Python: videos and comments (2026)](https://dataxapi.com/guides/bilibili-api-python/)

## More about Bilibili

- [Bilibili API](https://dataxapi.com/apis/bilibili/)
- [What are Bilibili's 412 error and wbi? (2026)](https://dataxapi.com/answers/bilibili-412-wbi/)
- [How do I export Bilibili comments in bulk? (2026)](https://dataxapi.com/answers/export-bilibili-comments/)
- [What does Bilibili's -352 error mean? (2026)](https://dataxapi.com/answers/bilibili-352-risk-control/)
- [What does Bilibili's API校验密匙错误 (code -3) mean? (2026)](https://dataxapi.com/answers/bilibili-api-key-error-minus-3/)
- [Bilibili API: videos, comments and uploader data (2026)](https://dataxapi.com/answers/bilibili-data-apis/)
- [Bilibili MCP server for Claude and Cursor (2026)](https://dataxapi.com/answers/bilibili-mcp/)
- [What are Bilibili BV ids, aids and mids? (2026)](https://dataxapi.com/answers/bilibili-bv-aid-mid/)

---

Catalog revision 9d3b7fa5a896745d. [HTML version](https://dataxapi.com/answers/bilibili-api-for-ai-agents/)
