# Xiaohongshu-V2/小红书V2 - 获取笔记一级评论

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

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

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

## 鉴权

在请求头中传递 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

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| note_id | string | 是 | 笔记ID<br>示例值： 68bebd21000000001b03315d |
| share_text | string | 否 | 小红书分享链接（支持APP和Web端分享链接）<br>优先使用note_id，如果没有则使用share_text，两个参数二选一，如都携带则以note_id为准 |
| cursor | string | 否 | 分页游标<br>首次请求留空，翻页时传入上一次响应中返回的 cursor 值 |
| index | string | 否 | 评论索引<br>首次请求传 0，翻页时传入上一次响应中返回的 index 值 |
| pageArea | string | 否 | 折叠状态<br>默认 "UNFOLDED"（展开），翻页时传入上一次响应中返回的 pageArea 值<br><br>默认值： UNFOLDED |
| sort_strategy | enum&lt;string&gt; | 否 | 排序<br>枚举值： latest_v2 最新 按时间倒序，默认使用<br>like_count 最热 按点赞数排序<br><br>默认值： latest_v2 |

#### JSON Schema

```json
{
  "type" : "object",
  "properties" : {
    "note_id" : {
      "type" : "string",
      "title" : "笔记ID",
      "examples" : [ "68bebd21000000001b03315d" ]
    },
    "share_text" : {
      "type" : "string",
      "title" : "小红书分享链接（支持APP和Web端分享链接）",
      "description" : "优先使用note_id，如果没有则使用share_text，两个参数二选一，如都携带则以note_id为准"
    },
    "cursor" : {
      "type" : "string",
      "title" : "分页游标",
      "description" : "首次请求留空，翻页时传入上一次响应中返回的 cursor 值"
    },
    "index" : {
      "type" : "string",
      "title" : "评论索引",
      "description" : "首次请求传 0，翻页时传入上一次响应中返回的 index 值"
    },
    "pageArea" : {
      "type" : "string",
      "title" : "折叠状态",
      "default" : "UNFOLDED",
      "description" : "默认 \"UNFOLDED\"（展开），翻页时传入上一次响应中返回的 pageArea 值"
    },
    "sort_strategy" : {
      "type" : "string",
      "title" : "排序",
      "enum" : [ "latest_v2", "like_count" ],
      "default" : "latest_v2",
      "enumNames" : {
        "latest_v2" : "最新",
        "like_count" : "最热"
      },
      "enumDescriptions" : {
        "latest_v2" : "按时间倒序，默认使用",
        "like_count" : "按点赞数排序"
      }
    }
  },
  "required" : [ "note_id" ]
}
```

#### 示例

```json
{
  "note_id" : "68bebd21000000001b03315d",
  "share_text" : "",
  "cursor" : "",
  "index" : 0,
  "pageArea" : "UNFOLDED",
  "sort_strategy" : "latest_v2"
}
```

## 返回响应

### 响应 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/fetch_note_comment' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "note_id" : "68bebd21000000001b03315d",
  "share_text" : "",
  "cursor" : "",
  "index" : 0,
  "pageArea" : "UNFOLDED",
  "sort_strategy" : "latest_v2"
}'
```

