笔记评论
使用游标分页和普通、最新或点赞数排序,获取小红书(RedNote)笔记的评论。用于支持反馈审查、讨论分析和评论管理工作流。
参数
| 参数 | 必填 | 类型 | 说明 | 示例 | 可选值 |
|---|---|---|---|---|---|
note_id |
必填 | string | 一个小红书笔记ID或包含 /explore/ 的探索URL。 | 69e31cd60000000022028cc2 |
— |
last_cursor |
可选 | string | 上一页的分页游标(使用上一次响应返回的游标值)。 | — | — |
sort |
可选 | string | 结果集的排序策略。 可用值: - `normal`:普通 - `latest`:最新 - `like_count`:点赞数 | latest |
normallatestlike_count |
代码示例
curl -G "https://api.mofa-ai.com/v1/xiaohongshu/get_note_comment_v2" \
-H "Authorization: Bearer $MOFA_API_KEY" \
--data-urlencode 'note_id=69e31cd60000000022028cc2' \
--data-urlencode 'sort=latest'
import os
import requests
resp = requests.get(
"https://api.mofa-ai.com/v1/xiaohongshu/get_note_comment_v2",
headers={"Authorization": f"Bearer {os.environ['MOFA_API_KEY']}"},
params={
"note_id": "69e31cd60000000022028cc2",
"sort": "latest",
},
timeout=60,
)
body = resp.json()
if body["success"]:
print(body["cost_usd"], body["data"])
else:
print(body["error"], body["message"])
const url = new URL("https://api.mofa-ai.com/v1/xiaohongshu/get_note_comment_v2");
url.search = new URLSearchParams({
note_id: "69e31cd60000000022028cc2",
sort: "latest",
});
const resp = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.MOFA_API_KEY}` },
});
const body = await resp.json();
if (body.success) console.log(body.cost_usd, body.data);
else console.error(body.error, body.message);
在线试用
登录后可以在这里直接调用此接口,按价格从余额扣费,失败不收费。新账户赠送 $0.50 试用额度。
响应示例
采集于 2026-11-07,耗时 6099 ms · 请求参数 {"sort": "latest", "note_id": "69e31cd60000000022028cc2"}
JSON
{
"success": true,
"code": 0,
"message": "success",
"request_id": "req_5f1c2a9be04d7c3a81f6e2d0",
"endpoint": "xiaohongshu.get_note_comment_v2",
"cost_usd": 0.03,
"data": {
"code": 0,
"data": {
"cursor": "{\"contextId\":\"7cb24cb9f8394f3abf962084c7058b70\",\"cursor\":\"69ee10be0000000029027711\",\"index\":2,\"pageArea\":\"ALL\"}",
"user_id": "601352f1000000000100a04a",
"comments": [
{
"id": "6aaa21b80000000015021274",
"time": 1789534648,
"user": {
"level": {
"image": ""
},
"images": "https://sns-avatar-qc-ae.rednotecdn.com/avatar/1040g2jo325a1i37tl60049ih382hpf7jr4pggt0?imageView2/2/w/120/format/jpg",
"red_id": "114316906",
"userid": "a5880ae05bd209abd2a07c4ab0bd0",
"ai_agent": false,
"nickname": "国产护肤爱好者",
"current_user": "false",
"additional_tags": {}
},
"liked": false,
"score": 0,
"hidden": false,
"status": 0,
"content": "借图",
"note_id": "69e31cd60000000022028cc2",
"at_users": [],
"track_id": "interaction-service.local",
"biz_label": {
"rich_text": "unknown",
"group_invite": "false",
"product_review": false
},
"collected": false,
"downvoted": false,
"show_tags": [],
"show_type": "common",
"like_count": 0,
"comment_type": 0,
"show_tags_v2": [],
"sub_comments": [],
"share_strategy": 1,
"friend_liked_msg": "",
"sub_comment_count": 0,
"translation_strategy": 10
},
{
"id": "6a8c3dc800000000150212c3",
"time": 1787575752,
"user": {
"level": {
"image": ""
},
"images": "https://sns-avatar-qc-ae.rednotecdn.com/avatar/1040g2jo32464arhv7k005po3q4nne9577p616bg?imageView2/2/w/120/format/jpg",
"red_id": "94165668867",
"userid": "a1d5f5a0e86c17fb3d9b7d0f2f524",
"ai_agent": false,
"nickname": "好烦",
"current_user": "false",
"additional_tags": {}
},
"liked": false,
"score": 0,
"hidden": false,
"status": 0,
"content": "可以拿图调色吗[害羞R]",
"note_id": "69e31cd60000000022028cc2",
"at_users": [],
"track_id": "interaction-service.local",
"biz_label": {
"rich_text": "unknown",
"group_invite": "false",
"product_review": false
},
"collected": false,
"downvoted": false,
"show_tags": [],
"show_type": "common",
"like_count": 0,
"comment_type": 0,
"show_tags_v2": [],
"sub_comments": [
{
"id": "6a8c3e08000000000b01d497",
"time": 1787575816,
"user": {
"level": {
"image": ""
},
"images": "https://sns-avatar-qc-ae.rednotecdn.com/avatar/1040g2jo3171cded1k4005o0jabog982acdf9de0?imageView2/2/w/120/format/jpg",
"red_id": "4951457574",
"userid": "ab95f2d2ac5099ba92b51f4f57792",
"ai_agent": false,
"nickname": "Jasmine",
"current_user": "false",
"additional_tags": {}
},
"liked": false,
"score": -4,
"hidden": false,
"status": 0,
"content": "拿",
"note_id": "69e31cd60000000022028cc2",
"at_users": [],
"biz_label": {
"rich_text": "unknown",
"group_invite": "false",
"product_review": false
},
"collected": false,
"downvoted": false,
"show_tags": [],
"show_type": "common",
"like_count": 0,
"comment_type": 0,
"show_tags_v2": [
{
"pos": "post_name",
"text": "作者",
"type": "is_author",
"style_id": "red"
}
],
"share_strategy": 1,
"target_comment": {
"id": "6a8c3dc800000000150212c3",
"user": {
"level": {
"image": ""
},
"images": "https://sns-avatar-qc-ae.rednotecdn.com/avatar/1040g2jo32464arhv7k005po3q4nne9577p616bg?imageView2/2/w/120/format/jpg",
"red_id": "94165668867",
"userid": "a1d5f5a0e86c17fb3d9b7d0f2f524",
"ai_agent": false,
"nickname": "好烦",
"current_user": "false",
"additional_tags": {}
},
"status": 0
},
"friend_liked_msg": "",
"translation_strategy": 10
}
],
"share_strategy": 1,
"friend_liked_msg": "",
"sub_comment_count": 2,
"sub_comment_cursor": "{\"cursor\":\"6a8c3e08000000000b01d497\",\"index\":1}",
"translation_strategy": 10
},
"… +13"
],
"has_more": true,
"page_context": "{\"exposed_l1_ids\":\"6aaa21b80000000015021274,6a8c3dc800000000150212c3,6a87bf49000000000b01ca7b,6a471291000000002a02556e,6a19610d000000002a032cd2,6a05f38a0000000029034d23,69f9e04d0000000028039a6f,69f77d…",
"comment_count": 119,
"comment_count_l1": 83,
"all_sort_strategies": [
{
"type": "default",
"suffix_name": "",
"optional_name": "默认"
},
{
"type": "latest_v2",
"suffix_name": "",
"optional_name": "最新"
},
"… +1"
],
"current_sort_strategy": "latest_v2"
},
"message": null,
"requestId": "7bbf7d752d4a4239a944b83832707c61",
"recordTime": "2026-11-08T07:57:48.236762599",
"requestParams": {
"body": null,
"query": {
"sort": "latest",
"noteId": "69e31cd60000000022028cc2"
}
}
}
}