---
title: "Xiaohongshu (RedNote) User Search API (V2)"
description: "Searches Xiaohongshu (RedNote) users by keyword with page-based pagination. Use it to support creator discovery, account research, and finding profiles related to a topic, name, or brand term."
aiUsagePrompt: true
---

# Xiaohongshu \(RedNote\) User Search API \(V2\)

<ApiTester
  method="GET"
  :path='JSON.parse("\"/api/xiaohongshu/search-user/v2\"")'
  :summary='JSON.parse("\"User Search (V2)\"")'
  openapiDefinitionUrl="https://docs.justoneapi.com/openapi/xiaohongshu-rednote/user-search-v2-en.json"
  openapiVersion="3.1.0"
  :parameters='JSON.parse("[{\"name\":\"token\",\"in\":\"query\",\"description\":\"Access token for this API service.\",\"required\":true,\"schema\":{\"type\":\"string\"}},{\"name\":\"keyword\",\"in\":\"query\",\"description\":\"Search keyword.\",\"required\":true,\"schema\":{\"type\":\"string\"}},{\"name\":\"page\",\"in\":\"query\",\"description\":\"Page number for pagination.\",\"required\":false,\"schema\":{\"type\":\"integer\",\"format\":\"int32\",\"default\":1}}]")'
  :requestBody='JSON.parse("null")'
  :responses='JSON.parse("{\"200\":{\"description\":\"OK\",\"content\":{\"application/json\":{\"schema\":{\"if\":{\"properties\":{\"code\":{\"const\":0}},\"required\":[\"code\"]},\"then\":{\"properties\":{\"data\":{\"type\":[\"object\",\"null\"],\"description\":\"User search results and filter information returned by Xiaohongshu.\",\"properties\":{\"users\":{\"type\":\"array\",\"description\":\"Matching users returned for this page. The list may be empty.\",\"items\":{\"type\":\"object\",\"description\":\"A Xiaohongshu user in the search results.\",\"properties\":{\"id\":{\"type\":\"string\",\"description\":\"Xiaohongshu user identifier returned as a string.\"},\"red_id\":{\"type\":\"string\",\"description\":\"Xiaohongshu account handle shown as the account number.\"},\"name\":{\"type\":\"string\",\"description\":\"Public display name of the user.\"},\"image\":{\"type\":\"string\",\"description\":\"Profile image URL supplied for this search result.\"},\"link\":{\"type\":\"string\",\"description\":\"App link to this user&#39;s Xiaohongshu profile.\"},\"sub_title\":{\"type\":\"string\",\"description\":\"Secondary display text, such as a formatted follower count. It may be empty.\"},\"desc\":{\"type\":\"string\",\"description\":\"Additional display text for the user, such as the account handle or a profile label.\"},\"followed\":{\"type\":\"boolean\",\"description\":\"Whether the search result marks the user as followed in the current viewing context.\"},\"self\":{\"type\":\"boolean\",\"description\":\"Whether the search result marks the user as the current account.\"},\"red_official_verified\":{\"type\":\"boolean\",\"description\":\"Whether Xiaohongshu marks the user as officially verified.\"},\"red_official_verify_type\":{\"type\":\"integer\",\"description\":\"Numeric verification category returned by Xiaohongshu.\"},\"show_red_official_verify_icon\":{\"type\":\"boolean\",\"description\":\"Whether the search result is marked to show a verification icon.\"},\"reason\":{\"type\":\"string\",\"description\":\"Explanation text provided with the result. It may be empty, including for a verified user.\"},\"tags\":{\"type\":\"array\",\"description\":\"Display labels attached to the search result, when supplied.\",\"items\":{\"type\":\"string\",\"description\":\"One display label for the search result.\"}},\"live\":{\"type\":\"object\",\"description\":\"Live room information attached to the user when returned by Xiaohongshu.\",\"properties\":{\"user_id\":{\"type\":\"string\",\"description\":\"Xiaohongshu user ID of the live room host, represented as text.\"},\"room_id\":{\"type\":\"string\",\"description\":\"Live room identifier represented as text.\"},\"live_link\":{\"type\":\"string\",\"description\":\"App link to the live room.\"},\"live_status\":{\"type\":\"integer\",\"description\":\"Numeric live room status reported by Xiaohongshu.\"},\"start_time\":{\"type\":\"integer\",\"description\":\"Live room start time as a Unix timestamp in milliseconds.\"},\"has_red_packet\":{\"type\":\"boolean\",\"description\":\"Whether the live room is marked as having a red packet.\"},\"has_draw\":{\"type\":\"boolean\",\"description\":\"Whether the live room is marked as having a prize draw.\"},\"has_goods\":{\"type\":\"boolean\",\"description\":\"Whether the live room is marked as having products.\"}}}}}},\"filters\":{\"type\":\"array\",\"description\":\"Filter groups accompanying the results. They can be present even when the user list is empty.\",\"items\":{\"type\":\"object\",\"description\":\"A filter group in the Xiaohongshu user search response.\",\"properties\":{\"id\":{\"type\":\"string\",\"description\":\"Filter group identifier.\"},\"name\":{\"type\":\"string\",\"description\":\"Display name of the filter group.\"},\"type\":{\"type\":\"string\",\"description\":\"Selection type label for the filter group.\"},\"group_show_type\":{\"type\":\"integer\",\"description\":\"Numeric display code for the filter group.\"},\"invisible\":{\"type\":\"boolean\",\"description\":\"Whether the filter group is marked as hidden.\"},\"filter_tags\":{\"type\":\"array\",\"description\":\"Options listed for this filter group.\",\"items\":{\"type\":\"object\",\"description\":\"An option listed for the filter group.\",\"properties\":{\"id\":{\"type\":\"string\",\"description\":\"Filter option identifier.\"},\"name\":{\"type\":\"string\",\"description\":\"Display name of the filter option.\"},\"origin_text\":{\"type\":\"string\",\"description\":\"Original display text of the option, which may be empty.\"},\"icon_url\":{\"type\":\"string\",\"description\":\"Option icon URL, which may be empty.\"},\"icon_url_night\":{\"type\":\"string\",\"description\":\"Night-mode option icon URL, which may be empty.\"},\"icon_tail_url\":{\"type\":\"string\",\"description\":\"Trailing icon URL for the option, which may be empty.\"},\"icon_tail_url_night\":{\"type\":\"string\",\"description\":\"Night-mode trailing icon URL, which may be empty.\"},\"need_location_info\":{\"type\":\"boolean\",\"description\":\"Whether the filter option is marked as needing location information.\"},\"sub_filters_select_type\":{\"type\":\"string\",\"description\":\"Selection type label for nested filters, which may be empty.\"},\"sub_filters\":{\"type\":\"null\",\"description\":\"Nested filter information. The observed value is null.\"}}}}}}}}}}},\"allOf\":[{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}]}}}},\"400\":{\"description\":\"Invalid request parameters or body\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"401\":{\"description\":\"Invalid or inactive access token\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"403\":{\"description\":\"Permission denied\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"429\":{\"description\":\"Request rate or daily quota limit exceeded\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"500\":{\"description\":\"Internal server error\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"503\":{\"description\":\"Service temporarily unavailable\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}}}")'
  :servers='JSON.parse("[{\"url\":\"https://api.justoneapi.com\",\"description\":\"Global production API (default)\"}]")'
  :security='JSON.parse("[]")'
  :securitySchemes='JSON.parse("{}")'
  :schemas='JSON.parse("{}")'
/>

<ApiHealthSection :api='JSON.parse("\"/api/xiaohongshu/search-user/v2\"")' />

<p>Searches Xiaohongshu (RedNote) users by keyword with page-based pagination. Use it to support creator discovery, account research, and finding profiles related to a topic, name, or brand term.</p>

## Parameters

<div class="api-doc-table api-doc-table--params">

| Name | In | Type | Required | Default | Description |
| --- | --- | --- | --- | --- | --- |
| <code>token</code> | query | <code>string</code> | Yes | - | Access token for this API service. |
| <code>keyword</code> | query | <code>string</code> | Yes | - | Search keyword. |
| <code>page</code> | query | <code>integer</code> | No | <code>1</code> | Page number for pagination. |

</div>

## Code Samples

::: code-group

```bash [🐚 cURL]
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/xiaohongshu/search-user/v2?token=YOUR_API_KEY&keyword=VALUE'
```

```text [🤖 AI Prompt]
I want to use the "User Search (V2)" API from JustOneAPI.
Base URL: https://api.justoneapi.com.
API Path: /api/xiaohongshu/search-user/v2?token=YOUR_API_KEY&keyword=VALUE
API Endpoint: BASE_URL + /api/xiaohongshu/search-user/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/user-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.

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 [🐍 Python]
import requests

BASE_URL = "https://api.justoneapi.com"  # Provided by OpenAPI servers

url = BASE_URL + "/api/xiaohongshu/search-user/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 [🌐 JavaScript]
const BASE_URL = "https://api.justoneapi.com"; // Provided by OpenAPI servers
const url = BASE_URL + "/api/xiaohongshu/search-user/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 [☕ 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-user/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 [🐹 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-user/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]
<?php
$BASE_URL = 'https://api.justoneapi.com'; // Provided by OpenAPI servers
$url = $BASE_URL . '/api/xiaohongshu/search-user/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;
}
```

:::

<div style="text-align: right; margin-top: -20px; margin-bottom: 20px;">
<a href="/openapi/xiaohongshu-rednote/user-search-v2-en.json" target="_blank" style="font-size: 12px; color: var(--vp-c-text-3); text-decoration: none; opacity: 0.8;">[OpenAPI Definition (JSON)]</a>
</div>

## Response Fields

Key fields in a successful response (`code = 0`).

<div class="api-doc-table api-doc-table--response">

| Field path | Type | Description |
| --- | --- | --- |
| <code>data</code> | <code>object &#124; null</code> | User search results and filter information returned by Xiaohongshu. |
| <code>data.users</code> | <code>array</code> | Matching users returned for this page. The list may be empty. |
| <code>data.users[]</code> | <code>object</code> | A Xiaohongshu user in the search results. |
| <code>data.users[].id</code> | <code>string</code> | Xiaohongshu user identifier returned as a string. |
| <code>data.users[].red_id</code> | <code>string</code> | Xiaohongshu account handle shown as the account number. |
| <code>data.users[].name</code> | <code>string</code> | Public display name of the user. |
| <code>data.users[].image</code> | <code>string</code> | Profile image URL supplied for this search result. |
| <code>data.users[].link</code> | <code>string</code> | App link to this user's Xiaohongshu profile. |
| <code>data.users[].sub_title</code> | <code>string</code> | Secondary display text, such as a formatted follower count. It may be empty. |
| <code>data.users[].desc</code> | <code>string</code> | Additional display text for the user, such as the account handle or a profile label. |
| <code>data.users[].followed</code> | <code>boolean</code> | Whether the search result marks the user as followed in the current viewing context. |
| <code>data.users[].self</code> | <code>boolean</code> | Whether the search result marks the user as the current account. |
| <code>data.users[].red_official_verified</code> | <code>boolean</code> | Whether Xiaohongshu marks the user as officially verified. |
| <code>data.users[].red_official_verify_type</code> | <code>integer</code> | Numeric verification category returned by Xiaohongshu. |
| <code>data.users[].show_red_official_verify_icon</code> | <code>boolean</code> | Whether the search result is marked to show a verification icon. |
| <code>data.users[].reason</code> | <code>string</code> | Explanation text provided with the result. It may be empty, including for a verified user. |
| <code>data.users[].tags</code> | <code>array</code> | Display labels attached to the search result, when supplied. |
| <code>data.users[].tags[]</code> | <code>string</code> | One display label for the search result. |
| <code>data.users[].live</code> | <code>object</code> | Live room information attached to the user when returned by Xiaohongshu. |
| <code>data.users[].live.user_id</code> | <code>string</code> | Xiaohongshu user ID of the live room host, represented as text. |
| <code>data.users[].live.room_id</code> | <code>string</code> | Live room identifier represented as text. |
| <code>data.users[].live.live_link</code> | <code>string</code> | App link to the live room. |
| <code>data.users[].live.live_status</code> | <code>integer</code> | Numeric live room status reported by Xiaohongshu. |
| <code>data.users[].live.start_time</code> | <code>integer</code> | Live room start time as a Unix timestamp in milliseconds. |
| <code>data.users[].live.has_red_packet</code> | <code>boolean</code> | Whether the live room is marked as having a red packet. |
| <code>data.users[].live.has_draw</code> | <code>boolean</code> | Whether the live room is marked as having a prize draw. |
| <code>data.users[].live.has_goods</code> | <code>boolean</code> | Whether the live room is marked as having products. |
| <code>data.filters</code> | <code>array</code> | Filter groups accompanying the results. They can be present even when the user list is empty. |
| <code>data.filters[]</code> | <code>object</code> | A filter group in the Xiaohongshu user search response. |
| <code>data.filters[].id</code> | <code>string</code> | Filter group identifier. |
| <code>data.filters[].name</code> | <code>string</code> | Display name of the filter group. |
| <code>data.filters[].type</code> | <code>string</code> | Selection type label for the filter group. |
| <code>data.filters[].group_show_type</code> | <code>integer</code> | Numeric display code for the filter group. |
| <code>data.filters[].invisible</code> | <code>boolean</code> | Whether the filter group is marked as hidden. |
| <code>data.filters[].filter_tags</code> | <code>array</code> | Options listed for this filter group. |
| <code>data.filters[].filter_tags[]</code> | <code>object</code> | An option listed for the filter group. |
| <code>data.filters[].filter_tags[].id</code> | <code>string</code> | Filter option identifier. |
| <code>data.filters[].filter_tags[].name</code> | <code>string</code> | Display name of the filter option. |
| <code>data.filters[].filter_tags[].origin_text</code> | <code>string</code> | Original display text of the option, which may be empty. |
| <code>data.filters[].filter_tags[].icon_url</code> | <code>string</code> | Option icon URL, which may be empty. |
| <code>data.filters[].filter_tags[].icon_url_night</code> | <code>string</code> | Night-mode option icon URL, which may be empty. |
| <code>data.filters[].filter_tags[].icon_tail_url</code> | <code>string</code> | Trailing icon URL for the option, which may be empty. |
| <code>data.filters[].filter_tags[].icon_tail_url_night</code> | <code>string</code> | Night-mode trailing icon URL, which may be empty. |
| <code>data.filters[].filter_tags[].need_location_info</code> | <code>boolean</code> | Whether the filter option is marked as needing location information. |
| <code>data.filters[].filter_tags[].sub_filters_select_type</code> | <code>string</code> | Selection type label for nested filters, which may be empty. |
| <code>data.filters[].filter_tags[].sub_filters</code> | <code>null</code> | Nested filter information. The observed value is null. |

</div>

## Response Example

<ApiExampleSection :api='JSON.parse("\"/api/xiaohongshu/search-user/v2\"")' />

