# Xiaohongshu-V2/小红书V2 - 搜索群聊

所属目录：Xiaohongshu-V2/小红书V2

文档地址：https://doc.getoneapi.com/434903679e0

`POST https://api.getoneapi.com/api/xiaohongshu-v2/search_groups`

## 鉴权

在请求头中传递 Authorization: Bearer YOUR_API_KEY（必填）

## 请求参数

### Header 参数

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| Authorization | string | 是 | 在 Header 添加参数 Authorization，其值为在 Bearer 之后拼接 apikey<br><br>默认值： Bearer YOUR_API_KEY |
| Content-Type | string | 是 | 默认值： application/json |

### Body 参数 · application/json

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| keyword | string | 是 | 关键词<br> |
| page_no | number | 是 | 页数<br>从0开始<br><br>默认值： 0 |
| search_id | string | 否 | 搜索ID<br>翻页时传入首次搜索返回的值 |
| source | string | 否 | 来源<br>默认值： unifiedSearchGroup |
| is_recommend | enum&lt;integer&gt; | 是 | 是否推荐<br>枚举值： 0 否<br>1 是<br><br>默认值： 0 |

#### JSON Schema

```json
{
  "type" : "object",
  "properties" : {
    "keyword" : {
      "type" : "string",
      "title" : "关键词"
    },
    "page_no" : {
      "type" : "number",
      "title" : "页数",
      "description" : "从0开始",
      "default" : 0
    },
    "search_id" : {
      "type" : "string",
      "title" : "搜索ID",
      "description" : "翻页时传入首次搜索返回的值"
    },
    "source" : {
      "type" : "string",
      "title" : "来源",
      "default" : "unifiedSearchGroup"
    },
    "is_recommend" : {
      "type" : "integer",
      "enum" : [ 0, 1 ],
      "default" : 0,
      "title" : "是否推荐",
      "enumNames" : {
        "0" : "否",
        "1" : "是"
      }
    }
  },
  "required" : [ "keyword", "page_no", "is_recommend" ]
}
```

#### 示例

```json
{
  "keyword" : "美食",
  "page_no" : 0,
  "search_id" : "",
  "source" : "unifiedSearchGroup",
  "is_recommend" : 0
}
```

## 返回响应

### 响应 200 · application/json

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

#### JSON Schema

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

#### 示例

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

## 请求示例代码

```sh
curl --globoff --request POST 'https://api.getoneapi.com/api/xiaohongshu-v2/search_groups' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "keyword" : "美食",
  "page_no" : 0,
  "search_id" : "",
  "source" : "unifiedSearchGroup",
  "is_recommend" : 0
}'
```

