Skip to content

Xiaohongshu E-commerce (RedNote) Product Search API (V1) ​

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

Searches Xiaohongshu E-commerce (RedNote) products by keyword with page and search-ID pagination; pages after the first require the search ID returned by the initial search. Use it to discover marketplace products and continue through multi-page results.

Parameters ​

NameInTypeRequiredDefaultDescription
tokenquerystringYes-Authentication token for this API service.
keywordquerystringYes-Search keyword.
pagequerystringNo-Page number, starting from 1.
searchIdquerystringNoSearch ID returned by the first-page response; required when page is greater than 1.

Code Samples ​

bash
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/xiaohongshu-ec/search-products/v1?token=YOUR_API_KEY&keyword=VALUE'
text
I want to use the "Product Search (V1)" API from JustOneAPI.
Base URL: https://api.justoneapi.com.
API Path: /api/xiaohongshu-ec/search-products/v1?token=YOUR_API_KEY&keyword=VALUE
API Endpoint: BASE_URL + /api/xiaohongshu-ec/search-products/v1?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-e-commerce-rednote/product-search-v1-en.json

Parameters:
- token (query): Authentication token for this API service. (Required)
- keyword (query): Search keyword. (Required)
- page (query): Page number, starting from 1.
- searchId (query): Search ID returned by the first-page response; required when page is greater than 1.

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-ec/search-products/v1?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-ec/search-products/v1?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-ec/search-products/v1?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-ec/search-products/v1?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-ec/search-products/v1?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).

Pagination and status6 fields

data

FieldTypeDescription
search_idstringSearch ID returned for this search. Pass it unchanged as searchId when requesting subsequent pages with the same keyword.
pageintegerPage number reported for the current search response.
next_pageintegerNext page number returned by the search. When requesting it, reuse the search ID.
successbooleanWhether the payload reports a successful search.
codeintegerStatus code reported inside the search payload.
msgstringStatus message reported inside the search payload.
Result cards3 fields

data.data.module.data[]

Search result cards. This list can contain product cards and separate related-keyword cards.

FieldTypeDescription
idstringIdentifier of the result card within the page layout.
card_namestringName of the result card as returned.
card_typestringType of the result card as returned.
Product information5 fields

data.data.module.data[].content

Card content. Product fields are present on product cards. Related-keyword cards can contain scene_keywords.

FieldTypeDescription
idstringIdentifier of the card content. On product cards this is the product ID.
titlestringProduct title shown on the card.
goods_typestringProduct type reported by the search.
stock_statusintegerStock status code reported for the product.
linkstringRedNote app link for the product.
Images and prices11 fields

data.data.module.data[].content

FieldTypeDescription
imagearrayProduct images shown on the search card.
image[]object-
image[].urlstringImage URL.
image[].widthintegerReported image width.
image[].heightintegerReported image height.
image[].aspect_rationumberReported width-to-height ratio of the product image.
price_infoobjectPrice information returned on the product card.
price_info.pricenumberCurrent product price reported on the card.
price_info.origin_pricenumberOriginal or reference price reported on the card.
price_info.symbolstringCurrency symbol used for the displayed price.
price_info.foreign_pricestringPrice display text returned in the foreign-price field.
Shop5 fields

data.data.module.data[].content.vendor

Shop information shown on the product card.

FieldTypeDescription
vendor_namestringDisplay name of the shop.
vendor_idstringShop ID returned for the product.
seller_idstringSeller ID returned for the product.
vendor_typestringShop type reported by the search.
vendor_linkstringRedNote app link for the shop.
Related searches4 fields

data.data.module.data[].content

FieldTypeDescription
scene_keywordsarrayRelated keyword suggestions returned on a separate card, when available.
scene_keywords[]object-
scene_keywords[].scene_keywordstringText of a related keyword suggestion.
scene_keywords[].linkstringRedNote app link for the related keyword.
Product card labels48 fields

data.data.module.data[].content.tag_strategy_map

Optional product card labels, grouped by their placement in the app.

FieldTypeDescription
before_pricearrayText labels shown before the product price.
before_price[]object-
before_price[].typestringDisplay label type.
before_price[].tag_typeintegerDisplay label code.
before_price[].tag_contentobjectDisplay text associated with the label.
before_price[].tag_content.contentstringText shown in the label.
before_price[].tag_content_listarrayDisplay text fragments returned for the label.
before_price[].tag_content_list[]string-
after_pricearrayText labels shown after the product price.
after_price[]object-
after_price[].typestringDisplay label type.
after_price[].tag_typeintegerDisplay label code.
after_price[].tag_contentobjectDisplay text associated with the label.
after_price[].tag_content.contentstringText shown in the label.
after_price[].tag_content_listarrayDisplay text fragments returned for the label.
after_price[].tag_content_list[]string-
after_shop_namearrayText labels shown after the shop name.
after_shop_name[]object-
after_shop_name[].typestringDisplay label type.
after_shop_name[].tag_typeintegerDisplay label code.
after_shop_name[].tag_contentobjectDisplay text associated with the label.
after_shop_name[].tag_content.contentstringText shown in the label.
after_shop_name[].tag_content_listarrayDisplay text fragments returned for the label.
after_shop_name[].tag_content_list[]string-
upon_titlearrayText labels shown above the product title.
upon_title[]object-
upon_title[].typestringDisplay label type.
upon_title[].tag_typeintegerDisplay label code.
upon_title[].tag_contentobjectDisplay text associated with the label.
upon_title[].tag_content.contentstringText shown in the label.
upon_title[].tag_content_listarrayDisplay text fragments returned for the label.
upon_title[].tag_content_list[]string-
behaviorarrayBehavior labels returned for the product card.
behavior[]object-
behavior[].typestringDisplay label type.
behavior[].tag_typeintegerDisplay label code.
behavior[].tag_contentobjectDisplay text associated with the label.
behavior[].tag_content.contentstringText shown in the label.
behavior[].tag_content_listarrayDisplay text fragments returned for the label.
behavior[].tag_content_list[]string-
before_titlearrayLabels shown before the product title.
before_title[]object-
before_title[].typestringDisplay label type.
before_title[].tag_typeintegerDisplay label code.
before_title[].tag_imageobjectImage used in the display label.
before_title[].tag_image.urlstringImage URL.
before_title[].tag_image.widthintegerReported image width.
before_title[].tag_image.heightintegerReported image height.
Card order5 fields

data.data.hierarchy

Search result layout and pagination indicators.

FieldTypeDescription
commonobjectCommon search layout metadata.
common.load_morebooleanWhether the returned layout indicates that more results can be loaded.
structureobjectCard placement in the result layout.
structure.rootarrayResult card IDs in root layout order. They correspond to the IDs in module.data.
structure.root[]string-

Response Example ​

Loading the response example...