Skip to content

Xiaohongshu (RedNote) Keyword Note Search API (V2) ​

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

Searches Xiaohongshu (RedNote) notes by keyword with page-based pagination, sorting and note-type filters. The V2 noteTime filter may return notes outside the selected time range. This endpoint does not search user accounts.

Highlights ​

Guidance

The noteTime filter is not precise. For example, requesting notes from the past day may still return notes published outside that time range. For more accurate publish-time filtering, use V4.

Parameters ​

NameInTypeRequiredDefaultDescription
tokenquerystringYes-Access token for this API service.
keywordquerystringYes-Search keyword.
pagequeryintegerNo1Page number for pagination. Start at 1, then increment page while keeping the keyword and filters unchanged.
sortquerystringNogeneralSort order for the result set.


Available Values:

- general: General

- popularity_descending: Popularity Descending

- time_descending: Time Descending

- comment_descending: Comment Descending

- collect_descending: Collect Descending
noteTypequerystringNo_0Note type filter.


Available Values:

- _0: General

- _1: Video

- _2: Normal
noteTimequerystringNo-Note publish time filter. Results may include notes published outside the selected time range.


Available Values:

- ONE_DAY: Within one day

- ONE_WEEK: Within a week

- HALF_YEAR: Within half a year

Code Samples ​

bash
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/xiaohongshu/search-note/v2?token=YOUR_API_KEY&keyword=VALUE'
text
I want to use the "Keyword Note Search (V2)" API from JustOneAPI.
Base URL: https://api.justoneapi.com.
API Path: /api/xiaohongshu/search-note/v2?token=YOUR_API_KEY&keyword=VALUE
API Endpoint: BASE_URL + /api/xiaohongshu/search-note/v2?token=YOUR_API_KEY&keyword=VALUE
HTTP Method: GET
Authentication: Append the "token" query parameter to the URL.
OpenAPI Definition: https://docs.justoneapi.com/openapi/xiaohongshu-rednote/note-search-v2-en.json

Parameters:
- token (query): Access token for this API service. (Required)
- keyword (query): Search keyword. (Required)
- page (query): Page number for pagination. Start at 1, then increment page while keeping the keyword and filters unchanged.
- sort (query): Sort order for the result set.

Available Values:
- `general`: General
- `popularity_descending`: Popularity Descending
- `time_descending`: Time Descending
- `comment_descending`: Comment Descending
- `collect_descending`: Collect Descending
- noteType (query): Note type filter.

Available Values:
- `_0`: General
- `_1`: Video
- `_2`: Normal
- noteTime (query): Note publish time filter. Results may include notes published outside the selected time range.

Available Values:
- `ONE_DAY`: Within one day
- `ONE_WEEK`: Within a week
- `HALF_YEAR`: Within half a year

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/search-note/v2?token=YOUR_API_KEY&keyword=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/search-note/v2?token=YOUR_API_KEY&keyword=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/search-note/v2?token=YOUR_API_KEY&keyword=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/search-note/v2?token=YOUR_API_KEY&keyword=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/search-note/v2?token=YOUR_API_KEY&keyword=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).

Search results6 fields

data

Fields returned when a Xiaohongshu keyword note search response contains a result page.

FieldTypeDescription
itemsarrayThe results on the requested search page. Successful responses can contain an empty list, and notes can repeat across pages.
search_request_idstringThe search request identifier returned by Xiaohongshu.
service_statusstringThe search service status label returned in the payload.
resultobjectAdditional platform result information, when returned.
result.successbooleanThe success flag from the Xiaohongshu result information.
result.messagestringThe message from the Xiaohongshu result information.
Result types and ads42 fields

data.items[]

A search result card.

FieldTypeDescription
model_typestringThe card model type reported by Xiaohongshu. Observed cards include note and ads.
adsobjectThe advertisement information associated with an ad card, when present.
ads.ads_idstringThe identifier reported for the advertisement.
ads.model_typestringThe model type code reported for the advertisement.
ads.ad_tagstringThe display tag text returned for the advertisement.
ads.show_tagbooleanWhether the platform indicates that the advertisement tag should be displayed.
ads.noteobjectThe Xiaohongshu note associated with the advertisement, when returned.
ads.note.idstringThe Xiaohongshu note ID.
ads.note.typestringThe note type reported by Xiaohongshu. Observed values include normal for image notes and video for video notes.
ads.note.titlestringThe note title, when returned.
ads.note.descstringThe note text or description returned with the search card.
ads.note.timestampintegerThe note timestamp returned with the result, as a Unix timestamp in seconds.
ads.note.update_timeintegerThe update timestamp supplied for the search result, as a Unix timestamp in milliseconds.
ads.note.last_update_timeintegerThe last update time reported for the note, as a Unix timestamp in seconds. It can be zero.
ads.note.liked_countintegerThe like count reported for the search card.
ads.note.nice_countintegerThe separate nice count reported by Xiaohongshu for the note.
ads.note.comments_countintegerThe number of comments reported for the note.
ads.note.collected_countintegerThe number of saves reported for the note.
ads.note.shared_countintegerThe number of shares reported for the note.
ads.note.likedbooleanThe like status reported by Xiaohongshu for the current response context.
ads.note.nicedbooleanThe separate nice status reported by Xiaohongshu for the current response context.
ads.note.collectedbooleanThe save status reported by Xiaohongshu for the current response context.
ads.note.has_musicbooleanWhether the response indicates music is associated with the note.
ads.note.cover_image_indexintegerThe index reported for the cover image in images_list.
ads.note.note_attributesarrayNote attributes reported by Xiaohongshu.
ads.note.xsec_tokenstringThe Xiaohongshu token associated with the note link, when returned.
ads.note.userobjectAuthor information returned for the note.
ads.note.user.useridstringThe Xiaohongshu user ID of the note author.
ads.note.user.red_idstringThe author's displayed Xiaohongshu account ID.
ads.note.user.nicknamestringThe author's display name.
ads.note.user.imagesstringThe author's profile avatar URL.
ads.note.user.red_official_verifiedbooleanThe official verification flag returned for the author.
ads.note.user.red_official_verify_typeintegerThe official verification type code reported for the author.
ads.note.user.show_red_official_verify_iconbooleanWhether the platform indicates that the official verification icon should be displayed.
ads.note.images_listarrayImages associated with the note, which can include cover images for video notes.
ads.note.images_list[]objectAn image associated with the note.
ads.note.images_list[].fileidstringThe platform file ID of the image.
ads.note.images_list[].widthintegerThe width value returned for the image.
ads.note.images_list[].heightintegerThe height value returned for the image.
ads.note.images_list[].urlstringThe image URL returned for display.
ads.note.images_list[].originalstringThe original image URL, when returned.
ads.note.images_list[].url_size_largestringThe large image URL, when returned.
Note information13 fields

data.items[].note

The note associated with an ordinary note card, when present.

FieldTypeDescription
idstringThe Xiaohongshu note ID.
typestringThe note type reported by Xiaohongshu. Observed values include normal for image notes and video for video notes.
titlestringThe note title, when returned.
descstringThe note text or description returned with the search card.
timestampintegerThe note timestamp returned with the result, as a Unix timestamp in seconds.
update_timeintegerThe update timestamp supplied for the search result, as a Unix timestamp in milliseconds.
last_update_timeintegerThe last update time reported for the note, as a Unix timestamp in seconds. It can be zero.
has_musicbooleanWhether the response indicates music is associated with the note.
video_durationstringThe video duration returned as display text, such as 1:05.
cover_image_indexintegerThe index reported for the cover image in images_list.
note_attributesarrayNote attributes reported by Xiaohongshu.
note_attributes[]stringA note attribute value as returned by Xiaohongshu.
xsec_tokenstringThe Xiaohongshu token associated with the note link, when returned.
Engagement8 fields

data.items[].note

FieldTypeDescription
liked_countintegerThe like count reported for the search card.
nice_countintegerThe separate nice count reported by Xiaohongshu for the note.
comments_countintegerThe number of comments reported for the note.
collected_countintegerThe number of saves reported for the note.
shared_countintegerThe number of shares reported for the note.
likedbooleanThe like status reported by Xiaohongshu for the current response context.
nicedbooleanThe separate nice status reported by Xiaohongshu for the current response context.
collectedbooleanThe save status reported by Xiaohongshu for the current response context.
Author and mentions13 fields

data.items[].note

FieldTypeDescription
userobjectAuthor information returned for the note.
user.useridstringThe Xiaohongshu user ID of the note author.
user.red_idstringThe author's displayed Xiaohongshu account ID.
user.nicknamestringThe author's display name.
user.imagesstringThe author's profile avatar URL.
user.followedbooleanThe follow flag returned for the author in the current response context.
user.red_official_verifiedbooleanThe official verification flag returned for the author.
user.red_official_verify_typeintegerThe official verification type code reported for the author.
user.show_red_official_verify_iconbooleanWhether the platform indicates that the official verification icon should be displayed.
at_user_listarrayAccounts mentioned in the note, when returned.
at_user_list[]objectAn account mentioned in the note.
at_user_list[].user_idstringThe Xiaohongshu user ID of the mentioned account.
at_user_list[].nicknamestringThe display name returned for the mentioned account.
Live Photos35 fields

data.items[].note.images_list[].live_photo

Live Photo metadata returned for the image when available.

FieldTypeDescription
mediaobjectPlayback metadata supplied for the Live Photo.
media.video_idintegerThe numeric platform video ID returned 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 reported in whole seconds.
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.h264[]objectMetadata for one H.264 Live Photo stream.
media.stream.h264[].master_urlstringPrimary URL supplied for this stream.
media.stream.h264[].backup_urlsarrayAlternate URLs supplied for the stream.
media.stream.h264[].backup_urls[]stringAlternate stream URL.
media.stream.h264[].widthintegerStream width in pixels.
media.stream.h264[].heightintegerStream height in pixels.
media.stream.h264[].fpsintegerFrame rate reported for the stream.
media.stream.h264[].formatstringMedia format reported for the stream.
media.stream.h264[].video_codecstringVideo codec reported for the stream.
media.stream.h264[].audio_codecstringAudio codec reported for the stream. It may be empty.
media.stream.h264[].audio_channelsintegerNumber of audio channels reported for the stream.
media.stream.h264[].avg_bitrateintegerAverage bitrate value reported for the stream.
media.stream.h264[].video_bitrateintegerVideo bitrate value reported for the stream.
media.stream.h264[].audio_bitrateintegerAudio bitrate value reported for the stream.
media.stream.h264[].quality_typestringRaw quality label reported for the stream.
media.stream.h264[].stream_descstringDescription supplied by Xiaohongshu for the stream.
media.stream.h264[].durationintegerStream duration value reported by Xiaohongshu.
media.stream.h264[].video_durationintegerVideo duration value reported for the stream.
media.stream.h264[].audio_durationintegerAudio duration value reported for the stream.
media.stream.h264[].sizeintegerStream size value reported by Xiaohongshu.
media.stream.h265arrayH.265 streams returned for the Live Photo.
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.
Images7 fields

data.items[].note.images_list[]

FieldTypeDescription
fileidstringThe platform file ID of the image.
widthintegerThe width value returned for the image.
heightintegerThe height value returned for the image.
urlstringThe image URL returned for display.
originalstringThe original image URL, when returned.
url_size_largestringThe large image URL, when returned.
live_photo_file_idstringThe platform file ID of the Live Photo, when returned.
Video64 fields

data.items[].note.video_info_v2

Video metadata and media streams returned for the note, when available.

FieldTypeDescription
imageobjectPreview images returned for the video.
image.first_framestringThe URL returned for the first-frame image.
image.thumbnailstringThe thumbnail image URL, when returned.
image.thumbnail_dimstringAdditional thumbnail URL supplied for the video.
mediaobjectVideo and playback stream metadata for the note.
media.videoobjectVideo metadata associated with the video note.
media.video.widthintegerVideo width in pixels.
media.video.heightintegerVideo height in pixels.
media.video.durationintegerVideo duration reported in whole seconds.
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.video.md5stringMD5 value reported in the video metadata.
media.streamobjectStream variants grouped by the codec labels returned by Xiaohongshu.
media.stream.h264arrayH.264 streams returned for the video note.
media.stream.h264[]objectMetadata for one H.264 video stream.
media.stream.h264[].master_urlstringPrimary URL supplied for this stream.
media.stream.h264[].backup_urlsarrayAlternate URLs supplied for the stream.
media.stream.h264[].backup_urls[]stringAlternate stream URL.
media.stream.h264[].widthintegerStream width in pixels.
media.stream.h264[].heightintegerStream height in pixels.
media.stream.h264[].fpsintegerFrame rate reported for the video, in frames per second.
media.stream.h264[].formatstringMedia format reported for the stream.
media.stream.h264[].video_codecstringVideo codec reported for the stream.
media.stream.h264[].audio_codecstringAudio codec reported for the stream. It may be empty.
media.stream.h264[].audio_channelsintegerNumber of audio channels reported for the stream.
media.stream.h264[].avg_bitrateintegerAverage stream bitrate in bits per second.
media.stream.h264[].video_bitrateintegerBitrate reported for the video track, in bits per second.
media.stream.h264[].audio_bitrateintegerBitrate reported for the audio track, in bits per second.
media.stream.h264[].quality_typestringRaw quality label reported for the stream.
media.stream.h264[].stream_descstringDescription supplied by Xiaohongshu for the stream.
media.stream.h264[].durationintegerTotal stream duration in milliseconds.
media.stream.h264[].video_durationintegerDuration of the video track in milliseconds.
media.stream.h264[].audio_durationintegerDuration of the audio track in milliseconds. Zero can indicate that there is no audio track.
media.stream.h264[].sizeintegerStream file size in bytes.
media.stream.h265arrayH.265 streams returned for the video note.
media.stream.h265[]objectMetadata for one H.265 video 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 video, in frames per second.
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 stream bitrate in bits per second.
media.stream.h265[].video_bitrateintegerBitrate reported for the video track, in bits per second.
media.stream.h265[].audio_bitrateintegerBitrate reported for the audio track, in bits per second.
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[].durationintegerTotal stream duration in milliseconds.
media.stream.h265[].video_durationintegerDuration of the video track in milliseconds.
media.stream.h265[].audio_durationintegerDuration of the audio track in milliseconds. Zero can indicate that there is no audio track.
media.stream.h265[].sizeintegerStream file size in bytes.
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.
media.video_idintegerThe numeric platform video ID returned with the video metadata.
capaobjectAdditional metadata for the video.
capa.durationintegerVideo duration from this metadata, in seconds.
consumerobjectPlayback options reported for the video.
consumer.can_super_resolutionbooleanWhether playback metadata reports support for super-resolution.
Other fields2 fields
Field pathTypeDescription
data.items[].note.images_listarrayImages associated with the note, which can include cover images for video notes.
data.items[].note.images_list[]objectAn image associated with the note.

Response Example ​

Loading the response example...