# Xiaohongshu/小红书 - 搜索笔记

所属目录：Xiaohongshu/小红书

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

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

## 鉴权

在请求头中传递 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 |
| sort | enum&lt;string&gt; | 是 | 排序<br>枚举值： general  综合<br>hot 最热<br>new 最新<br>comment 最多评论<br>collect 最多收藏<br><br>默认值： general |
| noteType | enum&lt;string&gt; | 是 | 笔记类型<br>枚举值： all 不限<br>video 视频<br>normal 图文<br><br>默认值： all |
| noteTime | enum&lt;string&gt; | 否 | 发布时间<br>不传默认不限<br><br>枚举值： one_day 一天内<br>one_week 一周内<br>half_year 半年内 |

#### JSON Schema

```json
{
  "type" : "object",
  "properties" : {
    "keyword" : {
      "type" : "string",
      "title" : "关键词"
    },
    "page" : {
      "type" : "number",
      "title" : "页数",
      "description" : "从1开始",
      "default" : 1
    },
    "sort" : {
      "type" : "string",
      "title" : "排序",
      "enum" : [ "general ", "hot", "new", "comment", "collect" ],
      "default" : "general ",
      "enumDescriptions" : {
        "general " : "综合",
        "hot" : "最热",
        "new" : "最新",
        "comment" : "最多评论",
        "collect" : "最多收藏"
      }
    },
    "noteType" : {
      "type" : "string",
      "title" : "笔记类型",
      "enum" : [ "all", "video", "normal" ],
      "default" : "all",
      "enumDescriptions" : {
        "all" : "不限",
        "video" : "视频",
        "normal" : "图文"
      }
    },
    "noteTime" : {
      "type" : "string",
      "title" : "发布时间",
      "description" : "不传默认不限",
      "enum" : [ "one_day", "one_week", "half_year" ],
      "enumDescriptions" : {
        "one_day" : "一天内",
        "one_week" : "一周内",
        "half_year" : "半年内"
      }
    }
  },
  "required" : [ "keyword", "page", "sort", "noteType" ]
}
```

#### 示例

```json
{
  "keyword" : "",
  "page" : 1,
  "sort" : "general",
  "noteType" : "all",
  "noteTime" : ""
}
```

## 返回响应

### 响应 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' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "keyword" : "",
  "page" : 1,
  "sort" : "general",
  "noteType" : "all",
  "noteTime" : ""
}'
```

