小程序搜索
按关键词搜索微信小程序,支持页码、偏移量和连续状态分页。用于发现与品牌、服务、主题或产品相关的小程序。
参数
| 参数 | 必填 | 类型 | 说明 | 示例 | 可选值 |
|---|---|---|---|---|---|
keyword |
必填 | string | 微信小程序网页搜索的搜索关键词。 | 咖啡 |
— |
current_page |
可选 | integer | 微信网页搜索分页的当前页码,从1开始。 | 1 |
— |
offset |
可选 | integer | 上一次响应返回的搜索结果偏移量。第一页使用0。 | 0 |
— |
cookies_buffer |
可选 | string | 由上一个微信网页搜索响应返回的不透明分页状态。第一页请留空。对于此 POST 接口,请以 application/x-www-form-urlencoded 表单体形式发送。 | — | — |
代码示例
curl -G "https://api.mofa-ai.com/v1/weixin/search_miniprogram_v1" \
-H "Authorization: Bearer $MOFA_API_KEY" \
--data-urlencode 'keyword=咖啡' \
--data-urlencode 'current_page=1' \
--data-urlencode 'offset=0'
import os
import requests
resp = requests.get(
"https://api.mofa-ai.com/v1/weixin/search_miniprogram_v1",
headers={"Authorization": f"Bearer {os.environ['MOFA_API_KEY']}"},
params={
"keyword": "咖啡",
"current_page": "1",
"offset": "0",
},
timeout=60,
)
body = resp.json()
if body["success"]:
print(body["cost_usd"], body["data"])
else:
print(body["error"], body["message"])
const url = new URL("https://api.mofa-ai.com/v1/weixin/search_miniprogram_v1");
url.search = new URLSearchParams({
keyword: "咖啡",
current_page: "1",
offset: "0",
});
const resp = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.MOFA_API_KEY}` },
});
const body = await resp.json();
if (body.success) console.log(body.cost_usd, body.data);
else console.error(body.error, body.message);
在线试用
登录后可以在这里直接调用此接口,按价格从余额扣费,失败不收费。新账户赠送 $0.50 试用额度。
响应示例
采集于 2026-11-07,耗时 1103 ms · 请求参数 {"offset": "0", "keyword": "咖啡", "current_page": "1"}
JSON
{
"success": true,
"code": 0,
"message": "success",
"request_id": "req_5f1c2a9be04d7c3a81f6e2d0",
"endpoint": "weixin.search_miniprogram_v1",
"cost_usd": 0.16,
"data": {
"code": 0,
"data": {
"ret": 0,
"data": [
{
"type": 109,
"subBoxes": [
{
"type": 91,
"boxID": "split-0x40-2-3837045692",
"count": 1,
"items": [
{
"desc": "luckin <em class=\"highlight\">coffee</em>,专业<em class=\"highlight\">咖啡</em>新鲜式:优选上等阿拉比卡<em class=\"highlight\">咖啡</em>豆,WBC世界<em class=\"highlight\">咖啡</em>大师精心拼配,门店遍布各商圈写字楼,外卖自提新鲜速达!",
"docID": "3837045692",
"style": 0,
"title": "luckin<em class=\"highlight\">coffee</em>瑞幸<em class=\"highlight\">咖啡</em>",
"source": {
"tag": [
{
"noBg": true,
"type": 3,
"title": "10万+人最近使用",
"iconUrl": "",
"iconSize": 0.0
}
],
"auth": 1,
"title": "瑞幸咖啡(北京)有限公司",
"assuredBuy": 1,
"authIconUrl": "https://search.wxqcloud.qq.com/t/fed_upload/79bfc7bc6766e841b2bfa1e6b61eba10/company_auth.svg"
},
"iconUrl": "http://mmbiz.qpic.cn/mmbiz_png/IhibnWnu9biaWTJW5PagGC5j5sk0UKqxyEyXfibdmXJwYEAMUmvOD7KjDM7UtZj6pFHibOSk1An3egDycZbBPPosVw/640?wx_fmt=png&wxfrom=200",
"service": {
"serviceList": [
{
"desc": "",
"name": "咖啡外送",
"cookie": "type=20971520; busid=mmsearch; domain=*;; sub_type=0; busid=mmsearch; domain=*;; scene=98; busid=mmsearch; domain=*;; is_home_page=0; busid=mmsearch; domain=*;; doc_biz_uin=3837045692; busid=mmsearch;…",
"jumpType": 2,
"reportId": "6866262785093907406:menu:899248",
"subScene": "2:20971520:0:98:0:6866262785093907406:::0",
"userName": "gh_fa66ea1664f1@app",
"weappUrl": "/pages/index/menu?kindId=211",
"serviceId": "6866262785093907406",
"weappAppid": "wx21c7506e98a2fe75",
"serviceExpandInfo": "&service_expand_info=0|6866262785093907406|0"
}
],
"report_iteminfo_list_str": "6866262785093907406:menu:899248"
},
"foldHide": 0,
"jumpInfo": {
"appID": "wx21c7506e98a2fe75",
"jumpType": 2,
"userName": "gh_fa66ea1664f1@app",
"appVersion": 958
},
"reportId": "3837045692:weapp:849218",
"titleTag": {
"append": [
{
"noBg": true,
"type": 5,
"title": "交易保障",
"iconUrl": "https://res.wx.qq.com/op_res/ZCjx5RTwv5pp0delKHA_tc5coHD_wmcbYCuwkVYGDvG0FoKhpPD8PBNCzabRMtminitvKQ5ZbTNmuA8a0maEeQ",
"iconSize": 12.0
}
]
},
"isMinigame": 0,
"commerceFlag": 0,
"isTwoLineExpt": false,
"report_extinfo_str": "%7B%22foldHide%22%3A0%2C%22source_tag%22%3A%2210%E4%B8%87%2B%E4%BA%BA%E6%9C%80%E8%BF%91%E4%BD%BF%E7%94%A8%22%7D%0A"
}
],
"title": "小程序",
"boxPos": 1,
"subType": 2,
"real_type": 262208,
"resultType": 0,
"totalCount": 192,
"boxMergeTag": 0,
"boxPosMerge": 1,
"boxExtraInfo": null,
"boxMergeType": 109,
"boxMergeValue": 3,
"useNativeRender": false
},
{
"type": 91,
"boxID": "split-0x40-2-3812091585",
"count": 1,
"items": [
{
"desc": "Tims会员中心",
"docID": "3812091585",
"style": 0,
"title": "Tims天好<em class=\"highlight\">咖啡</em>",
"source": {
"tag": [
{
"noBg": true,
"type": 3,
"title": "1万+人最近使用",
"iconUrl": "",
"iconSize": 0.0
}
],
"auth": 1,
"title": "提姆(上海)餐饮管理有限公司",
"authIconUrl": "https://search.wxqcloud.qq.com/t/fed_upload/79bfc7bc6766e841b2bfa1e6b61eba10/company_auth.svg"
},
"iconUrl": "http://mmbiz.qpic.cn/mmbiz_png/OtUfcGg9yLLgcnaWKl1m0yxxWltibpb3bxL4iarsibGNJuQ44EDa7ks1RXpv4GVUb5zgjfn3jp52fvQ4g7M8SicwWQ/640?wx_fmt=png&wxfrom=200",
"service": {
"serviceList": [
{
"desc": "",
"name": "点咖啡",
"cookie": "type=20971520; busid=mmsearch; domain=*;; sub_type=0; busid=mmsearch; domain=*;; scene=98; busid=mmsearch; domain=*;; is_home_page=0; busid=mmsearch; domain=*;; doc_biz_uin=3812091585; busid=mmsearch;…",
"jumpType": 2,
"reportId": "6866262996360956215:menu:929326",
"subScene": "2:20971520:0:98:0:6866262996360956215:::0",
"userName": "gh_58e6ebeaa1ea@app",
"weappUrl": "pages/menu/index",
"serviceId": "6866262996360956215",
"weappAppid": "wx061e4b9f73885f51",
"serviceExpandInfo": "&service_expand_info=0|6866262996360956215|0"
}
],
"report_iteminfo_list_str": "6866262996360956215:menu:929326"
},
"jumpInfo": {
"jumpType": 2,
"userName": "gh_58e6ebeaa1ea"
},
"reportId": "3812091585:weapp:236145",
"titleTag": {
"append": [
{
"noBg": true,
"type": 12
},
{
…
示例较长,此处截断显示。