Xiaohongshu (RedNote) User Favorited Notes API (V1)
Retrieves a Xiaohongshu (RedNote) user's favorited notes by user ID with cursor pagination. Use it to review a user's saved content and research content interests.
Highlights
Guidance
First-page, subsequent-page, empty collection, and private collection results are billable.
Parameters
| Name | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
token | query | string | Yes | - | Access token for this API service. |
userId | query | string | Yes | - | Unique user identifier on Xiaohongshu. |
lastCursor | query | string | No | | For the next page, pass the cursor from the previous response. Omit or pass an empty value for the first page. |
Code Samples
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/xiaohongshu/get-user-faved-note-list/v1?token=YOUR_API_KEY&userId=VALUE'I want to use the "User Favorited Notes (V1)" API from JustOneAPI.
Base URL: https://api.justoneapi.com.
API Path: /api/xiaohongshu/get-user-faved-note-list/v1?token=YOUR_API_KEY&userId=VALUE
API Endpoint: BASE_URL + /api/xiaohongshu/get-user-faved-note-list/v1?token=YOUR_API_KEY&userId=VALUE
HTTP Method: GET
Authentication: Append the "token" query parameter to the URL.
OpenAPI Definition: https://docs.justoneapi.com/openapi/xiaohongshu-rednote/user-favorited-notes-v1-en.json
Parameters:
- token (query): Access token for this API service. (Required)
- userId (query): Unique user identifier on Xiaohongshu. (Required)
- lastCursor (query): For the next page, pass the cursor from the previous response. Omit or pass an empty value for the first page.
Return format: safely handle JSON or text according to the actual Content-Type.
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 the request timeout to 120 seconds. If 120 seconds is too long for your use case, use at least 60 seconds, but a small number of requests may time out before receiving a result.
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
- 602: Token Budget Exceeded
4. Code 601 means the shared account balance is insufficient. Code 602 means the current API token's own cumulative budget limit has been reached. Token budget limits do not transfer funds out of the shared account balance.
Please help me write a script in my preferred programming language to call this API and handle the response.import requests
BASE_URL = "https://api.justoneapi.com" # Provided by OpenAPI servers
url = BASE_URL + "/api/xiaohongshu/get-user-faved-note-list/v1?token=YOUR_API_KEY&userId=VALUE"
response = requests.get(url, timeout=120)
print(response.status_code)
if response.content:
content_type = response.headers.get("content-type", "").lower()
if "json" in content_type:
try:
print(response.json())
except ValueError:
print(response.text)
elif content_type.startswith("text/") or "xml" in content_type or content_type.split(";", 1)[0].strip() in {"application/javascript", "application/x-www-form-urlencoded", "application/graphql"}:
print(response.text)
else:
with open("response.bin", "wb") as output:
output.write(response.content)
print(f"Saved {len(response.content)} bytes to response.bin")const BASE_URL = "https://api.justoneapi.com"; // Provided by OpenAPI servers
const url = BASE_URL + "/api/xiaohongshu/get-user-faved-note-list/v1?token=YOUR_API_KEY&userId=VALUE";
const response = await fetch(url, {
method: "GET",
signal: AbortSignal.timeout(120000)
});
console.log(response.status);
const responseBytes = await response.arrayBuffer();
if (responseBytes.byteLength) {
const contentType = (response.headers.get("content-type") || "").toLowerCase();
const mediaType = contentType.split(";", 1)[0].trim();
const textual = contentType.startsWith("text/") || contentType.includes("json") || contentType.includes("xml") || ["application/javascript", "application/x-www-form-urlencoded", "application/graphql"].includes(mediaType);
if (textual) {
const responseText = new TextDecoder().decode(responseBytes);
let data = responseText;
if (contentType.includes("json")) {
try { data = JSON.parse(responseText); } catch { /* Keep the raw body. */ }
}
console.log(data);
} else {
console.log(`Received ${responseBytes.byteLength} binary bytes`);
}
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
public class Main {
public static void main(String[] args) throws Exception {
final String BASE_URL = "https://api.justoneapi.com"; // Provided by OpenAPI servers
final String url = BASE_URL + "/api/xiaohongshu/get-user-faved-note-list/v1?token=YOUR_API_KEY&userId=VALUE";
HttpClient client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(120)).build();
HttpRequest.Builder builder = HttpRequest.newBuilder()
.uri(URI.create(url))
.timeout(Duration.ofSeconds(120))
.method("GET", HttpRequest.BodyPublishers.noBody());
HttpRequest request = builder.build();
HttpResponse<byte[]> response = client.send(request, HttpResponse.BodyHandlers.ofByteArray());
System.out.println(response.statusCode());
String contentType = response.headers().firstValue("content-type").orElse("").toLowerCase();
String mediaType = contentType.split(";", 2)[0].trim();
if (contentType.startsWith("text/") || contentType.contains("json") || contentType.contains("xml") || mediaType.equals("application/javascript") || mediaType.equals("application/x-www-form-urlencoded") || mediaType.equals("application/graphql")) {
System.out.println(new String(response.body(), StandardCharsets.UTF_8));
} else {
Files.write(Path.of("response.bin"), response.body());
System.out.println("Saved " + response.body().length + " bytes to response.bin");
}
}
}package main
import (
"fmt"
"io"
"os"
"strings"
"net/http"
"time"
)
const BASE_URL = "https://api.justoneapi.com" // Provided by OpenAPI servers
func main() {
client := &http.Client{Timeout: 120 * time.Second}
url := BASE_URL + "/api/xiaohongshu/get-user-faved-note-list/v1?token=YOUR_API_KEY&userId=VALUE"
req, _ := http.NewRequest("GET", url, nil)
resp, _ := client.Do(req)
defer resp.Body.Close()
fmt.Println(resp.StatusCode)
bodyBytes, _ := io.ReadAll(resp.Body)
contentType := strings.ToLower(resp.Header.Get("Content-Type"))
mediaType := strings.TrimSpace(strings.SplitN(contentType, ";", 2)[0])
if strings.HasPrefix(contentType, "text/") || strings.Contains(contentType, "json") || strings.Contains(contentType, "xml") || mediaType == "application/javascript" || mediaType == "application/x-www-form-urlencoded" || mediaType == "application/graphql" {
fmt.Println(string(bodyBytes))
} else {
os.WriteFile("response.bin", bodyBytes, 0600)
fmt.Printf("Saved %d bytes to response.bin\n", len(bodyBytes))
}
}<?php
$BASE_URL = 'https://api.justoneapi.com'; // Provided by OpenAPI servers
$url = $BASE_URL . '/api/xiaohongshu/get-user-faved-note-list/v1?token=YOUR_API_KEY&userId=VALUE';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
$contentType = strtolower((string) curl_getinfo($ch, CURLINFO_CONTENT_TYPE));
curl_close($ch);
echo $status . PHP_EOL;
$mediaType = trim(explode(';', $contentType, 2)[0]);
if (str_starts_with($contentType, 'text/') || str_contains($contentType, 'json') || str_contains($contentType, 'xml') || in_array($mediaType, ['application/javascript', 'application/x-www-form-urlencoded', 'application/graphql'], true)) {
echo $response;
} else {
file_put_contents('response.bin', $response);
echo 'Saved ' . strlen($response) . ' bytes to response.bin' . PHP_EOL;
}Response Fields
Key fields in a successful response (code = 0).
Note information13 fields
data.notes[]
A note in the saved-note list.
| Field | Type | Description |
|---|---|---|
id | string | ID of the saved note. |
display_title | string | Title displayed for the note in the list. |
title | string | Title of the note, when available. |
desc | string | Text or description returned for the note. |
type | string | Note type reported by Xiaohongshu. |
create_time | integer | Note creation time reported as a Unix timestamp in seconds. |
last_update_time | integer | Last updated time reported as a Unix timestamp in seconds. It can be zero. |
ip_location | string | IP location label displayed by Xiaohongshu for the note, when available. |
is_goods_note | boolean | Whether Xiaohongshu identifies the note as a product note. |
xsec_token | string | Xiaohongshu token associated with the note link, when returned. |
note_attributes | array | Note attributes reported by Xiaohongshu. |
note_attributes[] | string | Raw note attribute value returned by Xiaohongshu. |
ats | array | Accounts mentioned in the note, when returned. |
List and pagination3 fields
data
Saved-note results and pagination fields returned when the payload is an object. A successful response can also have no data.
| Field | Type | Description |
|---|---|---|
cursor | string | Continuation cursor returned for the next page. Pass it unchanged as lastCursor. It may be absent or empty. |
has_more | boolean | Whether the response reports that more items are available. |
notes | array | Saved notes returned for the requested profile. An empty array can also occur when the collection is unavailable. |
Engagement3 fields
data.notes[]
| Field | Type | Description |
|---|---|---|
comments_count | integer | Number of comments reported for the note. |
collected_count | integer | Number of saves reported for the note. |
share_count | integer | Share count reported for the note. |
Author7 fields
data.notes[].user
Author of the note.
| Field | Type | Description |
|---|---|---|
user_id | string | Account ID of the note author. |
images | string | Avatar image URL for the author, when available. |
nickname | string | Author's display name. |
followed | boolean | Follow status reported by Xiaohongshu for the current response context. |
red_official_verified | boolean | Official verification status reported by Xiaohongshu. |
red_official_verify_type | integer | Official verification category code reported by Xiaohongshu. |
show_red_official_verify_icon | boolean | Flag indicating whether to display the official verification icon. |
Live Photos35 fields
data.notes[].images_list[].live_photo
Live Photo metadata returned for the image when available.
| Field | Type | Description |
|---|---|---|
media | object | Playback metadata supplied for the Live Photo. |
media.video_id | string | Video identifier reported for the Live Photo. |
media.video | object | Video metadata associated with the Live Photo. |
media.video.width | integer | Video width in pixels. |
media.video.height | integer | Video height in pixels. |
media.video.duration | integer | Video duration value reported for the Live Photo. |
media.video.drm_type | integer | Raw DRM category code reported for the video. |
media.video.hdr_type | integer | Raw HDR category code reported for the video. |
media.video.stream_types | array | Stream type codes reported for the video. |
media.video.stream_types[] | integer | Raw stream type code reported for the video. |
media.stream | object | Stream variants grouped by the codec labels returned by Xiaohongshu. |
media.stream.h264 | array | H.264 streams returned for the Live Photo. |
media.stream.h265 | array | H.265 streams returned for the Live Photo. |
media.stream.h265[] | object | Metadata for one H.265 Live Photo stream. |
media.stream.h265[].master_url | string | Primary URL supplied for this stream. |
media.stream.h265[].backup_urls | array | Alternate URLs supplied for the stream. |
media.stream.h265[].backup_urls[] | string | Alternate stream URL. |
media.stream.h265[].width | integer | Stream width in pixels. |
media.stream.h265[].height | integer | Stream height in pixels. |
media.stream.h265[].fps | integer | Frame rate reported for the stream. |
media.stream.h265[].format | string | Media format reported for the stream. |
media.stream.h265[].video_codec | string | Video codec reported for the stream. |
media.stream.h265[].audio_codec | string | Audio codec reported for the stream. It may be empty. |
media.stream.h265[].audio_channels | integer | Number of audio channels reported for the stream. |
media.stream.h265[].avg_bitrate | integer | Average bitrate value reported for the stream. |
media.stream.h265[].video_bitrate | integer | Video bitrate value reported for the stream. |
media.stream.h265[].audio_bitrate | integer | Audio bitrate value reported for the stream. |
media.stream.h265[].quality_type | string | Raw quality label reported for the stream. |
media.stream.h265[].stream_desc | string | Description supplied by Xiaohongshu for the stream. |
media.stream.h265[].duration | integer | Stream duration value reported by Xiaohongshu. |
media.stream.h265[].video_duration | integer | Video duration value reported for the stream. |
media.stream.h265[].audio_duration | integer | Audio duration value reported for the stream. |
media.stream.h265[].size | integer | Stream size value reported by Xiaohongshu. |
media.stream.h266 | array | H.266 stream list returned by Xiaohongshu. It may be empty. |
media.stream.av1 | array | AV1 stream list returned by Xiaohongshu. It may be empty. |
Images8 fields
data.notes[].images_list[]
Images associated with the note, which may include cover images for video notes.
| Field | Type | Description |
|---|---|---|
url | string | Image URL. |
original | string | URL supplied in the original-image field. |
width | integer | Image width recorded in the metadata, in pixels. |
height | integer | Image height recorded in the metadata, in pixels. |
fileid | string | Platform file identifier for the image. |
index | integer | Image position index reported by the platform. |
url_size_large | string | URL supplied for the large-size image variant. |
live_photo_file_id | string | File ID reported for the image’s Live Photo. |
Video information7 fields
data.notes[].video_info_v2
Media information returned for some video notes.
| Field | Type | Description |
|---|---|---|
image | object | Images associated with the video. |
image.thumbnail | string | Video thumbnail URL, when available. |
image.first_frame | string | URL for the first frame of the video, when available. |
media | object | Video and playback stream metadata for the note. |
media.video_id | integer | Numeric video identifier reported by Xiaohongshu. |
capa | object | Additional metadata for the video. |
capa.duration | integer | Video duration from this metadata, in seconds. |
Video streams64 fields
data.notes[].video_info_v2.media.stream
Stream variants grouped by the codec labels returned by Xiaohongshu.
| Field | Type | Description |
|---|---|---|
h264 | array | H.264 streams returned for the video note. |
h264[] | object | Metadata for one H.264 video stream. |
h264[].master_url | string | Primary URL supplied for this stream. |
h264[].backup_urls | array | Alternate URLs supplied for the stream. |
h264[].backup_urls[] | string | Alternate stream URL. |
h264[].width | integer | Stream width in pixels. |
h264[].height | integer | Stream height in pixels. |
h264[].fps | integer | Frame rate reported for the stream. |
h264[].format | string | Media format reported for the stream. |
h264[].video_codec | string | Video codec reported for the stream. |
h264[].audio_codec | string | Audio codec reported for the stream. It may be empty. |
h264[].audio_channels | integer | Number of audio channels reported for the stream. |
h264[].avg_bitrate | integer | Average bitrate value reported for the stream. |
h264[].video_bitrate | integer | Video bitrate value reported for the stream. |
h264[].audio_bitrate | integer | Audio bitrate value reported for the stream. |
h264[].quality_type | string | Raw quality label reported for the stream. |
h264[].stream_desc | string | Description supplied by Xiaohongshu for the stream. |
h264[].duration | integer | Total duration of the stream in milliseconds. |
h264[].video_duration | integer | Duration of the video track in milliseconds. |
h264[].audio_duration | integer | Duration of the audio track in milliseconds. It may be zero when the stream has no audio. |
h264[].size | integer | Size of the stream in bytes. |
h265 | array | H.265 streams returned for the video note. |
h265[] | object | Metadata for one H.265 video stream. |
h265[].master_url | string | Primary URL supplied for this stream. |
h265[].backup_urls | array | Alternate URLs supplied for the stream. |
h265[].backup_urls[] | string | Alternate stream URL. |
h265[].width | integer | Stream width in pixels. |
h265[].height | integer | Stream height in pixels. |
h265[].fps | integer | Frame rate reported for the stream. |
h265[].format | string | Media format reported for the stream. |
h265[].video_codec | string | Video codec reported for the stream. |
h265[].audio_codec | string | Audio codec reported for the stream. It may be empty. |
h265[].audio_channels | integer | Number of audio channels reported for the stream. |
h265[].avg_bitrate | integer | Average bitrate value reported for the stream. |
h265[].video_bitrate | integer | Video bitrate value reported for the stream. |
h265[].audio_bitrate | integer | Audio bitrate value reported for the stream. |
h265[].quality_type | string | Raw quality label reported for the stream. |
h265[].stream_desc | string | Description supplied by Xiaohongshu for the stream. |
h265[].duration | integer | Total duration of the stream in milliseconds. |
h265[].video_duration | integer | Duration of the video track in milliseconds. |
h265[].audio_duration | integer | Duration of the audio track in milliseconds. It may be zero when the stream has no audio. |
h265[].size | integer | Size of the stream in bytes. |
h266 | array | H.266 streams when present. |
h266[] | object | Metadata for one H.266 video stream. |
h266[].master_url | string | Primary URL supplied for this stream. |
h266[].backup_urls | array | Alternate URLs supplied for the stream. |
h266[].backup_urls[] | string | Alternate stream URL. |
h266[].width | integer | Stream width in pixels. |
h266[].height | integer | Stream height in pixels. |
h266[].fps | integer | Frame rate reported for the stream. |
h266[].format | string | Media format reported for the stream. |
h266[].video_codec | string | Video codec reported for the stream. |
h266[].audio_codec | string | Audio codec reported for the stream. It may be empty. |
h266[].audio_channels | integer | Number of audio channels reported for the stream. |
h266[].avg_bitrate | integer | Average bitrate value reported for the stream. |
h266[].video_bitrate | integer | Video bitrate value reported for the stream. |
h266[].audio_bitrate | integer | Audio bitrate value reported for the stream. |
h266[].quality_type | string | Raw quality label reported for the stream. |
h266[].stream_desc | string | Description supplied by Xiaohongshu for the stream. |
h266[].duration | integer | Total duration of the stream in milliseconds. |
h266[].video_duration | integer | Duration of the video track in milliseconds. |
h266[].audio_duration | integer | Duration of the audio track in milliseconds. It may be zero when the stream has no audio. |
h266[].size | integer | Size of the stream in bytes. |
av1 | array | AV1 stream list returned by Xiaohongshu. It may be empty. |
Audio streams14 fields
data.notes[].video_info_v2.media.audio_stream
Audio streams grouped by codec when returned.
| Field | Type | Description |
|---|---|---|
AAC | array | AAC audio stream entries when returned. |
AAC[] | object | - |
AAC[].audio_codec | string | Audio codec label. |
AAC[].audio_channels | integer | Number of channels in the audio stream. |
AAC[].master_url | string | Primary URL for the audio stream. |
AAC[].backup_urls | array | Alternative URLs for the audio stream. |
AAC[].backup_urls[] | string | - |
AAC[].format | string | Media format reported for the audio stream. |
AAC[].audio_profile | string | Audio profile reported for the stream. |
AAC[].audio_samplerate | integer | Audio sample rate in hertz. |
AAC[].audio_duration | integer | Duration of the audio stream in milliseconds. |
AAC[].size | integer | Size of the audio stream in bytes. |
AAC[].audio_bitrate | integer | Audio bitrate value reported for the stream. |
AAC[].avg_bitrate | integer | Average bitrate value reported for the audio stream. |
Other fields9 fields
| Field path | Type | Description |
|---|---|---|
data.notes[].video_info_v2.media.video | object | Video metadata associated with the video note. |
data.notes[].video_info_v2.media.video.width | integer | Video width in pixels. |
data.notes[].video_info_v2.media.video.height | integer | Video height in pixels. |
data.notes[].video_info_v2.media.video.duration | integer | Video duration reported in seconds. |
data.notes[].video_info_v2.media.video.drm_type | integer | Raw DRM category code reported for the video. |
data.notes[].video_info_v2.media.video.hdr_type | integer | Raw HDR category code reported for the video. |
data.notes[].video_info_v2.media.video.stream_types | array | Stream type codes reported for the video. |
data.notes[].video_info_v2.media.video.stream_types[] | integer | Raw stream type code reported for the video. |
data.notes[].video_info_v2.media.video.md5 | string | MD5 value reported in the video metadata. |