Skip to content

Xiaohongshu APIs - Comment Replies (V2)

prod-global
GET
/api/xiaohongshu/get-note-sub-comment/v2

Retrieves replies under a specific Xiaohongshu comment (also known as second-level comments), with pagination when supported. The response includes reply text, publish time, replier information (when available), and other metadata.

Typical use cases:

  • Deep sentiment analysis by including comment threads
  • Monitoring discussions under key comments
  • Collecting reply threads for analytics, reporting, and dataset building

Parameters

NameInTypeRequiredDescription
tokenquerystringYesAccess token for this API service.
noteIdquerystringYesUnique note identifier on Xiaohongshu.
commentIdquerystringYesUnique comment identifier on Xiaohongshu.
lastCursorquerystringNoPagination cursor from the previous page (use the cursor value returned by the last response).

Code Samples

💡 Environment Note

Default samples use https://api.justoneapi.com (prod-global). For users in Mainland China, it is recommended to replace it with http://47.117.133.51:30015 (prod-cn) for better performance. See Environment Guide.

bash
# Tip: For Mainland China, replace https://api.justoneapi.com with http://47.117.133.51:30015
curl -X GET "https://api.justoneapi.com/api/xiaohongshu/get-note-sub-comment/v2?token=YOUR_API_KEY&noteId=VALUE&commentId=VALUE"
text
I want to use the "Comment Replies (V2)" API from Just One API.
API Endpoint: https://api.justoneapi.com/api/xiaohongshu/get-note-sub-comment/v2
HTTP Method: GET
Authentication: Append "?token=YOUR_API_KEY" to the URL.
OpenAPI Definition: https://docs.justoneapi.com/openapi/xiaohongshu-apis/comment-replies-v2-en.json

Parameters:
- token (query): Access token for this API service. (Required)
- noteId (query): Unique note identifier on Xiaohongshu. (Required)
- commentId (query): Unique comment identifier on Xiaohongshu. (Required)
- lastCursor (query): Pagination cursor from the previous page (use the cursor value returned by the last response).

Return format: JSON

Response Handling & Error Codes:
1. Business results should be determined by the "code" field in the response body (code 0 means success).
2. Timeout Recommendation: Set request timeout to at least 60 seconds.
3. Business Code Reference:
   - 0: Success
   - 100: Invalid or Inactive Token
   - 301: Collection Failed. Please Retry.
   - 302: Rate Limit Exceeded
   - 303: Daily Quota Exceeded
   - 400: Invalid Parameters
   - 500: Internal Server Error
   - 600: Permission Denied
   - 601: Insufficient Balance

Please help me write a script in my preferred programming language to call this API and handle the response.
python
# Tip: For Mainland China, replace https://api.justoneapi.com with http://47.117.133.51:30015
import requests

url = "https://api.justoneapi.com/api/xiaohongshu/get-note-sub-comment/v2?token=YOUR_API_KEY&noteId=VALUE&commentId=VALUE"
response = requests.get(url)
print(response.json())
js
// Tip: For Mainland China, replace https://api.justoneapi.com with http://47.117.133.51:30015
const response = await fetch("https://api.justoneapi.com/api/xiaohongshu/get-note-sub-comment/v2?token=YOUR_API_KEY&noteId=VALUE&commentId=VALUE", {
  method: "GET"
});
const data = await response.json();
console.log(data);
java
// Tip: For Mainland China, replace https://api.justoneapi.com with 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-sub-comment/v2?token=YOUR_API_KEY&noteId=VALUE&commentId=VALUE"))
            .method("GET", HttpRequest.BodyPublishers.noBody())
            .build();

        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.body());
    }
}
go
// Tip: For Mainland China, replace https://api.justoneapi.com with 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-sub-comment/v2?token=YOUR_API_KEY&noteId=VALUE&commentId=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
// Tip: For Mainland China, replace https://api.justoneapi.com with http://47.117.133.51:30015
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.justoneapi.com/api/xiaohongshu/get-note-sub-comment/v2?token=YOUR_API_KEY&noteId=VALUE&commentId=VALUE");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$response = curl_exec($ch);
curl_close($ch);
echo $response;

Responses

json
{
  "code": 0,
  "data": {
    "comments": [
      {
        "translation_strategy": 10,
        "at_users": [],
        "hidden": false,
        "status": 0,
        "target_comment": {
          "status": 0,
          "user": {
            "ai_agent": false,
            "current_user": "false",
            "userid": "a12faa761c07256b3995501c850d2",
            "nickname": "豪",
            "images": "https://sns-avatar-qc.xhscdn.com/avatar/1040g2jo30rmoae6j2g5g5o6poeg08lrqd2p83no?imageView2/2/w/120/format/jpg",
            "red_id": "9530496503",
            "level": {
              "image": ""
            },
            "additional_tags": {}
          },
          "id": "65bf56d3000000000803f4ec"
        },
        "biz_label": {
          "product_review": false,
          "group_invite": "unknown",
          "rich_text": "unknown"
        },
        "note_id": "65bf5360000000002c03f684",
        "like_count": 161,
        "user": {
          "additional_tags": {},
          "ai_agent": false,
          "current_user": "false",
          "userid": "adde925ab72eafe49a33d345e55b1",
          "nickname": "榴莲在摩天轮",
          "images": "https://sns-avatar-qc.xhscdn.com/avatar/1040g2jo31cnkqt5th20g5nre2evg8uuc9gkjs2g?imageView2/2/w/120/format/jpg",
          "red_id": "371915976",
          "level": {
            "image": ""
          }
        },
        "show_type": "common",
        "collected": false,
        "share_strategy": 0,
        "content": "估计又系个假号[笑哭R]",
        "liked": false,
        "show_tags": [],
        "comment_type": 0,
        "downvoted": false,
        "id": "65bf6392000000000800b405",
        "score": 0,
        "time": 1707041682,
        "friend_liked_msg": "",
        "show_tags_v2": []
      },
      {
        "downvoted": false,
        "share_strategy": 0,
        "at_users": [],
        "hidden": false,
        "target_comment": {
          "id": "65bf6392000000000800b405",
          "status": 0,
          "user": {
            "level": {
              "image": ""
            },
            "additional_tags": {},
            "ai_agent": false,
            "current_user": "false",
            "userid": "adde925ab72eafe49a33d345e55b1",
            "nickname": "榴莲在摩天轮",
            "images": "https://sns-avatar-qc.xhscdn.com/avatar/1040g2jo31cnkqt5th20g5nre2evg8uuc9gkjs2g?imageView2/2/w/120/format/jpg",
            "red_id": "371915976"
          }
        },
        "show_tags": [],
        "like_count": 43,
        "liked": false,
        "collected": false,
        "show_tags_v2": [],
        "translation_strategy": 10,
        "id": "65bf659700000000080142ec",
        "content": "别胡说吧…去年媒体当面采访还问她为什么开小红书,她也说之前答应了粉丝要开的…本人都官宣的号怎么到你这里就变假号了[石化R]",
        "show_type": "common",
        "comment_type": 0,
        "user": {
          "userid": "a93fbcb8b00c551b211be5750632d",
          "nickname": "喜欢唱跳rap写信",
          "images": "https://sns-avatar-qc.xhscdn.com/avatar/1040g2jo316u8dgg50o005odpdq9417mfgt60vuo?imageView2/2/w/120/format/jpg",
          "red_id": "1635985618",
          "level": {
            "image": ""
          },
          "additional_tags": {},
          "ai_agent": false,
          "current_user": "false"
        },
        "friend_liked_msg": "",
        "biz_label": {
          "product_review": false,
          "group_invite": "unknown",
          "rich_text": "unknown"
        },
        "note_id": "65bf5360000000002c03f684",
        "score": 0,
        "status": 0,
        "time": 1707042199
      },
      {
        "friend_liked_msg": "",
        "collected": false,
        "note_id": "65bf5360000000002c03f684",
        "at_users": [],
        "liked": false,
        "show_tags_v2": [],
        "biz_label": {
          "product_review": false,
          "group_invite": "unknown",
          "rich_text": "unknown"
        },
        "share_strategy": 0,
        "content": "你自己搜下有几个咯[微笑R]",
        "like_count": 2,
        "status": 0,
        "target_comment": {
          "id": "65bf659700000000080142ec",
          "status": 0,
          "user": {
            "ai_agent": false,
            "current_user": "false",
            "userid": "a93fbcb8b00c551b211be5750632d",
            "nickname": "喜欢唱跳rap写信",
            "images": "https://sns-avatar-qc.xhscdn.com/avatar/1040g2jo316u8dgg50o005odpdq9417mfgt60vuo?imageView2/2/w/120/format/jpg",
            "red_id": "1635985618",
            "level": {
              "image": ""
            },
            "additional_tags": {}
          }
        },
        "show_type": "common",
        "translation_strategy": 10,
        "downvoted": false,
        "id": "65bf65dc000000000803286b",
        "hidden": false,
        "score": 0,
        "time": 1707042268,
        "user": {
          "ai_agent": false,
          "current_user": "false",
          "userid": "adde925ab72eafe49a33d345e55b1",
          "nickname": "榴莲在摩天轮",
          "images": "https://sns-avatar-qc.xhscdn.com/avatar/1040g2jo31cnkqt5th20g5nre2evg8uuc9gkjs2g?imageView2/2/w/120/format/jpg",
          "red_id": "371915976",
          "level": {
            "image": ""
          },
          "additional_tags": {}
        },
        "show_tags": [],
        "comment_type": 0
      },
      {
        "note_id": "65bf5360000000002c03f684",
        "translation_strategy": 10,
        "downvoted": false,
        "show_tags_v2": [],
        "biz_label": {
          "product_review": false,
          "group_invite": "unknown",
          "rich_text": "unknown"
        },
        "collected": false,
        "hidden": false,
        "time": 1707042303,
        "friend_liked_msg": "",
        "target_comment": {
          "id": "65bf56d3000000000803f4ec",
          "status": 0,
          "user": {
            "ai_agent": false,
            "current_user": "false",
            "userid": "a12faa761c07256b3995501c850d2",
            "nickname": "豪",
            "images": "https://sns-avatar-qc.xhscdn.com/avatar/1040g2jo30rmoae6j2g5g5o6poeg08lrqd2p83no?imageView2/2/w/120/format/jpg",
            "red_id": "9530496503",
            "level": {
              "image": ""
            },
            "additional_tags": {}
          }
        },
        "show_type": "common",
        "id": "65bf65ff000000000803cfe8",
        "like_count": 40,
        "liked": false,
        "status": 0,
        "user": {
          "current_user": "false",
          "userid": "a93fbcb8b00c551b211be5750632d",
          "nickname": "喜欢唱跳rap写信",
          "images": "https://sns-avatar-qc.xhscdn.com/avatar/1040g2jo316u8dgg50o005odpdq9417mfgt60vuo?imageView2/2/w/120/format/jpg",
          "red_id": "1635985618",
          "level": {
            "image": ""
          },
          "additional_tags": {},
          "ai_agent": false
        },
        "show_tags": [],
        "comment_type": 0,
        "share_strategy": 0,
        "content": "她打tag也写了美斯啊…而且正文写梅西没问题吧?迁就内地广东以外的网友",
        "at_users": [],
        "score": 0
      },
      {
        "show_tags_v2": [],
        "downvoted": false,
        "like_count": 7,
        "target_comment": {
          "status": 0,
          "user": {
            "images": "https://sns-avatar-qc.xhscdn.com/avatar/1040g2jo31cnkqt5th20g5nre2evg8uuc9gkjs2g?imageView2/2/w/120/format/jpg",
            "red_id": "371915976",
            "level": {
              "image": ""
            },
            "additional_tags": {},
            "ai_agent": false,
            "current_user": "false",
            "userid": "adde925ab72eafe49a33d345e55b1",
            "nickname": "榴莲在摩天轮"
          },
          "id": "65bf65dc000000000803286b"
        },
        "status": 0,
        "show_type": "common",
        "collected": false,
        "at_users": [],
        "liked": false,
        "user": {
          "level": {
            "image": ""
          },
          "additional_tags": {},
          "ai_agent": false,
          "current_user": "false",
          "userid": "a93fbcb8b00c551b211be5750632d",
          "nickname": "喜欢唱跳rap写信",
          "images": "https://sns-avatar-qc.xhscdn.com/avatar/1040g2jo316u8dgg50o005odpdq9417mfgt60vuo?imageView2/2/w/120/format/jpg",
          "red_id": "1635985618"
        },
        "biz_label": {
          "product_review": false,
          "group_invite": "unknown",
          "rich_text": "unknown"
        },
        "translation_strategy": 10,
        "id": "65bf662f0000000008017f77",
        "time": 1707042351,
        "hidden": false,
        "score": 0,
        "show_tags": [],
        "comment_type": 0,
        "friend_liked_msg": "",
        "share_strategy": 0,
        "note_id": "65bf5360000000002c03f684",
        "content": "拜托她就这一个小红书号…你看到有好几个吗?"
      }
    ],
    "has_more": true,
    "cursor": "{\"cursor\":\"65bf662f0000000008017f77\",\"index\":2}"
  }
}

💡 Note: For list data, the example shows only 1-2 items for simplicity. The actual count depends on the API response.