# B站 用户内容 API (bilibili.user_posts)

- Canonical page: https://everyinfra.com/bilibili-api/user_posts
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "bilibili", "action": "user_posts", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, default 20, max 50 per call
- 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_posts

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| user_id | not declared | yes | not declared | B 站 UP 主的数字 mid，即 https://space.bilibili.com/<mid> 中的数字。将数字放入 user_id，不要把昵称、BV 号或整个主页链接填入这个参数。 |
| limit | integer (1–50) | no | 20 | 这次调用最多返回的条数，整数，1–50；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| url | 该记录在原平台上的可访问链接。 |
| title | 标题。平台无标题概念时（如纯文本帖）为 null。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| duration_seconds | 时长，单位秒。非视频/音频内容为 null。 |
| duration_sec | platform-native meaning |
| duration_text | 时长的展示文本（如 12:34）。 |
| view_count | 浏览/播放数。null 表示不公开，不等于 0。 |
| like_count | 点赞数。null 表示该平台或该接口不公开此数据，不等于 0。 |
| comment_count | 评论数。null 表示不公开，不等于 0。 |
| danmaku_count | 弹幕数。**B站特有的互动指标，与评论数并列看活跃度**。 |
| favorite_count | 收藏数。 |
| coin_count | 投币数。B站的付费级好评，比点赞含金量高。 |
| share_count | 分享/转发数。null 表示不公开，不等于 0。 |
| thumbnail_url | 缩略图链接，分辨率低于 image_url。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| category | 分类名称，取值为原平台的分类体系，未做跨平台归一。 |
| author_name | 作者昵称（显示名）。 |
| author_id | 作者在原平台的唯一 ID。 |
| author_url | 作者在原平台的主页链接。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |
| tags | 标签数组。无标签时为空数组，不是 null。 |

## 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_posts",
  "params": {
    "user_id": "946974"
  }
}'
```

```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_posts",
        "params": {
            "user_id": "946974",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-09-26T08:56:04Z. `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_posts",
  "results": [
    {
      "id": "BV1J7hE6aEDQ",
      "url": "https://www.bilibili.com/video/BV1J7hE6aEDQ",
      "title": "比电影更夸张？专业保镖到底在做什么？",
      "text": "在各类作品中，保镖似乎总是训练有素，配备着神奇的装备，能在危险发生的瞬间救下目标。这次我们请来了从事保镖工作30多年的李旭老师，一起拉片看看影视作品中的保镖，和现实中到底一不一样？如果你喜欢这期视频，请多多支持我们，并把视频分享给你的朋友们一起看看～",
      "duration_seconds": 785,
      "duration_text": "13:5",
      "view_count": 6841247,
      "like_count": 306228,
      "comment_count": 6721,
      "danmaku_count": 10173,
      "favorite_count": 70707,
      "thumbnail_url": "https://i0.hdslb.com/bfs/archive/6646bc361d2c9f37b009317725abc242a6bd23cd.jpg",
      "posted_at": "2026-09-22T09:00:00+00:00",
      "category": "数码",
      "author_name": "•••",
      "author_id": "946974",
      "author_url": "https://space.bilibili.com/946974",
      "platform": "bilibili",
      "tags": [
        "4K",
        "冷知识",
        "知识"
      ]
    },
    {
      "id": "BV1FMhv6CEKL",
      "url": "https://www.bilibili.com/video/BV1FMhv6CEKL",
      "title": "动态征集｜和影视飓风一起上太空🚀",
      "text": "朋友们，邀请大家一起来做一件很酷的事！",
      "duration_seconds": 57,
      "duration_text": "0:57",
      "view_count": 733511,
      "like_count": 75740,
      "comment_count": 1857,
      "danmaku_count": 551,
      "favorite_count": 7620,
      "thumbnail_url": "https://i2.hdslb.com/bfs/archive/7a53628488f9499c7ba4816b5c7ba8b1083167b9.jpg",
      "posted_at": "2026-09-21T03:05:07+00:00",
      "category": "数码",
      "author_name": "•••",
      "author_id": "946974",
      "author_url": "https://space.bilibili.com/946974",
      "platform": "bilibili",
      "tags": [
        "和影视飓风一起上太空",
        "影视飓风",
        "太空"
      ]
    }
  ],
  "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
