# 微信公众号 搜索联想 API (wechat_oa.search_suggestions)

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

搜索联想按 `keyword` 返回一组相关推荐词 `suggestions` 和它们的数量 `count`。一次调用得到的是一个对象，不是文章或公众号的列表。围绕一个词想扩出更多说法、给文章和公众号搜索补候选词，可以先走这个接口。参数示例填的是「科技」这样的宽泛词。

`keyword` 填一个关键词即可。联想词本身不带热度；要比较几个词谁更热，把它们逐个交给微信指数那一页，对照最新指数值和走势。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| keyword | not declared | yes | not declared | article_search 搜文章，account_search 搜公众号，mini_program_search 搜小程序，search_suggestions 取联想词，wechat_index 取关键词指数；这些都不是个人微信聊天搜索。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| suggestions | 相关推荐词。 |
| count | 数量。 |
| 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": "search_suggestions",
  "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": "search_suggestions",
        "params": {
            "keyword": "科技",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-11-07T14:47:42Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "wechat_oa",
  "action": "search_suggestions",
  "results": {
    "suggestions": [
      "科技",
      "科技馆",
      "东鑫科技"
    ],
    "count": 10,
    "platform": "wechat_oa"
  },
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### 联想词和搜索结果有什么区别？

联想词只是相关推荐词，返回的对象里只有 `suggestions` 和 `count`，没有文章、公众号或小程序的明细。要看具体内容，把联想出来的词再传给对应的搜索接口，文章搜索、公众号搜索和小程序搜索都用同一个 `keyword`，同一个词能分别看三类结果。

### 怎么判断联想出来的词值不值得做？

联想接口不带热度，要先把候选词逐个交给微信指数那一页，读各自的最新指数值和走势，再按数值挑词。指数接口返回最新指数值、日期和走势序列，联想接口不返回这些。

### `keyword` 能搜微信聊天记录里的内容吗？

不能。`keyword` 用于公众号一侧的文章、公众号、小程序搜索，以及联想和指数，不是个人微信聊天搜索，读不到个人聊天内容。联想接口一次只返回一个对象，里面没有文章列表，也没有分页。

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