微信综合搜索(搜一搜)/WeChat Universal Search

WeChat Searchapi

About

微信综合搜索(搜一搜)/WeChat Universal Search

Documentation

微信综合搜索(搜一搜)/WeChat Universal Search

[中文]

用途:

  • 微信「搜一搜」综合搜索,垂类由 business_type 字符串键切换,传关键词即可。
  • 可搜公众号 / 文章 / 视频号视频 / 直播 / 朋友圈 / 新闻 / 读书 / 图片 / 百科 / 微信指数等垂类。
  • 价格:0.01$/次
  • ⏱️ 由于微信服务器原因,本接口响应较慢,请将客户端请求超时(timeout)设置为 30 秒;timeout 设置过小会造成已扣费但收不到响应的情况。
  • ⚠️ 大整数 ID 精度:响应中的 docID / feedNonceId 等为 64 位大整数,超出 JavaScript 安全整数范围(2^53-1)。请始终以字符串方式接收 / 传递这类 ID(解析 JSON 用 json-bigint 或按文本取值),勿让其经过 JS Number。Swagger UI 文档页对超大整数会末位舍入显示,属正常现象,不影响接口实际返回的数据。

参数:

  • keyword: 搜索关键词(去空白后 1-100 字)。示例 人民日报
  • business_type: 可选,默认 all。垂类字符串键,仅支持 —— 综合 all / 公众号,视频号,服务号 account / 文章 article / 视频 video / 直播 live_stream / 朋友圈 moments / 新闻 news / 读书 book / 听书 listen / 图片 image / 百科 encyclopedia / 微信指数 weixin_index,传其他值将直接报错(422)。
  • sort: 可选,默认 default。排序(结果页「排序」下拉,综合与各垂类通用)—— 不限(相关性) default/0 / 最新(发布时间降序) latest/1 / 最热(点赞降序) hot/2,字符串键或整数均可,非法值报错(400)。
  • publish_time: 可选,默认 all。发布时间(结果页「时间」下拉,通用)—— 不限 all/0 / 最近一天 day/1 / 最近七天 week/2 / 最近半年 half_year/3,字符串键或整数均可,非法值报错(400)。
  • offset: 可选,默认 0(>=0)。首页传 0翻页请用 cursor,只传 offset 无效(每页都回到第一页)。
  • cursor: 可选。翻页游标。首页留空;翻页时把上一页响应里返回的 cursor 原样传回(须同时重复上一页的 sort / publish_time),配合 continue_flag 判断是否还有下一页。
  • raw: 可选,默认 True。True=原始搜索响应;False=精简解析。

💡 视频垂类专属的「时长」筛选见 /fetch_search_videosbusiness_type=video + duration)。

返回:

  • 搜索结果列表(结构随垂类略有差异)

典型链路:

  • 💡 拿视频号详情(媒体下载地址 / decode_key):搜索(video / all)的视频结果项不直接含媒体,只给 exportId(+ jumpInfo.extInfo.feedNonceId)。要下载 / 解密:取 exportId → 走视频号 V2 接口 /api/v1/wechat_channels/v2/fetch_video_detail(传 export_id)拿 mediaurl / url_token / decode_key)和明文 username。完整链路与解密说明见该接口文档。
  • 公众号结果项的 jumpInfo.userNamegh_…)可喂给公众号 V2 接口 /api/v1/wechat_mp/v2/fetch_account_profile / fetch_account_articles

响应结构与 JSON Path:

raw=false(精简解析,snake_case):

  • 关键词回填: $.data.keyword
  • 实际生效的垂类代码(如公众号=33554499): $.data.business_type
  • 结果总数(部分垂类为 null): $.data.total
  • 是否还有下一页: $.data.continue_flag
  • 翻页游标(原样回传接口的 cursor 参数取下一页): $.data.cursor
  • 服务端 offset(仅供参考,单独传回无法翻页): $.data.offset
  • 本页结果数: $.data.count
  • 拍平的结果项列表(已把各 box / subBox 的 items 合并): $.data.items[]
  • 单项(N 为下标,字段随垂类不同;以下为 account 公众号示例):
    • 标题(含 <em> 高亮): $.data.items[N].title
    • 描述: $.data.items[N].desc
    • 文档 id: $.data.items[N].docID
    • 类型名(如「公众号」): $.data.items[N].accTypeName
    • 跳转信息: $.data.items[N].jumpInfo.userName = gh_….nickName.signature
    • 视频垂类项另含 exportId(+ jumpInfo.extInfo.feedNonceId)→ 见上「典型链路」

raw=true(原始,本接口默认):

  • data 顶层: keyword / business_type / results做 items 拍平)
  • 完整结果集: $.data.results
  • 结果盒子数组: $.data.results.data[],每个 box 的结果在 $.data.results.data[M].items[]$.data.results.data[M].subBoxes[K].items[] —— 即 raw=falseitems[] 是把这些拍平后的结果。
  • 是否还有下一页: $.data.continue_flagraw=true / raw=false 均在顶层)
  • 翻页游标: $.data.cursor —— 原样回传接口的 cursor 参数取下一页;$.data.offset 仅为服务端 offset,单独传回无法翻页
  • box 内总数: $.data.results.data[M].totalCount(对应 raw=falsetotal
  • 做结果遍历建议直接用 raw=false(items 已拍平),路径更干净。

[English]

Purpose:

  • WeChat "Search" (搜一搜) universal search; the vertical is switched by the business_type string key — just pass a keyword.
  • Searches official accounts / articles / Channels videos / live streams / Moments / news / books / images / encyclopedia / WeChat Index, etc.
  • Price: $0.01 per request
  • ⏱️ Due to WeChat server latency, this endpoint responds slowly; please set your client request timeout to 30 seconds — a timeout that is too small may result in being billed without receiving the response.
  • ⚠️ Large-integer ID precision: IDs such as docID / feedNonceId in the response are 64-bit big integers beyond JavaScript's safe-integer range (2^53-1). Always receive / pass such IDs as strings (parse JSON with json-bigint or read them as text), never through JS Number. Swagger UI rounds the trailing digits of huge integers in its docs view — this is expected and does not affect the actual data returned by the API.

Parameters:

  • keyword: Search keyword (1-100 chars after trimming). E.g. 人民日报
  • business_type: Optional, default all. Vertical string key, only the following are supported — all / account / article / video / live_stream / moments / news / book / listen / image / encyclopedia / weixin_index; any other value is rejected (422).
  • sort: Optional, default default. Sort (result page "sort" dropdown, common to all verticals) — default/0 (relevance) / latest/1 (newest) / hot/2 (most liked); string key or integer, invalid values rejected (400).
  • publish_time: Optional, default all. Publish time (result page "time" dropdown, common) — all/0 / day/1 / week/2 / half_year/3; string key or integer, invalid values rejected (400).
  • offset: Optional, default 0 (>=0). Pass 0 for the first page; use cursor to paginate — offset alone does not work (it returns the first page every time).
  • cursor: Optional. Pagination cursor. Leave empty for the first page; for the next page pass back the cursor returned in the previous response (repeat the same sort / publish_time), and use continue_flag to check whether there are more pages.
  • raw: Optional, default True. True=raw search response; False=simplified parsing.

💡 The "duration" filter specific to the video vertical is available at /fetch_search_videos (business_type=video + duration).

Return:

  • Search result list (structure varies slightly by vertical)

Typical chains:

  • 💡 To get Channels video detail (media download address / decode_key): video result items from search (video / all) do not contain media directly — only exportId (+ jumpInfo.extInfo.feedNonceId). To download / decrypt: take exportId → call the Channels V2 endpoint /api/v1/wechat_channels/v2/fetch_video_detail (pass export_id) to get media (url / url_token / decode_key) and the plain username. See that endpoint's docs for the full chain and decryption notes.
  • The jumpInfo.userName (gh_…) of official account result items can be fed into the MP V2 endpoints /api/v1/wechat_mp/v2/fetch_account_profile / fetch_account_articles.

Response structure & JSON Path:

raw=false (simplified, snake_case):

  • Keyword echo: $.data.keyword
  • Effective vertical code (e.g. account=33554499): $.data.business_type
  • Total results (null for some verticals): $.data.total
  • Has next page: $.data.continue_flag
  • Pagination cursor (pass back as the cursor parameter for the next page): $.data.cursor
  • Server-side offset (informational only; passing it back alone does not paginate): $.data.offset
  • Results on this page: $.data.count
  • Flattened result item list (items of all boxes / subBoxes merged): $.data.items[]
  • Single item (N is the index; fields vary by vertical; below is an account example):
    • Title (with <em> highlight): $.data.items[N].title
    • Description: $.data.items[N].desc
    • Document id: $.data.items[N].docID
    • Type name (e.g. "公众号"): $.data.items[N].accTypeName
    • Jump info: $.data.items[N].jumpInfo (.userName = gh_…, .nickName, .signature)
    • Video vertical items also carry exportId (+ jumpInfo.extInfo.feedNonceId) → see "Typical chains" above

raw=true (raw, default for this endpoint):

  • data top level: keyword / business_type / results (items are not flattened)
  • Full result set: $.data.results
  • Result box array: $.data.results.data[]; each box's results are in $.data.results.data[M].items[] and $.data.results.data[M].subBoxes[K].items[] — the items[] of raw=false is the flattened merge of these.
  • Has next page: $.data.continue_flag (top level for both raw=true / raw=false)
  • Pagination cursor: $.data.cursor — pass it back as the cursor parameter for the next page; $.data.offset is only the server-side offset and passing it back alone does not paginate
  • Per-box total: $.data.results.data[M].totalCount (corresponds to total of raw=false)
  • For result iteration, prefer raw=false (items already flattened) for cleaner paths.

Imported from a validated TikHub OpenAPI document. Pricing must be reviewed before enabling.

Try 微信综合搜索(搜一搜)/WeChat Universal Search

Test this model in the Sandbase Playground with your own prompts.

Open in Playground

Related Models