Skip to content

Xiaohongshu (RedNote) User Favorited Notes API (V1) ​

GET
API health status
Healthy Available Limited Mostly unavailable No data
Loading health status...

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 ​

NameInTypeRequiredDefaultDescription
tokenquerystringYes-Access token for this API service.
userIdquerystringYes-Unique user identifier on Xiaohongshu.
lastCursorquerystringNoFor the next page, pass the cursor from the previous response. Omit or pass an empty value for the first page.

Code Samples ​

bash
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/xiaohongshu/get-user-faved-note-list/v1?token=YOUR_API_KEY&userId=VALUE'
text
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.
python
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")
js
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`);
  }
}
java
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");
        }
    }
}
go
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
<?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.

FieldTypeDescription
idstringID of the saved note.
display_titlestringTitle displayed for the note in the list.
titlestringTitle of the note, when available.
descstringText or description returned for the note.
typestringNote type reported by Xiaohongshu.
create_timeintegerNote creation time reported as a Unix timestamp in seconds.
last_update_timeintegerLast updated time reported as a Unix timestamp in seconds. It can be zero.
ip_locationstringIP location label displayed by Xiaohongshu for the note, when available.
is_goods_notebooleanWhether Xiaohongshu identifies the note as a product note.
xsec_tokenstringXiaohongshu token associated with the note link, when returned.
note_attributesarrayNote attributes reported by Xiaohongshu.
note_attributes[]stringRaw note attribute value returned by Xiaohongshu.
atsarrayAccounts 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.

FieldTypeDescription
cursorstringContinuation cursor returned for the next page. Pass it unchanged as lastCursor. It may be absent or empty.
has_morebooleanWhether the response reports that more items are available.
notesarraySaved notes returned for the requested profile. An empty array can also occur when the collection is unavailable.
Engagement3 fields

data.notes[]

FieldTypeDescription
comments_countintegerNumber of comments reported for the note.
collected_countintegerNumber of saves reported for the note.
share_countintegerShare count reported for the note.
Author7 fields

data.notes[].user

Author of the note.

FieldTypeDescription
user_idstringAccount ID of the note author.
imagesstringAvatar image URL for the author, when available.
nicknamestringAuthor's display name.
followedbooleanFollow status reported by Xiaohongshu for the current response context.
red_official_verifiedbooleanOfficial verification status reported by Xiaohongshu.
red_official_verify_typeintegerOfficial verification category code reported by Xiaohongshu.
show_red_official_verify_iconbooleanFlag 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.

FieldTypeDescription
mediaobjectPlayback metadata supplied for the Live Photo.
media.video_idstringVideo identifier reported for the Live Photo.
media.videoobjectVideo metadata associated with the Live Photo.
media.video.widthintegerVideo width in pixels.
media.video.heightintegerVideo height in pixels.
media.video.durationintegerVideo duration value reported for the Live Photo.
media.video.drm_typeintegerRaw DRM category code reported for the video.
media.video.hdr_typeintegerRaw HDR category code reported for the video.
media.video.stream_typesarrayStream type codes reported for the video.
media.video.stream_types[]integerRaw stream type code reported for the video.
media.streamobjectStream variants grouped by the codec labels returned by Xiaohongshu.
media.stream.h264arrayH.264 streams returned for the Live Photo.
media.stream.h265arrayH.265 streams returned for the Live Photo.
media.stream.h265[]objectMetadata for one H.265 Live Photo stream.
media.stream.h265[].master_urlstringPrimary URL supplied for this stream.
media.stream.h265[].backup_urlsarrayAlternate URLs supplied for the stream.
media.stream.h265[].backup_urls[]stringAlternate stream URL.
media.stream.h265[].widthintegerStream width in pixels.
media.stream.h265[].heightintegerStream height in pixels.
media.stream.h265[].fpsintegerFrame rate reported for the stream.
media.stream.h265[].formatstringMedia format reported for the stream.
media.stream.h265[].video_codecstringVideo codec reported for the stream.
media.stream.h265[].audio_codecstringAudio codec reported for the stream. It may be empty.
media.stream.h265[].audio_channelsintegerNumber of audio channels reported for the stream.
media.stream.h265[].avg_bitrateintegerAverage bitrate value reported for the stream.
media.stream.h265[].video_bitrateintegerVideo bitrate value reported for the stream.
media.stream.h265[].audio_bitrateintegerAudio bitrate value reported for the stream.
media.stream.h265[].quality_typestringRaw quality label reported for the stream.
media.stream.h265[].stream_descstringDescription supplied by Xiaohongshu for the stream.
media.stream.h265[].durationintegerStream duration value reported by Xiaohongshu.
media.stream.h265[].video_durationintegerVideo duration value reported for the stream.
media.stream.h265[].audio_durationintegerAudio duration value reported for the stream.
media.stream.h265[].sizeintegerStream size value reported by Xiaohongshu.
media.stream.h266arrayH.266 stream list returned by Xiaohongshu. It may be empty.
media.stream.av1arrayAV1 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.

FieldTypeDescription
urlstringImage URL.
originalstringURL supplied in the original-image field.
widthintegerImage width recorded in the metadata, in pixels.
heightintegerImage height recorded in the metadata, in pixels.
fileidstringPlatform file identifier for the image.
indexintegerImage position index reported by the platform.
url_size_largestringURL supplied for the large-size image variant.
live_photo_file_idstringFile ID reported for the image’s Live Photo.
Video information7 fields

data.notes[].video_info_v2

Media information returned for some video notes.

FieldTypeDescription
imageobjectImages associated with the video.
image.thumbnailstringVideo thumbnail URL, when available.
image.first_framestringURL for the first frame of the video, when available.
mediaobjectVideo and playback stream metadata for the note.
media.video_idintegerNumeric video identifier reported by Xiaohongshu.
capaobjectAdditional metadata for the video.
capa.durationintegerVideo 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.

FieldTypeDescription
h264arrayH.264 streams returned for the video note.
h264[]objectMetadata for one H.264 video stream.
h264[].master_urlstringPrimary URL supplied for this stream.
h264[].backup_urlsarrayAlternate URLs supplied for the stream.
h264[].backup_urls[]stringAlternate stream URL.
h264[].widthintegerStream width in pixels.
h264[].heightintegerStream height in pixels.
h264[].fpsintegerFrame rate reported for the stream.
h264[].formatstringMedia format reported for the stream.
h264[].video_codecstringVideo codec reported for the stream.
h264[].audio_codecstringAudio codec reported for the stream. It may be empty.
h264[].audio_channelsintegerNumber of audio channels reported for the stream.
h264[].avg_bitrateintegerAverage bitrate value reported for the stream.
h264[].video_bitrateintegerVideo bitrate value reported for the stream.
h264[].audio_bitrateintegerAudio bitrate value reported for the stream.
h264[].quality_typestringRaw quality label reported for the stream.
h264[].stream_descstringDescription supplied by Xiaohongshu for the stream.
h264[].durationintegerTotal duration of the stream in milliseconds.
h264[].video_durationintegerDuration of the video track in milliseconds.
h264[].audio_durationintegerDuration of the audio track in milliseconds. It may be zero when the stream has no audio.
h264[].sizeintegerSize of the stream in bytes.
h265arrayH.265 streams returned for the video note.
h265[]objectMetadata for one H.265 video stream.
h265[].master_urlstringPrimary URL supplied for this stream.
h265[].backup_urlsarrayAlternate URLs supplied for the stream.
h265[].backup_urls[]stringAlternate stream URL.
h265[].widthintegerStream width in pixels.
h265[].heightintegerStream height in pixels.
h265[].fpsintegerFrame rate reported for the stream.
h265[].formatstringMedia format reported for the stream.
h265[].video_codecstringVideo codec reported for the stream.
h265[].audio_codecstringAudio codec reported for the stream. It may be empty.
h265[].audio_channelsintegerNumber of audio channels reported for the stream.
h265[].avg_bitrateintegerAverage bitrate value reported for the stream.
h265[].video_bitrateintegerVideo bitrate value reported for the stream.
h265[].audio_bitrateintegerAudio bitrate value reported for the stream.
h265[].quality_typestringRaw quality label reported for the stream.
h265[].stream_descstringDescription supplied by Xiaohongshu for the stream.
h265[].durationintegerTotal duration of the stream in milliseconds.
h265[].video_durationintegerDuration of the video track in milliseconds.
h265[].audio_durationintegerDuration of the audio track in milliseconds. It may be zero when the stream has no audio.
h265[].sizeintegerSize of the stream in bytes.
h266arrayH.266 streams when present.
h266[]objectMetadata for one H.266 video stream.
h266[].master_urlstringPrimary URL supplied for this stream.
h266[].backup_urlsarrayAlternate URLs supplied for the stream.
h266[].backup_urls[]stringAlternate stream URL.
h266[].widthintegerStream width in pixels.
h266[].heightintegerStream height in pixels.
h266[].fpsintegerFrame rate reported for the stream.
h266[].formatstringMedia format reported for the stream.
h266[].video_codecstringVideo codec reported for the stream.
h266[].audio_codecstringAudio codec reported for the stream. It may be empty.
h266[].audio_channelsintegerNumber of audio channels reported for the stream.
h266[].avg_bitrateintegerAverage bitrate value reported for the stream.
h266[].video_bitrateintegerVideo bitrate value reported for the stream.
h266[].audio_bitrateintegerAudio bitrate value reported for the stream.
h266[].quality_typestringRaw quality label reported for the stream.
h266[].stream_descstringDescription supplied by Xiaohongshu for the stream.
h266[].durationintegerTotal duration of the stream in milliseconds.
h266[].video_durationintegerDuration of the video track in milliseconds.
h266[].audio_durationintegerDuration of the audio track in milliseconds. It may be zero when the stream has no audio.
h266[].sizeintegerSize of the stream in bytes.
av1arrayAV1 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.

FieldTypeDescription
AACarrayAAC audio stream entries when returned.
AAC[]object-
AAC[].audio_codecstringAudio codec label.
AAC[].audio_channelsintegerNumber of channels in the audio stream.
AAC[].master_urlstringPrimary URL for the audio stream.
AAC[].backup_urlsarrayAlternative URLs for the audio stream.
AAC[].backup_urls[]string-
AAC[].formatstringMedia format reported for the audio stream.
AAC[].audio_profilestringAudio profile reported for the stream.
AAC[].audio_samplerateintegerAudio sample rate in hertz.
AAC[].audio_durationintegerDuration of the audio stream in milliseconds.
AAC[].sizeintegerSize of the audio stream in bytes.
AAC[].audio_bitrateintegerAudio bitrate value reported for the stream.
AAC[].avg_bitrateintegerAverage bitrate value reported for the audio stream.
Other fields9 fields
Field pathTypeDescription
data.notes[].video_info_v2.media.videoobjectVideo metadata associated with the video note.
data.notes[].video_info_v2.media.video.widthintegerVideo width in pixels.
data.notes[].video_info_v2.media.video.heightintegerVideo height in pixels.
data.notes[].video_info_v2.media.video.durationintegerVideo duration reported in seconds.
data.notes[].video_info_v2.media.video.drm_typeintegerRaw DRM category code reported for the video.
data.notes[].video_info_v2.media.video.hdr_typeintegerRaw HDR category code reported for the video.
data.notes[].video_info_v2.media.video.stream_typesarrayStream type codes reported for the video.
data.notes[].video_info_v2.media.video.stream_types[]integerRaw stream type code reported for the video.
data.notes[].video_info_v2.media.video.md5stringMD5 value reported in the video metadata.

Response Example ​

Loading the response example...