# Bilibili General search API (bilibili.general_search)

- Canonical page: [https://everyinfra.com/en/bilibili-api/general_search](https://everyinfra.com/en/bilibili-api/general_search?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "bilibili", "action": "general_search", "params": {...}}
- Price: $0.000792 per call ($0.79 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, one page of up to 20 per call; the number of rows varies from page to page and a short page is not the end (limit is ignored; pass the top-level next_page_token from the response as page_token for the next page; no next_page_token means the end)
- Pagination: pass next_page_token back as page_token for the next page, other params unchanged; one call per page, tokens last 24 hours
- Mode: sync; add "mode": "async" for slow tasks

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=bilibili&action=general_search

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| keyword | not declared | yes | not declared | 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 | not declared | no | not declared | 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`. |

## Response fields (items in `results`)

| 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 | platform-native 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 | platform-native meaning |
| follower_count | Followers. null means not disclosed, not 0. |
| video_count | platform-native meaning |
| is_verified | Whether the platform verified the account. null means it cannot be determined. |
| verified_type | platform-native meaning |
| verified_title | platform-native meaning |
| is_live | platform-native meaning |
| live_room_id | platform-native meaning |
| is_senior_member | platform-native meaning |
| recent_video_ids | platform-native meaning |
| episode_count | platform-native 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. |

## Example

```bash
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": "编程"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "bilibili",
        "action": "general_search",
        "params": {
            "keyword": "编程",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-11-21T07:17:18Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed; the list keeps the first 2 of 17. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "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": { … }
}
```

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=bilibili
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
