# Xiaohongshu/小红书 - 搜索笔记V3

所属目录：Xiaohongshu/小红书

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

> 此接口已废弃，请优先使用替代接口。

`POST https://api.getoneapi.com/api/xiaohongshu/search_note_v3`

## 鉴权

在请求头中传递 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 | number | 是 | 页数<br>从1开始<br><br>默认值： 1 |
| search_id | string | 否 | 搜索ID<br>第一次请求可不传，服务端会生成searchId，翻页时需要携带服务端返回的searchId |
| session_id | string | 否 | 会话ID<br>第一次请求可不传，服务端会生成sessionId，翻页时携带服务端返回的sessionId |
| sort_type | enum&lt;string&gt; | 否 | 排序<br>枚举值： general 综合<br>popularity_descending 最多点赞<br>time_descending 最新发布<br>comment_descending 最多评论<br>collect_descending 最多收藏<br><br>默认值： general |
| filter_note_type | enum&lt;string&gt; | 否 | 笔记类型<br>枚举值： 不限 不限<br>视频笔记 视频<br>普通笔记 图文<br><br>默认值： 不限 |
| filter_note_time | enum&lt;string&gt; | 否 | 发布时间<br>不传默认不限<br><br>枚举值： 不限 所有时间<br>一天内 24小时内<br>一周内 7天内<br>半年内 6个月内<br><br>默认值： 不限 |

#### JSON Schema

```json
{
  "type" : "object",
  "properties" : {
    "keyword" : {
      "type" : "string",
      "title" : "关键词"
    },
    "page" : {
      "type" : "number",
      "title" : "页数",
      "description" : "从1开始",
      "default" : 1
    },
    "search_id" : {
      "type" : "string",
      "title" : "搜索ID",
      "description" : "第一次请求可不传，服务端会生成searchId，翻页时需要携带服务端返回的searchId"
    },
    "session_id" : {
      "type" : "string",
      "title" : "会话ID",
      "description" : "第一次请求可不传，服务端会生成sessionId，翻页时携带服务端返回的sessionId"
    },
    "sort_type" : {
      "type" : "string",
      "title" : "排序",
      "enum" : [ "general", "popularity_descending", "time_descending", "comment_descending", "collect_descending" ],
      "default" : "general ",
      "enumDescriptions" : {
        "general" : "综合",
        "popularity_descending" : "最多点赞",
        "time_descending" : "最新发布",
        "comment_descending" : "最多评论",
        "collect_descending" : "最多收藏"
      }
    },
    "filter_note_type" : {
      "type" : "string",
      "title" : "笔记类型",
      "enum" : [ "不限", "视频笔记", "普通笔记" ],
      "default" : "不限",
      "enumDescriptions" : {
        "不限" : "不限",
        "视频笔记" : "视频",
        "普通笔记" : "图文"
      }
    },
    "filter_note_time" : {
      "type" : "string",
      "title" : "发布时间",
      "description" : "不传默认不限",
      "enum" : [ "不限", "一天内", "一周内", "半年内" ],
      "default" : "不限",
      "enumDescriptions" : {
        "不限" : "所有时间",
        "一天内" : "24小时内",
        "一周内" : "7天内",
        "半年内" : "6个月内"
      }
    }
  },
  "required" : [ "keyword", "page" ]
}
```

#### 示例

```json
{
  "keyword" : "罗永浩",
  "page" : 1,
  "search_id" : "",
  "session_id" : "",
  "sort_type" : "",
  "filter_note_type" : "",
  "filter_note_time" : ""
}
```

## 返回响应

### 响应 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/search_note_v3' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "keyword" : "罗永浩",
  "page" : 1,
  "search_id" : "",
  "session_id" : "",
  "sort_type" : "",
  "filter_note_type" : "",
  "filter_note_time" : ""
}'
```

