# 微信综合搜索（搜一搜）

`POST /api/wechat-search/fetch_search`

- 微信「搜一搜」综合搜索，垂类由 business_type 字符串键切换，传关键词即可。
- 可搜公众号 / 文章 / 视频号视频 / 直播 / 朋友圈 / 新闻 / 读书 / 图片 / 百科 / 微信指数等垂类。

:::highlight yellow 💡
由于微信服务器原因，本接口响应较慢，请将客户端请求超时（timeout）设置为 30 秒；timeout 设置过小会造成已扣费但收不到响应的情况。
:::

## 鉴权

源接口未声明鉴权要求，请结合接入指南确认。

## 请求参数



| 字段 | 位置 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- | --- |
| Authorization | header | string | 是 | 在 Header 添加参数 Authorization，其值为在 Bearer 之后拼接 apikey · default: "Bearer YOUR_API_KEY" |
| Content-Type | header | string | 是 |  · default: "application/json" |

## 请求体 · application/json



| 字段 | 位置 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- | --- |
| keyword | body | string | 是 |  |
| business_type | body | string | 否 | 可选，默认 all。仅支持 ：综合 all / 公众号 account / 文章 article / 视频 video / 直播 live_stream / 朋友圈 moments / 新闻 news / 读书 book / 听书 listen / 图片 image / 百科 encyclopedia / 微信指数 weixin_index，传其他值将直接报错。 |
| sort | body | integer | 否 | 可选，默认 default。排序（结果页「排序」下拉，综合与各垂类通用）—— 不限(相关性) default/0 / 最新(发布时间降序) latest/1 / 最热(点赞降序) hot/2，字符串值或整数值均可 |
| publish_time | body | integer | 否 | 可选，默认 all。发布时间（结果页「时间」下拉，通用）—— 不限 all/0 / 最近一天 day/1 / 最近七天 week/2 / 最近半年 half_year/3，字符串值或整数值均可 |
| offset | body | integer | 否 | 可选，默认 0（>=0）。翻页游标。首页传 0；翻页时把上一页响应里返回的 offset 传回（配合 continue_flag 判断是否还有下一页）。 |
| raw | body | boolean | 否 | 可选，默认 false。true=原始；false=精简解析。 |

```json
{
  "type" : "object",
  "properties" : {
    "keyword" : {
      "type" : "string",
      "title" : "关键词"
    },
    "business_type" : {
      "type" : "string",
      "description" : "可选，默认 all。仅支持 ：综合 all / 公众号 account / 文章 article / 视频 video / 直播 live_stream / 朋友圈 moments / 新闻 news / 读书 book / 听书 listen / 图片 image / 百科 encyclopedia / 微信指数 weixin_index，传其他值将直接报错。"
    },
    "sort" : {
      "type" : "integer",
      "description" : "可选，默认 default。排序（结果页「排序」下拉，综合与各垂类通用）—— 不限(相关性) default/0 / 最新(发布时间降序) latest/1 / 最热(点赞降序) hot/2，字符串值或整数值均可"
    },
    "publish_time" : {
      "type" : "integer",
      "description" : "可选，默认 all。发布时间（结果页「时间」下拉，通用）—— 不限 all/0 / 最近一天 day/1 / 最近七天 week/2 / 最近半年 half_year/3，字符串值或整数值均可"
    },
    "offset" : {
      "type" : "integer",
      "description" : "可选，默认 0（>=0）。翻页游标。首页传 0；翻页时把上一页响应里返回的 offset 传回（配合 continue_flag 判断是否还有下一页）。"
    },
    "raw" : {
      "type" : "boolean",
      "description" : "可选，默认 false。true=原始；false=精简解析。"
    }
  },
  "required" : [ "keyword" ]
}
```

```json
{
  "keyword" : "罗永浩",
  "business_type" : "all",
  "sort" : 0,
  "publish_time" : 0,
  "offset" : 0,
  "raw" : false
}
```

## 响应 200 · application/json



| 字段 | 位置 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- | --- |
| code | body | integer | 是 |  |
| message | body | string | 是 |  |
| data | body | object | 是 |  |

```json
{
  "type" : "object",
  "properties" : {
    "code" : {
      "type" : "integer"
    },
    "message" : {
      "type" : "string"
    },
    "data" : {
      "type" : "object",
      "properties" : { }
    }
  },
  "required" : [ "code", "message", "data" ]
}
```

```json
{
  "code" : 200,
  "message" : "success",
  "data" : { }
}
```

## cURL

```sh
curl --globoff --request POST 'https://api.getoneapi.com/api/wechat-search/fetch_search' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "keyword" : "罗永浩",
  "business_type" : "all",
  "sort" : 0,
  "publish_time" : 0,
  "offset" : 0,
  "raw" : false
}'
```

