Bilibili General search API
API health
- 24h health
- Normal
- Healthy / normal
- Available
Last 24 hours
Last 30 days
Search Bilibili the way its All tab does: videos, accounts, anime series, films and live rooms mixed in one list, each row tagged with type. The first page holds about 20 videos plus related accounts, anime series and films; later pages are videos only. Pass next_page_token back as page_token for more.
Send POST https://api.everyinfra.com/api/v1/social with platform set to bilibili and action set to general_search. Price $0.79 per 1,000 requests ($0.000792 per call). Failed calls and empty results are not charged. Synchronous. For slow jobs add "mode": "async" to the body, take the job_id and poll.
AI prompt
#Please help me write a data collection script with the EveryInfra Bilibili General search endpoint (bilibili/general_search).
How the endpoint works:
- Request: POST https://api.everyinfra.com/api/v1/social with the header Authorization: Bearer <API key>. Read the key from the EVERYINFRA_API_KEY environment variable and never hard-code it.
- In the request body, set platform to bilibili and action to general_search, and put the parameters inside params.
- Required parameters:
- keyword: Search term. Results are mixed like Bilibili's All tab; each row's type is video, user, bangumi, movie or live. Use search for videos only and user_search for accounts only.
- Optional parameters:
- page_token: Page token. Leave it out for the first page, then pass back the previous response's next_page_token exactly as received, with the other parameters unchanged.
- Returns a list of records. Main fields of each record: type, id, url, title, text, duration_seconds, duration_sec, duration_text (Duration as displayed text (for example…), view_count, like_count, comment_count, danmaku_count (Danmaku (on-screen comment) count); 39 fields in total, full list at https://api.everyinfra.com/api/v1/social/catalog?platform=bilibili.
- Example request body:
{
"platform": "bilibili",
"action": "general_search",
"params": {
"keyword": "编程"
}
}
- Price: $0.79 per 1,000 requests; failed and empty results are not charged.
- For dozens or hundreds of targets, add "mode": "async" to the body: you get a job_id at once and poll GET https://api.everyinfra.com/api/v1/jobs/{job_id} for the result.
- On 422, fix the request using the suggested parameter names and allowed values in the error; on 429 or 503, wait for Retry-After and try again.
Before writing code, ask me which targets I need, how many, which fields, and what output format I want; then confirm the plan and the rough cost with me.Request parameters
#| Name | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
Authorization | header | string | Yes | - | Bearer followed by your API key. Create it in the console; never put it in a URL or a code repository. |
platform | body | string | Yes | bilibili | Platform identifier, fixed value. |
action | body | string | Yes | general_search | Capability identifier, fixed value. |
keyword | body.params | string | Yes | - | Search term. Results are mixed like Bilibili's All tab; each row's type is video, user, bangumi, movie or live. Use search for videos only and user_search for accounts only. |
page_token | body.params | string | No | - | Page token. Leave it out for the first page, then pass back the previous response's next_page_token exactly as received, with the other parameters unchanged. The first page holds about 20 videos plus related accounts, anime series and films; later pages hold videos only, up to 20. Each page is one call and limit has no effect. Tokens last 24 hours, and the last page has no next_page_token. |
Code samples
#curl -X POST 'https://api.everyinfra.com/api/v1/social' \
-H "Authorization: Bearer $EVERYINFRA_API_KEY" \
-H 'Content-Type: application/json' \
--data-raw '{
"platform": "bilibili",
"action": "general_search",
"params": {
"keyword": "编程"
}
}'OpenAPI definition (JSON)Samples read the key from the EVERYINFRA_API_KEY environment variable; copied code never contains your key.
Response example
#{ "id": "req_…", "platform": "bilibili", "action": "general_search", "results": [ { "type": "video", "id": "BV1rpWjevEip", "url": "https://www.bilibili.com/video/BV1rpWjevEip", "title": "【全748集】目前B站最全最细的Python零基础全套教程,2026最新版,包含所有干货!七天就能从小白到大神!少走99%的弯路!存下吧!很难找全的!", "text": "【视频配套籽料、开发环境搭建安装包教程、电子书+问题解答请看 ”置顶平论” 自取哦】\r\n本套教程从零开始讲解,手把手教学,包含基础语法、进阶语法、爬虫、自动化办公、数据分析\r\n无论是新手小白,还是有一定编码经验的选手,皆可学习\r\n如果视频对你有用的话请 一键三连【长按点赞】支持一下UP哦,拜托,这对我真的很重要!", "duration_seconds": 143894, "duration_text": "39:58:14", "view_count": 21931770, "like_count": 605744, "comment_count": 373418, "danmaku_count": 137244, "favorite_count": 927710, "thumbnail_url": "https://i2.hdslb.com/bfs/archive/a979056b1a32012cdd00d48fbc3732d253e30620.jpg", "posted_at": "2024-08-22T14:59:18+00:00", "category": "计算机技术", "author_name": "P•••程", "author_id": "•••", "author_url": "https://space.bilibili.com/•••", "platform": "bilibili", "tags": [ "程序员", "Python教程", "Python入门零基础" ], "duration_sec": 143894 }, { "type": "video", "id": "BV12J411X7tY", "url": "https://www.bilibili.com/video/BV12J411X7tY", "title": "少儿编程scratch3.0基础入门(大龙老师)", "text": "这个教程是简单的基础入门课,想要系统的,完整的学习scratch请选择《新版scratch从入门到精通系统课》,点击评论区置顶链接进入课程,了解详情。", "duration_seconds": 11349, "duration_text": "3:09:09", "view_count": 1373367, "like_count": 15518, "comment_count": 2142, "danmaku_count": 9959, "favorite_count": 46757, "thumbnail_url": "https://i2.hdslb.com/bfs/archive/45a0b5a218de8fff3b7f4cf02e130179b1be470c.jpg", "posted_at": "2019-11-27T10:20:37+00:00", "category": "校园学习", "author_name": "大•••程", "author_id": "•••", "author_url": "https://space.bilibili.com/•••", "platform": "bilibili", "tags": [ "scratch", "少儿编程", "原创" ], "duration_sec": 11349 } ], "next_page_token": …, "pagination": { … }, "count": 17, "billing": { "charged": …, "charged_usd": …, "balance_after_usd": …, … }, "quota": { … }}
Response fields
#Business data is in results. The table lists the fields a record can contain. Values the platform does not show are never made up.
| Field | Meaning |
|---|---|
type | Record type; values depend on the capability (for example video / image / text). |
id | The record's unique ID on the platform. Unique only within one platform; IDs can repeat across platforms. |
url | Link to the record on the platform. |
title | Title. null when the platform has no titles (for example text-only posts). |
text | Body text with HTML removed, returned in full and never cut short (on a few platforms the list results themselves carry only an excerpt; the platform's field notes say so). |
duration_seconds | Duration in seconds. null for content that is not video or audio. |
duration_sec | Keeps the platform's own meaning |
duration_text | Duration as displayed text (for example 12:34). |
view_count | Views or plays. null means not disclosed, not 0. |
like_count | Likes. null means the platform or this capability does not disclose it; it is not 0. |
comment_count | Comments. null means not disclosed, not 0. |
danmaku_count | Danmaku (on-screen comment) count. A Bilibili-specific engagement signal; read it alongside comment_count. |
favorite_count | Favorites. |
coin_count | Coins given. Coins are a paid form of approval on Bilibili and weigh more than likes. |
share_count | Shares. null means not disclosed, not 0. |
thumbnail_url | Thumbnail link, lower resolution than image_url. |
posted_at | Publish time in ISO 8601, UTC (for example 2026-08-07T12:34:56+00:00). Non-standard strings from the platform are passed through as is, so parse defensively. null means the platform does not disclose it. |
category | Category name in the platform's own taxonomy, not normalized across platforms. |
author_name | Author's display name. |
author_id | Author's unique ID on the platform. |
author_url | Link to the author's profile on the platform. |
platform | Source platform identifier, the same as platform in the request (for example xiaohongshu, tiktok). |
tags | Array of tags. An empty array, not null, when there are none. |
user_id | User's unique ID on the platform. |
name | Name of the object itself, for account, product and business capabilities. |
bio | Profile bio written by the account; may contain line breaks and emoji. |
avatar_url | Avatar image link. Some platforms return sized CDN links that can expire. |
level | Keeps the platform's own meaning |
follower_count | Followers. null means not disclosed, not 0. |
video_count | Keeps the platform's own meaning |
is_verified | Whether the platform verified the account. null means it cannot be determined. |
verified_type | Keeps the platform's own meaning |
verified_title | Keeps the platform's own meaning |
is_live | Keeps the platform's own meaning |
live_room_id | Keeps the platform's own meaning |
is_senior_member | Keeps the platform's own meaning |
recent_video_ids | Keeps the platform's own meaning |
episode_count | Keeps the platform's own meaning |
rating | Rating. The scale varies by platform: rating_scale on the same row gives the maximum (usually 5; Booking, Douban, iQIYI and NAVER use 10). Convert with rating_scale before comparing across platforms, or the comparison can come out backwards. |
rating_scale | Maximum of rating in the same row: 5 for five-star scales, 10 for ten-point scales. Present only when the row has a rating. |
Errors and billing
#- 401
- Missing or invalid key.
- 402
- Insufficient balance. Top up first.
- 422
- Invalid parameter name or value. Fix it using the suggestions in the error. No charge.
- 429
- Per-minute request limit reached. Wait for Retry-After, then try again.
- 503
- Could not complete. The held charge is returned to your balance. If the outcome is unknown, verify it before you retry.
- 200 empty
- No data. No charge.