跳到主要内容
小红书

xiaohongshu.notes.comments@v1

小红书笔记评论

评论列表

按笔记 ID 或分享文本读取一页公开一级评论。

POST/v1/xiaohongshu/notes/comments

英文名称: Xiaohongshu note comments · Comment · List
Read one page of public top-level comments by note ID or share text.

适合什么任务

  • 需要读取一篇已知公开笔记的一页一级评论。

不适合什么任务

  • 不用于评论回复、私密内容或保证全量评论。

请求参数

请求 Body 必须满足以下任一组参数。

输入方式 1

字段note_id类型string约束与默认值pattern: "^[a-z0-9]{8,64}$"必填性必填
字段sort类型string约束与默认值const: "latest_v2" · default: "latest_v2"必填性选填
字段cursor类型string约束与默认值minLength: 1必填性选填

输入方式 2

字段share_text类型string约束与默认值minLength: 8 · maxLength: 2048必填性必填
字段sort类型string约束与默认值const: "latest_v2" · default: "latest_v2"必填性选填
字段cursor类型string约束与默认值minLength: 1必填性选填
完整请求 JSON Schema
{
  "type": "object",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "anyOf": [
    {
      "type": "object",
      "properties": {
        "note_id": {
          "type": "string",
          "pattern": "^[a-z0-9]{8,64}$"
        },
        "share_text": {
          "not": {}
        },
        "sort": {
          "default": "latest_v2",
          "type": "string",
          "const": "latest_v2"
        },
        "cursor": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "note_id"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "share_text": {
          "type": "string",
          "minLength": 8,
          "maxLength": 2048
        },
        "note_id": {
          "not": {}
        },
        "sort": {
          "default": "latest_v2",
          "type": "string",
          "const": "latest_v2"
        },
        "cursor": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "share_text"
      ],
      "additionalProperties": false
    }
  ]
}

静态响应样例

application/json
{
  "code": 200,
  "request_id": "req_example_xhs_comments_01",
  "message": "success",
  "data": {
    "items": [
      {
        "id": "comment-01",
        "note_id": "note0001",
        "parent_comment_id": null,
        "root_comment_id": "comment-01",
        "body": "Public comment",
        "created_at": "2026-08-01T12:00:00.000Z",
        "author": {
          "id": "user-01",
          "name": "Example user",
          "avatar_url": "https://ci.xiaohongshu.com/avatar"
        },
        "likes": 3,
        "reply_count": 1
      }
    ]
  },
  "page": {
    "next_cursor": "opaque-cursor"
  },
  "warnings": [],
  "meta": {
    "result_status": "complete",
    "balance_after": "0.81",
    "listing_id": "xiaohongshu.notes.comments",
    "version": "v1",
    "catalog_release_id": "catalog-production-2026-09-17.1",
    "price_book_version": "pricebook-production-2026-09-17.1",
    "charged_amount": "0.19",
    "currency": "CNY"
  }
}

实时运行

完整结果和空结果收费;部分结果和失败不收费。

安全验证

正在加载安全验证…

正在确认实时执行状态…

执行结果

// Result

响应 Contract

字段摘要用于快速浏览;完整 JSON Schema 是稳定输出 Contract。

字段code类型number约束与默认值const: 200必填性必填
字段request_id类型string约束与默认值无额外约束必填性必填
字段message类型string约束与默认值const: "success"必填性必填
字段data类型object约束与默认值无额外约束必填性必填
字段page类型object约束与默认值无额外约束必填性必填
字段warnings类型array约束与默认值无额外约束必填性必填
字段meta类型object约束与默认值无额外约束必填性必填
完整响应 JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "const": 200
    },
    "request_id": {
      "type": "string"
    },
    "message": {
      "type": "string",
      "const": "success"
    },
    "data": {
      "type": "object",
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "note_id": {
                "type": "string",
                "minLength": 1
              },
              "parent_comment_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "root_comment_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "body": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "created_at": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "author": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "name": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "avatar_url": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "id",
                  "name",
                  "avatar_url"
                ],
                "additionalProperties": false
              },
              "likes": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reply_count": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "id",
              "note_id",
              "parent_comment_id",
              "root_comment_id",
              "body",
              "created_at",
              "author",
              "likes",
              "reply_count"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "items"
      ],
      "additionalProperties": false
    },
    "page": {
      "type": "object",
      "properties": {
        "next_cursor": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "next_cursor"
      ],
      "additionalProperties": false
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "meta": {
      "type": "object",
      "properties": {
        "listing_id": {
          "type": "string",
          "const": "xiaohongshu.notes.comments"
        },
        "version": {
          "type": "string",
          "const": "v1"
        },
        "catalog_release_id": {
          "type": "string",
          "minLength": 1
        },
        "price_book_version": {
          "type": "string",
          "minLength": 1
        },
        "result_status": {
          "type": "string",
          "enum": [
            "complete",
            "empty",
            "partial"
          ]
        },
        "charged_amount": {
          "type": "string"
        },
        "balance_after": {
          "type": "string"
        },
        "currency": {
          "type": "string",
          "const": "CNY"
        }
      },
      "required": [
        "listing_id",
        "version",
        "catalog_release_id",
        "price_book_version",
        "result_status",
        "charged_amount",
        "balance_after",
        "currency"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "code",
    "request_id",
    "message",
    "data",
    "page",
    "warnings",
    "meta"
  ],
  "additionalProperties": false
}

已知限制

  • V1 固定使用 latest_v2 排序,并只返回一级评论。
  • 翻页必须使用本 Listing 返回的 Cursor;不承诺全量召回。

接入示例

REST(cURL)

curl -X POST https://api.dataxapi.com/v1/xiaohongshu/notes/comments \
  -H "Authorization: Bearer $DATAXAPI_API_KEY" \
  -H "Idempotency-Key: your-stable-intent-key" \
  -H "Content-Type: application/json" \
  -d '{"note_id":"68e8b88400000000050106d7","sort":"latest_v2"}'

Exact MCP Preview(Codex 配置)

[mcp_servers.dataxapi]
url = "https://api.dataxapi.com/mcp"
bearer_token_env_var = "DATAXAPI_API_KEY"

同一个 API Key 只会暴露其 Scope 内的精确 Tool。请把 Key 放在环境变量中,不要写入配置文件。需要安全重试时,请显式复用 idempotency_key。

查看客户端兼容状态 →

目录发布物: catalog-production-2026-09-17.1 · PriceBook: pricebook-production-2026-09-17.1