# B站 用户动态 API (bilibili.user_dynamics)

- Canonical page: [https://everyinfra.com/bilibili-api/user_dynamics](https://everyinfra.com/bilibili-api/user_dynamics?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "bilibili", "action": "user_dynamics", "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 12 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_dynamics

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| user_id | not declared | yes | not declared | B 站用户的数字 mid，即 https://space.bilibili.com/<mid> 中的数字；不收昵称（先用 user_search 按昵称找到 user_id）。返回这个用户动态页的动态，视频、图文、纯文字、转发、专栏都在同一个列表里，最新的在前，置顶的排在第一页最前。 |
| page_token | not declared | no | not declared | 翻页令牌。第一页不传；之后把上一页响应里的 next_page_token 原样传回取下一页，其余参数不变。每页十来条，条数由平台决定，每页算一次调用；limit 不起作用。令牌 24 小时内有效，翻到底时响应里没有 next_page_token。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| type | 记录类型，取值随能力而定（如 video / image / text）。 |
| media_type | 动态的类型（user_dynamics）：video 视频、image 图文、text 纯文字、repost 转发、article 专栏、live 直播、episode 番剧影视、audio 音频、course 课程、other 其他；取值会增加。 |
| dynamic_type | B 站自己的动态类型名（user_dynamics），如 AV、DRAW、FORWARD、ARTICLE，原样返回。 |
| url | 该记录在原平台上的可访问链接。 |
| title | 标题。平台无标题概念时（如纯文本帖）为 null。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| video_text | 视频的简介（user_dynamics 的视频动态）；视频标题在 title。 |
| author_username | 作者用户名（@handle），通常可用于拼 URL。 |
| author_name | 作者昵称（显示名）。 |
| author_url | 作者在原平台的主页链接。 |
| author_avatar_url | 作者头像图片链接（多数平台带签名、会过期）。 |
| video_id | 视频 BV 号。 |
| thumbnail_url | 缩略图链接，分辨率低于 image_url。 |
| topic_name | 动态带的话题名（user_dynamics）；没带话题时没有这个字段。 |
| ip_location | 发布地：popular 是 B 站在视频页显示的投稿 IP 属地，省份或国家；comment_replies 是这条回复发出时的 IP 属地，B 站没显示时没有。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| author_id | 作者在原平台的唯一 ID。 |
| like_count | 点赞数。null 表示该平台或该接口不公开此数据，不等于 0。 |
| comment_count | 评论数。null 表示不公开，不等于 0。 |
| repost_count | 转发数（区别于引用转发）。null 表示不公开。 |
| image_count | 动态带了几张图（user_dynamics 的图文动态）。 |
| author_is_verified | 发布者是不是认证账号（user_dynamics）。 |
| is_pinned | 是不是置顶动态（user_dynamics）；置顶的只在第一页、排在最前，发布时间可能比后面的早。 |
| is_repost | 是不是转发（user_dynamics）；是的话原动态在 reposted_post。 |
| is_truncated | 正文是不是只给了摘要（user_dynamics）：专栏和很长的图文在动态列表里只有摘要，这时是 true。 |
| is_paid | 是不是只给充电用户看的动态（user_dynamics）；是的话正文和图片可能不返回。 |
| is_available | 被转发的原动态还能不能看（user_dynamics 的 reposted_post 里）。 |
| aid | 视频的 av 号（数字），和 BV 号指同一个视频（popular、resolve_links、media_links、user_dynamics 的视频动态）。 |
| article_id | 专栏文章的编号（user_dynamics 的专栏动态）。 |
| live_room_id | 用户的直播间号（user_search、general_search 的用户行）；没开过直播间时没有。 |
| image_urls | 图片链接数组，按平台展示顺序；没有图片时不出现这个字段。 |
| hashtags | 正文里的话题标签数组，按出现顺序；没有时不出现这个字段。 |
| mentions | 正文里 @ 到的用户昵称（comment_replies、user_dynamics），数组；没有 @ 时没有这个字段。 |
| duration_seconds | 时长，单位秒。非视频/音频内容为 null。 |
| duration_sec | 视频时长，单位秒，与 duration_seconds 同值（两个名字都返回）；video_parts 上是这一个分 P 的时长，其他能力上多 P 视频是全部分 P 的总时长。 |
| reposted_post | 被转发的原动态（user_dynamics），对象，字段同动态行，但没有点赞、评论、转发数；原动态已删除或看不了时 is_available 是 false，text 是 B 站的提示语。不是转发时没有这个字段。 |
| 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_dynamics",
  "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_dynamics",
        "params": {
            "user_id": "946974",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

No real sample for these example parameters yet: structure only, every value is a placeholder (…).

```text
{
  "id": "req_…",
  "platform": "bilibili",
  "action": "user_dynamics",
  "results": [
    {
      "id": …,
      "type": …,
      "media_type": …,
      "dynamic_type": …,
      "url": …,
      "title": …,
      "text": …,
      "video_text": …,
      "author_username": …,
      "author_name": …,
      "author_url": …,
      "author_avatar_url": …,
      "video_id": …,
      "thumbnail_url": …,
      "topic_name": …,
      "ip_location": …,
      "posted_at": …,
      "author_id": …,
      "like_count": …,
      "comment_count": …,
      "repost_count": …,
      "image_count": …,
      "author_is_verified": …,
      "is_pinned": …,
      "is_repost": …,
      "is_truncated": …,
      "is_paid": …,
      "is_available": …,
      "aid": …,
      "article_id": …,
      "live_room_id": …,
      "image_urls": …,
      "hashtags": …,
      "mentions": …,
      "duration_seconds": …,
      "duration_sec": …,
      "reposted_post": …,
      "platform": …
    }
  ],
  "next_page_token": …,
  "pagination": { … },
  "count": …,
  "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
