# 微信公众号 文章搜索 API (wechat_oa.article_search)

- Canonical page: [https://everyinfra.com/wechat-oa-api/article_search](https://everyinfra.com/wechat-oa-api/article_search?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "wechat_oa", "action": "article_search", "params": {...}}
- Price: $0.008 per call ($8 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, default 20, max 400 per call
- Mode: sync; add "mode": "async" for slow tasks

微信公众号文章搜索按 `keyword` 检索公众号文章，返回标题、摘要、文章链接、封面图、公众号名称和发布时间。它回答「这个话题在公众号上有哪些文章、谁在写」，适合做行业资讯监测、舆情收集、寻找合作公众号和搭建选题库。

可以用 `category` 选栏目：ALL 全部、LATEST 最新、HOT 热门；FOLLOWED 和 RECENT_READ 与个人登录状态有关，这里没有你的微信登录态，不保证可用，也不会读取你的关注和阅读记录。`posted_at` 是标准时间，`relative_time` 是「3天前」这类相对描述，按时间排序请用前者。要读全文可以打开 `url`。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| keyword | not declared | yes | not declared | article_search 搜文章，account_search 搜公众号，mini_program_search 搜小程序，search_suggestions 取联想词，wechat_index 取关键词指数；这些都不是个人微信聊天搜索。 |
| category | not declared | no | not declared | 仅 article_search 的文章栏目：ALL 全部、LATEST 最新、HOT 热门、FOLLOWED 已关注、RECENT_READ 最近读过；后两项依赖微信登录状态，这里不使用你的登录，不保证有结果，也不会读取你的个人关注或阅读记录。 |
| sub_type | not declared | no | not declared | category 的兼容字段，同样使用五个文章栏目值，传入会转大写；两者同时出现时 category 优先。 |
| limit | integer (1–400) | no | 20 | 这次调用最多返回的条数，整数，1–400；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| title | 标题。平台无标题概念时（如纯文本帖）为 null。 |
| summary | 摘要。 |
| url | 该记录在原平台上的可访问链接。 |
| cover_image_url | 封面图。 |
| account_name | 公众号名称。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| relative_time | 相对时间描述（如「3天前」）。 |
| kind | 条目类别。 |
| 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": "wechat_oa",
  "action": "article_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": "wechat_oa",
        "action": "article_search",
        "params": {
            "keyword": "城市更新",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-10-24T18:28:34Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed; the list keeps the first 2 of 18. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "wechat_oa",
  "action": "article_search",
  "results": [
    {
      "title": "城市更新的八大类型及典型案例分析(含城市更新专题)",
      "summary": "城市更新涉及范围广、主体多、建设任务纷繁复杂.中共中央办公厅、国务院办公厅《关于持续推进城市更新行动的意见》,将城市更...",
      "url": "https://mp.weixin.qq.com/s?src=11&timestamp=1792868283&ver=7046&signature=*kBvA0oukPYHXfmpZWB8cGEugO6pKS0z0G92kHumYr3SO2wiEAGXPgRFIhHBwGjs86NVY6sKC3E-0*IaVBC8XRM3Qb3zBoeF2nH4x6l0S8JKbSmgSBy6PlE2GXzT9uOi&new=1",
      "cover_image_url": "https://mmbiz.qpic.cn/sz_mmbiz_jpg/C4sz9kVVx1mva20LCAFC8cTARSIAFo3sBiaEuRhDD1d5n5YCHbZiajFd7eRR5DNE00zpn4f1fWB7IVsrO3WRbM9V7IEHweQautrnpxprcnIvE/0?wx_fmt=jpeg",
      "platform": "wechat_oa"
    },
    {
      "title": "李迎伟主持研究城市更新工作",
      "summary": "李迎伟主持研究城市更新工作提标提速推动城市更新试点任务努力打造具有江汉平原特色的现代化人民城市10月24日,市委书记李迎伟...",
      "url": "https://mp.weixin.qq.com/s?src=11&timestamp=1792868283&ver=7046&signature=gzDMFycW6XM4lIXPZ4-qV6LZtQ9JRqDobvYNMGB*W72r5GzoRJTTcH4Y6VZ80RU45fRbEl*bLgZQ548peOPI59SvamTDpdthJzT4BoTP2ueI5lt1ZdS788YtogIxWaYc&new=1",
      "cover_image_url": "https://mmbiz.qpic.cn/sz_mmbiz_jpg/6UUD1kjmksibLZqt2kgvS0BGYyGIeqzTBOnCiceTicp8BL2OM0SUCwIWcs0fWnPB30CpBeCngicRejeK6T3o0tb8pjOKrO3xkYKl1dMKOcNTUs8/0?wx_fmt=jpeg",
      "platform": "wechat_oa"
    }
  ],
  "count": 18,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### `category` 应该怎么选？

常用 ALL 全部、LATEST 最新和 HOT 热门。FOLLOWED 已关注和 RECENT_READ 最近读过依赖个人登录状态，这里不传入你的微信登录态，所以不保证可用。`sub_type` 是兼容写法，两者同时出现时以 `category` 为准。

### 这和在微信里搜文章一样吗？

这里检索的是公众号文章，不是个人微信聊天或朋友圈，也不会读取你的关注和阅读记录。结果顺序取决于所选栏目，和你在自己手机上搜到的不一定相同。

### 搜索结果里的 `url` 能直接拿去读评论或互动数据吗？

不一定能。搜索结果给的多是带 signature、timestamp 参数的临时链接，文章评论、评论回复和互动数据这几个能力读不了时，会在扣费前返回 422。先在浏览器里打开文章，复制它自己的链接（/s/ 开头的短链，或带 __biz、mid、idx、sn 的链接）再传。

## Also

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