# 微信公众号 小程序搜索 API (wechat_oa.mini_program_search)

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

小程序搜索按 `keyword` 检索小程序，返回一个列表：`id`、名称 `name`、简介 `description`、图标 `icon_url`、用户名 `username`，以及是否为小游戏关联账号 `is_minigame`。梳理一个品类里有哪些竞品小程序，或查某个品牌有没有上线小程序，从这里入手。

默认返回 20 条，单次最多 400 条，需要更全的候选就把 `limit` 调大。`is_minigame` 把小游戏关联账号和其他小程序分开；`username` 是 @handle 形式的用户名。要拿相关词，另用搜索联想，它返回的是推荐词，不是小程序列表。

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=wechat_oa&action=mini_program_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–30) | no | 30 | 这次调用最多返回的条数，整数，1–30；不传按默认值，实际返回可能少于这个数。超过上限照收，按上限返回。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| name | 名称。用于账号/商品/商家类能力，指该对象本身的名字。 |
| description | 简介或描述，通常比 text 短。 |
| icon_url | 小程序图标（mini_program_search）。 |
| username | 用户名（@handle）。 |
| is_minigame | 是否为小游戏关联账号。 |
| 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": "mini_program_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": "mini_program_search",
        "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; 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": "wechat_oa",
  "action": "mini_program_search",
  "results": [
    {
      "id": "wx3107f0a218053d99",
      "name": "科技侠智能锁",
      "description": "通过手机开锁",
      "icon_url": "http://mmbiz.qpic.cn/mmbiz_png/DtMRIk9mzbbKl312P5IibZh3tcdGXahozyGZyMxSLpIJGDgMtX73icAN9BmENBibeFE2xXibO46yoWVWrzpB1IpseQ/640?wx_fmt=png&wxfrom=200",
      "username": "g•••p",
      "is_minigame": false,
      "platform": "wechat_oa"
    },
    {
      "id": "wx674a0dc0f3ef4ff1",
      "name": "越弘科技",
      "description": "专注于服饰及周边行业15年，专为中小型服饰公司做ERP的公司",
      "icon_url": "http://mmbiz.qpic.cn/sz_mmbiz_png/lA9SBFBPsUsiawEyKsftgzKyoB31q17BGeUhyCC9ErRKzDbaM1tKd7xbqZ5KPL6ql60Ztnstk5EXGeCLm0VLPQQ/640?wx_fmt=png&wxfrom=200",
      "username": "g•••p",
      "is_minigame": false,
      "platform": "wechat_oa"
    }
  ],
  "count": 20,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### 怎么只保留小游戏？

用 `is_minigame` 过滤：为真的是小游戏关联账号，其余是别的小程序。接口没有单独的类型参数，这一步要拿到结果后在本地做。

### 返回的是小程序还是公众号？

是小程序。每条有 `name`、`description` 和 `icon_url`，`username` 是 @handle 形式的用户名。要找公众号，改用公众号搜索，同样传 `keyword`，但返回的字段不同。`name` 是小程序自己的名字，不是开发者或公司的名字，`description` 是简介，通常比正文短。

### `id` 能当小程序的唯一标识吗？

在同一平台内可以，跨平台可能重复。入库时把 `id` 和 `platform` 一起作键，避免和别的平台的记录撞号。

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