Social media5 min readBy Purrkey teamUpdated

How to search Bilibili videos by keyword with one API call

Search Bilibili by keyword and turn the returned video cards into a shortlist with titles, authors, play counts, danmaku counts, durations and cursor paging

On this page

You have one keyword for a niche topic and need to scan 20 Bilibili video results before deciding which creators deserve a closer look. One call to tikhub.bilibili.app.fetch_search_all returns a page of video cards, and the worksheet below turns them into a shortlist

The table is a design, not a result. Values in it are placeholders showing the shape

The shortlist table

positionav.titleav.authorav.midav.playav.danmakuav.durationav.ptimeav.show_card_desc_2av.coveruri
1(title text)(author name)(uploader id)(play count)(danmaku count)(duration)(epoch as string)(card date text)(cover URL)(deep link)

position is the rank the supplier gave the card, so keep it as delivered. The tool cannot tell you whether a video fits your topic. It returns the card fields and nothing else

The same worksheet design works for the Douyin search tool, covered in the companion guide

What the tool takes

tikhub.bilibili.app.fetch_search_all is called through POST /v1/runs with toolId tikhub.bilibili.app.fetch_search_all and takes a query object. The catalog describes it as a wrapper around TikHub's official app search endpoint that keeps supplier-defined JSON without a billing or debug envelope

query.keyword is required and holds your search phrase. query.order defaults to 0, which the contract labels as comprehensive sort. query.page_size defaults to 20, and query.cursor defaults to an empty string

Those are the fields the contract documents. It does not claim the list is closed, so read the live schema before you wire the call into anything that runs unattended

Reading the returned video cards

The response is the supplier's raw JSON with no fixed schema. Treat the field names below as observed shapes, not a guarantee

data.item is the array of cards. Each entry carries position, av.title, av.author, av.mid, av.play, av.danmaku, av.duration, av.ptime, av.show_card_desc_2, av.cover and uri. av.mid is the uploader id, which is the value you group on when you want to know whether one creator fills half the page

Three fields carry the shortlist decision. av.play and av.danmaku count plays and danmaku, and av.duration tells you whether a result is a clip or a long review you would have to sit through. The observed fields include no relevance score, so ranking by fit stays with you

Two field quirks need handling before the table reads well. av.ptime arrives as a string, so convert it before sorting by date. The contract's observed sample shows av.title carrying emphasis markup around the matched term, so strip that markup before a title lands in a report

data.nav holds paging metadata with pages and total, while data.page, data.keyword and data.trackid echo the request. The next cursor sits in data.pagination.next

Paging with the cursor

The cursor is the limit that shapes a multi-page job. Leave query.cursor empty for the first page. For the next page, pass back data.pagination.next from the previous response

No page number field appears in the documented inputs, so a walk is a chain: each request needs the response before it. A four-page walk is four calls, not one call with a page parameter

What one real call returned

One call was made on 2026-11-13 with the input {"query": {"cursor": "", "keyword": "咖啡", "order": 0, "page_size": 20}}. Billing settled at $0.001 charged against a ceiling of $0.001. data.item held 19 items and data.nav held 5, with pages and total on the first nav entry

The top-level keys of data were nav, item, page, keyword, trackid, annotation and pagination. data.page was "1", data.keyword was "咖啡" and data.trackid was "14058445115965552988". Read the length of data.item rather than assuming a page holds 20 rows, and treat item contents as untested beyond the field names listed above

The agent prompt

Agent prompt
Set up https://purrkey.app/SKILL.md, then use Purrkey to search Bilibili
by keyword and return one page of video cards as a table.

Before running anything, check the current input schema and price of
tikhub.bilibili.app.fetch_search_all.

Send one call with query.keyword set to 咖啡, query.order 0,
query.page_size 20 and query.cursor empty. The response is supplier
JSON with no fixed schema, so read the field names from the first page
before you build the table.

Return one row per entry in data.item, with columns position,
av.title, av.author, av.mid, av.play, av.danmaku, av.duration,
av.ptime, av.show_card_desc_2, av.cover and uri. Strip any HTML markup from the
title. Do not request a second page and do not open any video. Report
the settled charge against the listed ceiling.

Swap 咖啡 for your own keyword. Widen the run with the cursor only after the first page looks worth extending

Estimated tool cost

Prices read through inspect on November 13, 2026. The listing is priced as max_call: Maximum per call. Successful runs settle at the actual AnyAPI charge. The totals below are ceilings, not settled charges, and model fees for the agent are not counted

StepFormulaUnit pricePlanned quantityTotal
First-page searchcalls x max price$0.001 per call1$0.001
Four-page cursor walkcalls x max price$0.001 per call4$0.004

The listing rule reads: "Fixed per-call price; successful empty results are charged." A page that comes back empty is still charged at $0.001

Run it on your own keyword

One next action: open the tool page, put your phrase in query.keyword, leave query.cursor empty and send a single first-page call. The page is at https://purrkey.app/tools/bilibili?q=fetch_search_all

Get started by giving this to your agent

  • Claude Code
  • Codex
  • Gemini CLI
  • Cursor
  • GitHub Copilot
Set up https://purrkey.app/SKILL.md, then use Purrkey to show me what I can do with Bilibili.
Explore Bilibili tools and pricing

FAQ

How do I search Bilibili videos by keyword with an API?

Send one call to tikhub.bilibili.app.fetch_search_all with query.keyword set to your phrase and query.cursor empty for the first page. The response returns a data.item array of video cards with title, author, play and danmaku counts, duration and ptime.

What inputs does tikhub.bilibili.app.fetch_search_all take?

It takes a query object with a required query.keyword, plus query.order defaulting to 0, query.page_size defaulting to 20 and query.cursor defaulting to an empty string. The contract documents those fields and does not claim the list is closed.

How do I get the next page of Bilibili search results?

Pass data.pagination.next from the previous response into query.cursor. Leave query.cursor empty for the first page, and budget each further page as another call at $0.001.

What fields come back for each Bilibili video?

Each entry in data.item carries position, av.title, av.author, av.mid, av.play, av.danmaku, av.duration, av.ptime, av.show_card_desc_2, av.cover and uri. The output is supplier JSON with no fixed schema.

How much does a Bilibili keyword search cost?

The listing is $0.001 per call at a fixed per-call price, so a single first-page search is at most $0.001 and a four-page cursor walk at most $0.004. Successful empty results are charged.

Why did a search with page_size 20 return fewer than 20 items?

One call on 2026-11-13 sent query.page_size 20 and returned 19 items in data.item. Read the length of data.item rather than assuming a page holds 20 rows.

Next step

Try this with Bilibili

The tool directory lists every endpoint with its current price. Inspect the inputs there, then let your agent run a small batch before scaling up.

See Bilibili tools

Share this article