# 微信公众号 公众号搜索 API (wechat_oa.account_search)

- Canonical page: [https://everyinfra.com/wechat-oa-api/account_search](https://everyinfra.com/wechat-oa-api/account_search?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "wechat_oa", "action": "account_search", "params": {...}}
- Price: $0.016 per call ($16 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` 检索公众号，返回候选列表：`account_id`、名称 `name`、简介 `description`、自定义微信号 `alias`、认证标记 `verify_flag`、头像和 `biz` 等。只知道名称、不知道账号标识时找号，或按行业词扫一遍同类公众号，就从这个接口开始。

默认只给 20 个，按行业词扫同类号时可以把 `limit` 提到 400。`keyword` 搜的是公众号，不是文章。结果里的 `alias` 是公众号自定义的微信号，可以填进公众号资料或主体信息接口的账号参数，继续读单个号的详细资料。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| keyword | not declared | yes | not declared | article_search 搜文章，account_search 搜公众号，mini_program_search 搜小程序，search_suggestions 取联想词，wechat_index 取关键词指数；这些都不是个人微信聊天搜索。 |
| limit | integer (1–400) | no | 20 | 这次调用最多返回的条数，整数，1–400；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| account_id | 公众号 ID。 |
| ghid | 同 account_ghid。 |
| name | 名称。用于账号/商品/商家类能力，指该对象本身的名字。 |
| description | 简介或描述，通常比 text 短。 |
| alias | 公众号自定义的微信号。 |
| avatar_url | 头像图片链接。部分平台给的是带尺寸参数的 CDN 链接，可能有时效。 |
| verify_flag | 认证标记。 |
| biz | 公众号的 __biz 参数，文章链接里带的标识。 |
| 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": "account_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": "account_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 14. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "wechat_oa",
  "action": "account_search",
  "results": [
    {
      "ghid": "gh_021a2971bb29",
      "name": "科•••兽",
      "description": "•••",
      "alias": "KeJiShouX",
      "avatar_url": "http://mmbiz.qpic.cn/•••",
      "verify_flag": 1,
      "biz": "•••",
      "platform": "wechat_oa"
    },
    {
      "ghid": "gh_1306e540f321",
      "name": "惠•••技",
      "description": "•••",
      "alias": "",
      "avatar_url": "http://mmecoa.qpic.cn/•••",
      "verify_flag": 1,
      "biz": "•••",
      "platform": "wechat_oa"
    }
  ],
  "count": 14,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### 搜到好几个同名公众号，怎么挑？

对照 `verify_flag`（认证标记）、`alias`（自定义微信号）和 `description`（简介），再用 `account_id`、`ghid` 或 `biz` 去重。确认是哪个以后，再去公众号资料接口读它的详细档案。

### 搜索结果里有公司名和运营者吗？

没有。这里是候选列表，只带名称、简介、微信号、认证标记等；公司名称、运营者和注册信息在公众号主体信息接口里，把选中的账号交给它。

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