# 微博 用户内容 API (weibo.user_posts)

- Canonical page: https://everyinfra.com/weibo-api/user_posts
- Endpoint: POST /api/v1/social with {"platform": "weibo", "action": "user_posts", "params": {...}}
- Price: $0.000806 per call ($0.81 per 1,000 requests); failed 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

微博用户内容按 `user_id` 列出一个账号自己发的微博，最新的在前，每条带正文、发布时间、发布设备、转评赞数、图片和视频，转发微博还带被转发原微博的 ID `original_post_id`；作者的简介、粉丝数、关注数和认证说明 `author_verified_reason` 也随行返回。它回答「这个博主最近在发什么」，适合竞品账号监测、达人内容核查和舆情跟踪。每页最多 20 条，只含这个账号自己发的微博。

用 `post_type` 只看原创、视频或图片；长微博在列表里只有开头一段，全文要用内容详情读。翻页把 `next_page_token` 作为 `page_token` 传回，令牌 24 小时内有效。`limit` 传了也不生效。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| user_id | not declared | yes | not declared | 微博数字 UID，也可传含 /u/数字UID 的主页链接；不收昵称（先用 user_search 按昵称找到 user_id）。 |
| page_token | not declared | no | not declared | 翻页令牌。第一页不传；之后把上一页响应里的 next_page_token 原样传回取下一页，其余参数不变。每页最多 20 条、最新优先（条数不固定，只含这个账号自己发的微博），每页算一次调用；令牌 24 小时内有效，翻到底时响应里没有 next_page_token。 |
| post_type | enum: all / image / original / video | no | not declared | 只看哪类微博：all 全部（默认）/ original 原创 / video 视频 / image 图片。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| url | 该记录在原平台上的可访问链接。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| device | 发布设备（如「iPhone客户端」）。 |
| repost_count | 转发数（区别于引用转发）。null 表示不公开。 |
| comment_count | 评论数。null 表示不公开，不等于 0。 |
| like_count | 点赞数。null 表示该平台或该接口不公开此数据，不等于 0。 |
| view_count | 阅读数（post_detail）：微博显示的这条微博被阅读的次数；多数微博不显示阅读数，这时没有这个字段；user_posts 的列表回包里没有。 |
| is_repost | 是否为转发。 |
| original_post_id | 转发微博时，被转发的原微博 ID（post_detail / user_posts）；可作为 post_detail 的 url 传入读原微博。不是转发时没有这个键。 |
| is_long_text | 是不是长微博（post_detail / user_posts）。user_posts 上长微博的 text 只有开头一段（约 140 字）。 |
| author_id | 作者在原平台的唯一 ID。 |
| author_name | 作者昵称（显示名）。 |
| author_bio | 作者简介；作者没填时没有。 |
| author_follower_count | 作者粉丝数。null 表示不公开。 |
| author_following_count | 作者关注数。 |
| author_verified | 作者是否加 V。 |
| author_verified_reason | 认证说明（如「XX公司CEO」），判断大V身份靠它；没认证时没有。 |
| author_avatar_url | 作者头像。 |
| image_urls | 图片列表；不带图的微博没有。 |
| video_url | 视频链接；不是视频微博时没有。 |
| duration_sec | 视频时长（秒，post_detail / user_posts 的视频微博）。 |
| duration_seconds | 时长，单位秒。非视频/音频内容为 null。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |
| next_page_token | 翻页令牌（user_search、user_posts、topic_search、user_post_search）：作为下一次请求的 page_token 原样传回取下一页；同一页每行的值相同，响应顶层也有同一个 next_page_token。没有该字段即到底。 |

## 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": "weibo",
  "action": "user_posts",
  "params": {
    "user_id": "1749127163"
  }
}'
```

```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": "weibo",
        "action": "user_posts",
        "params": {
            "user_id": "1749127163",
        },
    },
    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": "weibo",
  "action": "user_posts",
  "results": [
    {
      "id": …,
      "url": …,
      "text": …,
      "posted_at": …,
      "device": …,
      "repost_count": …,
      "comment_count": …,
      "like_count": …,
      "view_count": …,
      "is_repost": …,
      "original_post_id": …,
      "is_long_text": …,
      "author_id": …,
      "author_name": …,
      "author_bio": …,
      "author_follower_count": …,
      "author_following_count": …,
      "author_verified": …,
      "author_verified_reason": …,
      "author_avatar_url": …,
      "image_urls": …,
      "video_url": …,
      "duration_sec": …,
      "duration_seconds": …,
      "platform": …,
      "next_page_token": …
    }
  ],
  "next_page_token": …,
  "pagination": { … },
  "count": …,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### 为什么有的微博正文只有一段？

那是长微博。`is_long_text` 为 true 时，列表里的 `text` 只有开头约 140 字；把这一条的 `id` 传给微博内容详情，就能读到全文；微博显示阅读数的话，详情里还有 `view_count`。`is_long_text` 为 false 的微博，`text` 本身就是正文，不用再补读。批量补全时，先筛出 `is_long_text` 为 true 的行，只对这些 `id` 调详情，能省下对短微博的调用。

### 怎么只看原创内容？

`post_type` 传 `original`，只返回这个账号自己写的原创微博，不含转发。分析一个博主的观点和内容风格时，先排除转发，结论更干净。`post_type` 默认是 `all`，也就是不筛选；想单独分析视频或图片微博，传 `video` 或 `image`。转发的微博在 `original` 下不出现，要分析转发行为就用 `all`，再按 `is_repost` 分开；转发微博的 `original_post_id` 指向被转发的原微博。

### 怎么判断一个账号是不是大 V？

看每行带的 `author_verified` 和 `author_verified_reason`：前者表示是否加 V，后者是认证说明，比如某公司 CEO，身份要靠它判断。粉丝数 `author_follower_count` 可以作为影响力的补充参考。没认证的账号没有 `author_verified_reason`，作者没填简介时没有 `author_bio`，按字段缺失判断，别当成空字符串。`author_follower_count` 为 null 是不公开，不等于 0。

## Also

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