Skip to content

小红书 API - 笔记评论 (V4)

prod-global
GET
/api/xiaohongshu/get-note-comment/v4

获取小红书笔记的评论。

典型使用场景:

  • 快速查看笔记的最新/热门评论
  • 用于轻量级监控的评论快照

要点说明

  • 此版本仅返回评论的第一页;后续页面不可用。
  • 如需获取更多页面,请使用笔记评论(V2)接口。

请求参数

参数名位置类型必填说明
tokenquerystring此 API 服务的访问令牌。
noteIdquerystring小红书笔记唯一标识符。

代码示例

💡 环境说明

默认示例使用 https://api.justoneapi.com (prod-global)。中国大陆地区建议替换为 http://47.117.133.51:30015 (prod-cn) 以获得更好的访问体验。详见 环境选择

bash
# 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
curl -X GET "https://api.justoneapi.com/api/xiaohongshu/get-note-comment/v4?token=YOUR_API_KEY&noteId=VALUE"
text
我想使用 Just One API 提供的“笔记评论 (V4)”接口。
接口地址: https://api.justoneapi.com/api/xiaohongshu/get-note-comment/v4
HTTP 方法: GET
身份验证: 在 URL 后添加查询参数“?token=您的API密钥”。
OpenAPI 定义: https://docs.justoneapi.com/openapi/xiaohongshu-apis/note-comments-v4-zh.json

请求参数说明:
- token (query): 此 API 服务的访问令牌。 (必填)
- noteId (query): 小红书笔记唯一标识符。 (必填)

返回格式: JSON

响应处理与错误码:
1. 需通过返回体中的 "code" 字段判断业务结果(code 为 0 表示成功)。
2. 超时建议:建议将请求超时时间设置为至少 60 秒。
3. 业务码说明:
   - 0: 成功
   - 100: Token 无效或已失效
   - 301: 采集失败,请重试
   - 302: 超出速率限制
   - 303: 超出每日配额
   - 400: 参数错误
   - 500: 内部服务器错误
   - 600: 权限不足
   - 601: 余额不足

请帮我用我擅长的编程语言写一个脚本来调用这个接口,并处理返回结果。
python
# 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
import requests

url = "https://api.justoneapi.com/api/xiaohongshu/get-note-comment/v4?token=YOUR_API_KEY&noteId=VALUE"
response = requests.get(url)
print(response.json())
js
// 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
const response = await fetch("https://api.justoneapi.com/api/xiaohongshu/get-note-comment/v4?token=YOUR_API_KEY&noteId=VALUE", {
  method: "GET"
});
const data = await response.json();
console.log(data);
java
// 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Main {
    public static void main(String[] args) throws Exception {
        HttpClient client = HttpClient.newHttpClient();
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://api.justoneapi.com/api/xiaohongshu/get-note-comment/v4?token=YOUR_API_KEY&noteId=VALUE"))
            .method("GET", HttpRequest.BodyPublishers.noBody())
            .build();

        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.body());
    }
}
go
// 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	client := &http.Client{}
	url := "https://api.justoneapi.com/api/xiaohongshu/get-note-comment/v4?token=YOUR_API_KEY&noteId=VALUE"
	req, _ := http.NewRequest("GET", url, nil)
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}
php
// 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.justoneapi.com/api/xiaohongshu/get-note-comment/v4?token=YOUR_API_KEY&noteId=VALUE");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$response = curl_exec($ch);
curl_close($ch);
echo $response;

响应结果

json
{
  "code": 0,
  "data": {
    "comments": [
      {
        "id": "65c5944c000000001100b84a",
        "track_id": "interaction-service.local",
        "show_tags_v2": [],
        "time": 1707447372,
        "downvoted": false,
        "content": "拉稀没[捂脸R]",
        "at_users": [],
        "score": 0,
        "status": 0,
        "sub_comments": [],
        "show_type": "common",
        "biz_label": {
          "product_review": false,
          "group_invite": "unknown",
          "rich_text": "unknown"
        },
        "translation_strategy": 10,
        "like_count": 1,
        "liked": false,
        "hidden": false,
        "collected": false,
        "share_strategy": 0,
        "show_tags": [],
        "comment_type": 0,
        "friend_liked_msg": "",
        "note_id": "65bf5360000000002c03f684",
        "sub_comment_count": 0,
        "user": {
          "userid": "a53c5dfd23210947ff7cf8d054aac",
          "nickname": "起个名好迷茫",
          "images": "https://sns-avatar-qc.xhscdn.com/avatar/1040g2jo31r72vt3kga705oc94lak0hnamgue3a8?imageView2/2/w/120/format/jpg",
          "red_id": "8723021558",
          "level": {
            "image": ""
          },
          "additional_tags": {},
          "ai_agent": false,
          "current_user": "false"
        }
      },
      {
        "note_id": "65bf5360000000002c03f684",
        "hidden": false,
        "status": 0,
        "id": "65c4f627000000000803040c",
        "like_count": 60,
        "liked": false,
        "sub_comment_count": 4,
        "sub_comments": [],
        "user": {
          "ai_agent": false,
          "current_user": "false",
          "userid": "a262a8089266416cd4224fd1e820a",
          "nickname": "Stint on",
          "images": "https://sns-avatar-qc.xhscdn.com/avatar/1040g2jo31re9tolo006g5o387h4gbut7pb65p68?imageView2/2/w/120/format/jpg",
          "red_id": "0905211z",
          "level": {
            "image": ""
          },
          "additional_tags": {}
        },
        "show_tags": [],
        "show_type": "common",
        "at_users": [],
        "downvoted": false,
        "translation_strategy": 10,
        "show_tags_v2": [],
        "biz_label": {
          "product_review": false,
          "group_invite": "unknown",
          "rich_text": "unknown"
        },
        "collected": false,
        "share_strategy": 0,
        "track_id": "interaction-service.local",
        "score": 0,
        "time": 1707406888,
        "comment_type": 0,
        "friend_liked_msg": "",
        "content": "15年巴萨中国行,梅西也是没上,转身去日本就上了。他不是第一次干这事,只是有些人忘了,汶川地震的时候C罗带头捐款100万欧元和球衣拍卖所得,梅西却说地震和足球无关,第二年日本地震,他带头捐300万欧元,3月还来杭州之行……[弱R](看到这个评论就想复制转发,让更多人知道,怪生气的[生气R])"
      },
      {
        "content": "我一直觉得梅西不喜欢中国,不知道是不是我的错觉[doge]",
        "track_id": "interaction-service.local",
        "at_users": [],
        "score": 0,
        "status": 0,
        "sub_comment_count": 0,
        "time": 1707403143,
        "user": {
          "current_user": "false",
          "userid": "a6d0c1469bb3f228b631f29f40bd1",
          "nickname": "狗蛋儿~",
          "images": "https://sns-avatar-qc.xhscdn.com/avatar/1040g2jo30n92k81qlg004alfk410uoi0hh61pb0?imageView2/2/w/120/format/jpg",
          "red_id": "Lucky_6668",
          "level": {
            "image": ""
          },
          "additional_tags": {},
          "ai_agent": false
        },
        "show_tags_v2": [],
        "biz_label": {
          "product_review": false,
          "group_invite": "unknown",
          "rich_text": "unknown"
        },
        "collected": false,
        "share_strategy": 0,
        "id": "65c4e78700000000110106a1",
        "note_id": "65bf5360000000002c03f684",
        "liked": false,
        "sub_comments": [],
        "show_type": "common",
        "comment_type": 0,
        "friend_liked_msg": "",
        "downvoted": false,
        "like_count": 6,
        "hidden": false,
        "show_tags": [],
        "translation_strategy": 10
      },
      {
        "like_count": 11,
        "liked": false,
        "hidden": false,
        "show_tags": [],
        "show_type": "common",
        "downvoted": false,
        "share_strategy": 0,
        "id": "65c4d68000000000100393ed",
        "content": "",
        "at_users": [],
        "score": 0,
        "sub_comments": [],
        "time": 1707398785,
        "track_id": "interaction-service.local",
        "status": 0,
        "sub_comment_count": 1,
        "comment_type": 2,
        "friend_liked_msg": "",
        "media_source_type": 0,
        "biz_label": {
          "product_review": false,
          "group_invite": "unknown",
          "rich_text": "unknown"
        },
        "collected": false,
        "note_id": "65bf5360000000002c03f684",
        "user": {
          "additional_tags": {},
          "ai_agent": false,
          "current_user": "false",
          "userid": "a32f7f9a0e25924f6247d0a7ba030",
          "nickname": "大侠",
          "images": "https://sns-avatar-qc.xhscdn.com/avatar/1040g2jo31sk0bld6m2605omcmu70vlpq1ti9lfo?imageView2/2/w/120/format/jpg",
          "red_id": "6222843747",
          "level": {
            "image": ""
          }
        },
        "pictures": [
          {
            "height": 674,
            "url": "https://sns-i10.rednotecdn.com/comment/1040g2h030uttdo1gl46g5omcmu70vlpqs12tcho?imageView2/2/w/360/format/heif/q/46&ap=4&sc=CMT_PRV&sign=9e4730f83196083baaa9ab2b95238b74&t=69aed261&src=A",
            "origin_url": "https://sns-i10.rednotecdn.com/comment/1040g2h030uttdo1gl46g5omcmu70vlpqs12tcho?imageView2/2/w/1280/format/heif/q/45&ap=4&sc=CMT_DTL&sign=9e4730f83196083baaa9ab2b95238b74&t=69aed261&src=A",
            "box_w": 120,
            "box_h": 160,
            "file_id": "",
            "width": 460
          }
        ],
        "show_tags_v2": [],
        "translation_strategy": 10
      },
      {
        "hidden": false,
        "show_tags": [],
        "pictures": [
          {
            "box_h": 160,
            "file_id": "",
            "width": 589,
            "height": 912,
            "url": "https://sns-i10.rednotecdn.com/comment/1040g2h030utt33e6lg4g5omcmu70vlpqo7b4llg?imageView2/2/w/360/format/heif/q/46&ap=4&sc=CMT_PRV&sign=6bfe6f4a225ca15fac2ccb79899b1ded&t=69aed261&src=A",
            "origin_url": "https://sns-i10.rednotecdn.com/comment/1040g2h030utt33e6lg4g5omcmu70vlpqo7b4llg?imageView2/2/w/1280/format/heif/q/45&ap=4&sc=CMT_DTL&sign=6bfe6f4a225ca15fac2ccb79899b1ded&t=69aed261&src=A",
            "box_w": 120
          }
        ],
        "track_id": "interaction-service.local",
        "show_tags_v2": [],
        "sub_comments": [],
        "comment_type": 2,
        "id": "65c4d51a00000000110091b4",
        "note_id": "65bf5360000000002c03f684",
        "content": "",
        "score": 0,
        "status": 0,
        "downvoted": false,
        "collected": false,
        "share_strategy": 0,
        "at_users": [],
        "sub_comment_count": 1,
        "show_type": "common",
        "friend_liked_msg": "",
        "biz_label": {
          "product_review": false,
          "group_invite": "unknown",
          "rich_text": "unknown"
        },
        "translation_strategy": 10,
        "like_count": 7,
        "liked": false,
        "time": 1707398427,
        "user": {
          "level": {
            "image": ""
          },
          "additional_tags": {},
          "ai_agent": false,
          "current_user": "false",
          "userid": "a32f7f9a0e25924f6247d0a7ba030",
          "nickname": "大侠",
          "images": "https://sns-avatar-qc.xhscdn.com/avatar/1040g2jo31sk0bld6m2605omcmu70vlpq1ti9lfo?imageView2/2/w/120/format/jpg",
          "red_id": "6222843747"
        },
        "media_source_type": 0
      },
      {
        "liked": false,
        "hidden": false,
        "score": 0,
        "track_id": "interaction-service.local",
        "show_tags_v2": [],
        "biz_label": {
          "rich_text": "unknown",
          "product_review": false,
          "group_invite": "unknown"
        },
        "translation_strategy": 10,
        "id": "65c4c1ad000000000803082c",
        "like_count": 16,
        "status": 0,
        "user": {
          "red_id": "264681498",
          "level": {
            "image": ""
          },
          "additional_tags": {},
          "ai_agent": false,
          "current_user": "false",
          "userid": "a4323bced184def6cd1cb2cd2d9ee",
          "nickname": "街溜子的一天",
          "images": "https://sns-avatar-qc.xhscdn.com/avatar/1040g2jo31nd7raq14u6g4a1kst4quirrpj8b19g?imageView2/2/w/120/format/jpg"
        },
        "time": 1707393453,
        "show_tags": [],
        "show_type": "common",
        "downvoted": false,
        "content": "梅西是用自己的职业生涯做了一个错误的决定,",
        "at_users": [],
        "sub_comment_count": 3,
        "sub_comments": [],
        "collected": false,
        "note_id": "65bf5360000000002c03f684",
        "comment_type": 0,
        "friend_liked_msg": "",
        "share_strategy": 0
      },
      {
        "show_tags_v2": [],
        "downvoted": false,
        "share_strategy": 0,
        "id": "65c4b20a000000000800b8ad",
        "content": "对付这样的人 就是不提他  不理他  让他退钱💰  赔代理费   国家禁止他来中国",
        "like_count": 5,
        "status": 0,
        "comment_type": 0,
        "sub_comment_count": 0,
        "show_tags": [],
        "collected": false,
        "at_users": [],
        "liked": false,
        "biz_label": {
          "rich_text": "unknown",
          "product_review": false,
          "group_invite": "unknown"
        },
        "user": {
          "ai_agent": false,
          "current_user": "false",
          "userid": "afa1e04b3ce57811852fba412d497",
          "nickname": "牛暴包",
          "images": "https://sns-avatar-qc.xhscdn.com/avatar/5b9c6add69fcbb000166e3d5.jpg?imageView2/2/w/120/format/jpg",
          "red_id": "416533180",
          "level": {
            "image": ""
          },
          "additional_tags": {}
        },
        "show_type": "common",
        "track_id": "interaction-service.local",
        "note_id": "65bf5360000000002c03f684",
        "hidden": false,
        "score": 0,
        "sub_comments": [],
        "time": 1707389450,
        "friend_liked_msg": "",
        "translation_strategy": 10
      },
      {
        "sub_comments": [],
        "time": 1707387672,
        "track_id": "interaction-service.local",
        "id": "65c4ab1800000000110083e7",
        "note_id": "65bf5360000000002c03f684",
        "content": "呦西呦西",
        "liked": false,
        "status": 0,
        "biz_label": {
          "group_invite": "unknown",
          "rich_text": "unknown",
          "product_review": false
        },
        "translation_strategy": 10,
        "collected": false,
        "like_count": 0,
        "hidden": false,
        "score": 0,
        "sub_comment_count": 0,
        "downvoted": false,
        "user": {
          "images": "https://sns-avatar-qc.xhscdn.com/avatar/620f3ac7980a4aa39ec6caf9.jpg?imageView2/2/w/120/format/jpg",
          "red_id": "238469326",
          "level": {
            "image": ""
          },
          "additional_tags": {},
          "ai_agent": false,
          "current_user": "false",
          "userid": "af5744dd843327b4745823910988c",
          "nickname": "Sui3ied"
        },
        "show_tags": [],
        "comment_type": 0,
        "show_tags_v2": [],
        "share_strategy": 0,
        "at_users": [],
        "show_type": "common",
        "friend_liked_msg": ""
      },
      {
        "comment_type": 0,
        "friend_liked_msg": "",
        "hidden": false,
        "status": 0,
        "show_type": "common",
        "show_tags_v2": [],
        "biz_label": {
          "rich_text": "unknown",
          "product_review": false,
          "group_invite": "unknown"
        },
        "translation_strategy": 10,
        "downvoted": false,
        "at_users": [],
        "sub_comments": [],
        "time": 1707382507,
        "track_id": "interaction-service.local",
        "collected": false,
        "note_id": "65bf5360000000002c03f684",
        "score": 0,
        "show_tags": [],
        "liked": false,
        "sub_comment_count": 2,
        "user": {
          "level": {
            "image": ""
          },
          "additional_tags": {},
          "ai_agent": false,
          "current_user": "false",
          "userid": "a3f109520f013700700b062a9b83c",
          "nickname": "MingD",
          "images": "https://sns-avatar-qc.xhscdn.com/avatar/5fbf34ce0000000001005c2c.jpg?imageView2/2/w/120/format/jpg",
          "red_id": "1036087863"
        },
        "share_strategy": 0,
        "id": "65c496eb000000001100ab45",
        "content": "哈哈哈哈梅桑,故乡的樱花🌸开了..",
        "like_count": 48
      },
      {
        "hidden": false,
        "score": 0,
        "sub_comments": [],
        "show_tags": [],
        "friend_liked_msg": "",
        "show_tags_v2": [],
        "like_count": 3,
        "liked": false,
        "biz_label": {
          "product_review": false,
          "group_invite": "unknown",
          "rich_text": "unknown"
        },
        "collected": false,
        "share_strategy": 0,
        "content": "真爱梅西就要为梅西着想",
        "status": 0,
        "id": "65c485070000000008014f80",
        "note_id": "65bf5360000000002c03f684",
        "time": 1707377927,
        "user": {
          "userid": "a44acbc3d509676dc1bc67531503d",
          "nickname": "禾悦晓院",
          "images": "https://sns-avatar-qc.xhscdn.com/avatar/7121a416be8e543266fd62c1cc9d575e.jpg?imageView2/2/w/120/format/jpg",
          "red_id": "785553734",
          "level": {
            "image": ""
          },
          "additional_tags": {},
          "ai_agent": false,
          "current_user": "false"
        },
        "show_type": "common",
        "comment_type": 0,
        "track_id": "interaction-service.local",
        "translation_strategy": 10,
        "at_users": [],
        "sub_comment_count": 4,
        "downvoted": false
      }
    ],
    "has_more": true,
    "cursor": "{\"cursor\":\"65c485070000000008014f80\",\"index\":2,\"pageArea\":\"UNFOLDED\"}",
    "all_sort_strategies": [],
    "current_sort_strategy": "latest_v2",
    "user_id": "61e0f15300000000210253a5",
    "comment_count": 944,
    "comment_count_l1": 801
  }
}

💡 提示:为简化展示,列表类数据样例仅保留 1-2 条记录,实际返回条数以接口响应为准。