# B站 账号搜索 API (bilibili.user_search)

- Canonical page: [https://everyinfra.com/bilibili-api/user_search](https://everyinfra.com/bilibili-api/user_search?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "bilibili", "action": "user_search", "params": {...}}
- Price: $0.000556 per call ($0.56 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=user_search

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| keyword | not declared | yes | not declared | 按昵称或关键词找 B 站用户，例如 原神；返回的 user_id 可接着查 profile、user_posts、followers。 |
| page_token | not declared | no | not declared | 翻页令牌。第一页不传；之后把上一页响应里的 next_page_token 原样传回取下一页，其余参数不变。每页最多 20 个用户，每页算一次调用；limit 不起作用。令牌 24 小时内有效，翻到底时响应里没有 next_page_token。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| user_id | 用户在原平台的唯一 ID。 |
| name | 名称。用于账号/商品/商家类能力，指该对象本身的名字。 |
| url | 该记录在原平台上的可访问链接。 |
| bio | 个人简介，账号自己填写的文本。可能含换行和 emoji。 |
| avatar_url | 头像图片链接。部分平台给的是带尺寸参数的 CDN 链接，可能有时效。 |
| level | 用户等级（0–6）。 |
| follower_count | 粉丝数。null 表示不公开，不等于 0。 |
| video_count | 视频数。 |
| is_verified | 是否为平台认证账号（蓝V等）。null 表示无法判定。 |
| verified_type | 认证类型（user_search、general_search 的用户行）：personal 个人认证、organization 机构认证；没认证时没有。 |
| verified_title | 认证头衔（如「知名UP主」）。 |
| is_live | 这个用户现在是不是在直播（user_search、general_search 的用户行）；不在直播时可能没有这个字段。 |
| live_room_id | 用户的直播间号（user_search、general_search 的用户行）；没开过直播间时没有。 |
| is_senior_member | 是不是硬核会员（user_search、general_search 的用户行）；不是时没有这个字段。 |
| recent_video_ids | 这个用户最近几个视频的 BV 号（user_search、general_search 的用户行），数组，可作为 video 的 url 传入。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |

## 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": "user_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": "user_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 20. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "bilibili",
  "action": "user_search",
  "results": [
    {
      "user_id": "•••",
      "name": "编•••",
      "url": "https://space.bilibili.com/•••",
      "avatar_url": "https://i1.hdslb.com/•••",
      "level": 5,
      "follower_count": 250,
      "video_count": 28,
      "is_verified": false,
      "live_room_id": "26882677",
      "recent_video_ids": [
        "BV1QhdHY4EEc",
        "BV1ej411v7dp",
        "BV1Em4y187Ji"
      ],
      "platform": "bilibili"
    },
    {
      "user_id": "•••",
      "name": "动•••程",
      "url": "https://space.bilibili.com/•••",
      "avatar_url": "https://i2.hdslb.com/•••",
      "level": 6,
      "follower_count": 110367,
      "video_count": 130,
      "is_verified": true,
      "verified_type": "organization",
      "verified_title": "动画讲编程官方账号",
      "live_room_id": "22732641",
      "recent_video_ids": [
        "BV18H4y1c7dW",
        "BV1Ym42137k8",
        "BV1Uz421z7ay"
      ],
      "platform": "bilibili"
    }
  ],
  "next_page_token": …,
  "pagination": { … },
  "count": 20,
  "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
