# 微博 关键词搜索 API (weibo.search)

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

微博关键词搜索按 `keyword` 检索公开微博，返回正文、发布时间、发布设备、转发评论点赞数、是否转发，以及作者的昵称、简介、粉丝数、是否加 V 和认证说明，并带图片和视频链接。它回答「这个话题在微博上谁在说、说了什么、传播如何」，适合做舆情监测、品牌声量统计和寻找关键意见领袖。

判断大 V 身份看 `author_verified_reason`，它写明认证说明；`author_follower_count` 衡量影响范围。统计原创声量时，可以用 `is_repost` 把转发剔除。热搜榜不需要关键词，用微博的热榜能力读取。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| keyword | not declared | yes | not declared | search 的公开微博检索词；trending 无需关键词，返回热搜条目而非用户帖子列表。 |
| limit | integer (1–50) | no | 20 | 这次调用最多返回的条数，整数，1–50；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## 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。 |
| is_repost | 是否为转发。 |
| 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 | 视频链接；不是视频微博时没有。 |
| 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": "weibo",
  "action": "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": "weibo",
        "action": "search",
        "params": {
            "keyword": "城市骑行",
        },
    },
    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": "weibo",
  "action": "search",
  "results": [
    {
      "id": "•••",
      "url": "https://weibo.com/2590508284/5347470118748545",
      "text": "【层林逐风  赛道如画｜2026环北京·门头沟国际公路自行车赛第二日激战正酣】9月26日，为期三天的2026环北京·门头沟国际公路自行车赛进入第二个比赛日。本届赛事为国际自行车联盟（UCI）认证的2.2级亚洲巡回赛事，共吸引来自11个国家和地区的21支队伍的百余名职业车手及约3000名自行车爱好者参与，职业组总赛程超过340公里。赛事历时三日，设斋堂耐力、京西山地、城市绕圈三大特色赛段；当日举行的第二赛段——京西山地赛段，是爬坡难度最高、参与人群覆盖面最广的赛段，设职业组、大众骑游39公里组与大众骑游9公里组三个组别。本届赛事是2026京西国际山地户外季…",
      "posted_at": "Sat Sep 26 18:48:09 +0800 2026",
      "device": "HUAWEI Mate 60 Pro",
      "repost_count": 0,
      "comment_count": 0,
      "like_count": 1,
      "is_repost": false,
      "author_id": "•••",
      "author_name": "•••",
      "author_verified": true,
      "author_avatar_url": "https://tvax3.sinaimg.cn/•••",
      "image_urls": [
        "https://wx2.sinaimg.cn/orj1080/9a6804fcly1ihh9kjk3d5j20zk0npk68.jpg",
        "https://wx2.sinaimg.cn/orj1080/9a6804fcly1ihh9kjj04hj20nl0fq7b6.jpg",
        "https://wx3.sinaimg.cn/orj1080/9a6804fcly1ihh9kjp5dwj20tw13wqis.jpg"
      ],
      "platform": "weibo"
    },
    {
      "id": "•••",
      "url": "https://weibo.com/3075210951/5347460012838223",
      "text": "#九九骑行节# #九号城市主理人#",
      "posted_at": "Sat Sep 26 18:08:01 +0800 2026",
      "device": "iPhone客户端",
      "repost_count": 0,
      "comment_count": 0,
      "like_count": 0,
      "is_repost": true,
      "author_id": "•••",
      "author_name": "•••",
      "author_verified": false,
      "author_avatar_url": "https://tvax1.sinaimg.cn/•••",
      "video_url": "http://f.video.weibocdn.com/o0/gFJZA5WElx08AYxj2Opi01041201pS5N0E010.mp4?label=mp4_720p&template=1280x720.25.0&ori=0&ps=1CwnkDw1GXwCQx&Expires=1790423648&ssig=S036CI1rO4&KID=unistore,video",
      "platform": "weibo"
    }
  ],
  "count": 20,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### 怎么只统计原创微博？

用 `is_repost` 过滤：为真表示这条是转发，统计原创声量时剔除它们；`repost_count` 则是这条微博被转发的次数，可以用来衡量扩散程度。

### 怎么识别发帖人是不是大 V？

先看 `author_verified` 是否加 V，再看 `author_verified_reason` 的认证说明，比如某公司负责人；结合 `author_follower_count` 判断影响范围。

### 能拿到热搜榜吗？

关键词搜索返回的是包含关键词的微博。热搜榜不需要关键词，请用微博的热榜能力读取，它返回的是热搜条目，不是帖子列表。

## 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
