Xiaohongshu APIs - User Search (V2)
Searches Xiaohongshu users by keyword, returning a paginated result set with basic profile information (e.g., user ID, nickname, avatar, bio when available) and public counters/signals (when available).
Typical use cases:
- Finding creators/KOLs by niche, brand, or topic keywords
- Building creator lists for monitoring and analytics
- Discovering competitor accounts and related profiles
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
token | query | string | Yes | Access token for this API service. |
keyword | query | string | Yes | Search keyword. |
page | query | integer | No | Page number for pagination. |
Code Samples
💡 Environment Note
Default samples use https://api.justoneapi.com (prod-global). For users in Mainland China, it is recommended to replace it with http://47.117.133.51:30015 (prod-cn) for better performance. See Environment Guide.
bash
# Tip: For Mainland China, replace https://api.justoneapi.com with http://47.117.133.51:30015
curl -X GET "https://api.justoneapi.com/api/xiaohongshu/search-user/v2?token=YOUR_API_KEY&keyword=VALUE"text
I want to use the "User Search (V2)" API from Just One API.
API Endpoint: https://api.justoneapi.com/api/xiaohongshu/search-user/v2
HTTP Method: GET
Authentication: Append "?token=YOUR_API_KEY" to the URL.
OpenAPI Definition: https://docs.justoneapi.com/openapi/xiaohongshu-apis/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: JSON
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 request timeout to at least 60 seconds.
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
Please help me write a script in my preferred programming language to call this API and handle the response.python
# Tip: For Mainland China, replace https://api.justoneapi.com with http://47.117.133.51:30015
import requests
url = "https://api.justoneapi.com/api/xiaohongshu/search-user/v2?token=YOUR_API_KEY&keyword=VALUE"
response = requests.get(url)
print(response.json())js
// Tip: For Mainland China, replace https://api.justoneapi.com with http://47.117.133.51:30015
const response = await fetch("https://api.justoneapi.com/api/xiaohongshu/search-user/v2?token=YOUR_API_KEY&keyword=VALUE", {
method: "GET"
});
const data = await response.json();
console.log(data);java
// Tip: For Mainland China, replace https://api.justoneapi.com with http://47.117.133.51:30015
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.justoneapi.com/api/xiaohongshu/search-user/v2?token=YOUR_API_KEY&keyword=VALUE"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}go
// Tip: For Mainland China, replace https://api.justoneapi.com with http://47.117.133.51:30015
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
client := &http.Client{}
url := "https://api.justoneapi.com/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()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}php
// Tip: For Mainland China, replace https://api.justoneapi.com with http://47.117.133.51:30015
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.justoneapi.com/api/xiaohongshu/search-user/v2?token=YOUR_API_KEY&keyword=VALUE");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$response = curl_exec($ch);
curl_close($ch);
echo $response;Responses
json
{
"code": 0,
"data": {
"users": [
{
"name": "Amir Ali",
"red_official_verify_type": 0,
"self": false,
"reason": "",
"id": "68b016570000000018028e20",
"image": "https://sns-avatar-qc.xhscdn.com/avatar/645b7efe1fc3de4c930effac.jpg?imageView2/2/w/360/format/webp",
"followed": false,
"red_id": "26814156493",
"show_red_official_verify_icon": false,
"red_official_verified": false,
"link": "xhsdiscover://1/user/user.68b016570000000018028e20",
"sub_title": "",
"desc": "小红书号:26814156493"
},
{
"sub_title": "",
"desc": "小红书号:18654598764",
"image": "https://sns-avatar-qc.xhscdn.com/avatar/645b7f83b46568f580649586.jpg?imageView2/2/w/360/format/webp",
"followed": false,
"red_official_verified": false,
"show_red_official_verify_icon": false,
"self": false,
"link": "xhsdiscover://1/user/user.694e2e980000000037032b89",
"reason": "",
"id": "694e2e980000000037032b89",
"name": "AMIR Ali",
"red_id": "18654598764",
"red_official_verify_type": 0
},
{
"id": "689f145b00000000190221a3",
"image": "https://sns-avatar-qc.xhscdn.com/avatar/645b7ecfb46568f58064957a.jpg?imageView2/2/w/360/format/webp",
"followed": false,
"red_official_verified": false,
"reason": "",
"sub_title": "",
"name": "Amir Ali",
"desc": "小红书号:18996540717",
"red_id": "18996540717",
"red_official_verify_type": 0,
"show_red_official_verify_icon": false,
"self": false,
"link": "xhsdiscover://1/user/user.689f145b00000000190221a3"
},
{
"reason": "",
"name": "Amir Ali",
"image": "https://sns-avatar-qc.xhscdn.com/avatar/645b7f8f2a34639eb26eb1cd.jpg?imageView2/2/w/360/format/webp",
"red_id": "26265359318",
"show_red_official_verify_icon": false,
"link": "xhsdiscover://1/user/user.66b416c1000000001d03221e",
"sub_title": "",
"id": "66b416c1000000001d03221e",
"desc": "小红书号:26265359318",
"followed": false,
"red_official_verify_type": 0,
"red_official_verified": false,
"self": false
},
{
"red_id": "5402725779",
"red_official_verify_type": 0,
"show_red_official_verify_icon": false,
"link": "xhsdiscover://1/user/user.63711e98000000001f018c3f",
"desc": "小红书号:5402725779",
"image": "https://sns-avatar-qc.xhscdn.com/avatar/63711e98000000001f018c3f.jpg?imageView2/2/w/360/format/webp",
"followed": false,
"red_official_verified": false,
"self": false,
"sub_title": "",
"reason": "",
"id": "63711e98000000001f018c3f",
"name": "amir ali"
},
{
"id": "67ed5618000000000e01c058",
"name": "Amir Ali",
"desc": "小红书号:95318072831",
"image": "https://sns-avatar-qc.xhscdn.com/avatar/645b7e78731e07eb8ca3d81b.jpg?imageView2/2/w/360/format/webp",
"show_red_official_verify_icon": false,
"red_official_verified": false,
"sub_title": "",
"followed": false,
"red_id": "95318072831",
"red_official_verify_type": 0,
"self": false,
"link": "xhsdiscover://1/user/user.67ed5618000000000e01c058",
"reason": ""
},
{
"desc": "小红书号:4m1rr22",
"image": "https://sns-avatar-qc.xhscdn.com/avatar/645b7f6e338379fac1893093.jpg?imageView2/2/w/360/format/webp",
"followed": false,
"show_red_official_verify_icon": false,
"id": "6785afc4000000000803d019",
"name": "Amir Ali",
"red_official_verified": false,
"self": false,
"link": "xhsdiscover://1/user/user.6785afc4000000000803d019",
"sub_title": "",
"reason": "",
"red_id": "4m1rr22",
"red_official_verify_type": 0
},
{
"red_official_verify_type": 0,
"show_red_official_verify_icon": false,
"red_official_verified": false,
"id": "679096af000000000e012092",
"name": "Amir ali",
"desc": "小红书号:11512498587",
"image": "https://sns-avatar-qc.xhscdn.com/avatar/645b807d338379fac18930a8.jpg?imageView2/2/w/360/format/webp",
"followed": false,
"red_id": "11512498587",
"self": false,
"link": "xhsdiscover://1/user/user.679096af000000000e012092",
"sub_title": "",
"reason": ""
},
{
"name": "Amir Ali",
"red_id": "42934536844",
"red_official_verified": false,
"self": false,
"sub_title": "",
"id": "6792367f000000000e01fbf2",
"desc": "小红书号:42934536844",
"image": "https://sns-avatar-qc.xhscdn.com/avatar/645b7e371fc3de4c930eff9d.jpg?imageView2/2/w/360/format/webp",
"followed": false,
"red_official_verify_type": 0,
"show_red_official_verify_icon": false,
"link": "xhsdiscover://1/user/user.6792367f000000000e01fbf2",
"reason": ""
},
{
"name": "Amir Ali",
"image": "https://sns-avatar-qc.xhscdn.com/avatar/645b800677c97ef1a2abc7e0.jpg?imageView2/2/w/360/format/webp",
"red_id": "95028500559",
"self": false,
"sub_title": "",
"id": "6813ce61000000000e01f21d",
"followed": false,
"red_official_verify_type": 0,
"show_red_official_verify_icon": false,
"red_official_verified": false,
"link": "xhsdiscover://1/user/user.6813ce61000000000e01f21d",
"reason": "",
"desc": "小红书号:95028500559"
},
{
"red_official_verify_type": 0,
"red_official_verified": false,
"self": false,
"desc": "小红书号:95502854544",
"image": "https://sns-avatar-qc.xhscdn.com/avatar/645b6985573b2ad2b5243b1d.jpg?imageView2/2/w/360/format/webp",
"followed": false,
"show_red_official_verify_icon": false,
"link": "xhsdiscover://1/user/user.6880a4e5000000001d015614",
"sub_title": "",
"reason": "",
"id": "6880a4e5000000001d015614",
"name": "Amir Ali",
"red_id": "95502854544"
},
{
"name": "Amir Ali",
"followed": false,
"show_red_official_verify_icon": false,
"self": false,
"link": "xhsdiscover://1/user/user.6792aafe000000000e01e93f",
"reason": "",
"sub_title": "",
"id": "6792aafe000000000e01e93f",
"desc": "小红书号:42934052090",
"image": "https://sns-avatar-qc.xhscdn.com/avatar/645b6abf2e368555521befcc.jpg?imageView2/2/w/360/format/webp",
"red_id": "42934052090",
"red_official_verify_type": 0,
"red_official_verified": false
},
{
"id": "67a4ba43000000000e013232",
"name": "Amir Ali",
"desc": "小红书号:11595138576",
"red_id": "11595138576",
"self": false,
"sub_title": "",
"reason": "",
"image": "https://sns-avatar-qc.xhscdn.com/avatar/645b7f83b46568f580649586.jpg?imageView2/2/w/360/format/webp",
"followed": false,
"red_official_verify_type": 0,
"show_red_official_verify_icon": false,
"red_official_verified": false,
"link": "xhsdiscover://1/user/user.67a4ba43000000000e013232"
},
{
"id": "6843f5a2000000001b020f2f",
"name": "Amir Ali",
"desc": "小红书号:27491033698",
"image": "https://sns-avatar-qc.xhscdn.com/avatar/645b7f257b3e7e60e53504de.jpg?imageView2/2/w/360/format/webp",
"show_red_official_verify_icon": false,
"link": "xhsdiscover://1/user/user.6843f5a2000000001b020f2f",
"sub_title": "",
"followed": false,
"red_id": "27491033698",
"red_official_verify_type": 0,
"red_official_verified": false,
"self": false,
"reason": ""
},
{
"id": "679fce83000000000d00a9b9",
"name": "Amir Ali",
"desc": "小红书号:63842909993",
"image": "https://sns-avatar-qc.xhscdn.com/avatar/645b807d338379fac18930a8.jpg?imageView2/2/w/360/format/webp",
"followed": false,
"red_official_verify_type": 0,
"self": false,
"sub_title": "",
"reason": "",
"red_id": "63842909993",
"show_red_official_verify_icon": false,
"red_official_verified": false,
"link": "xhsdiscover://1/user/user.679fce83000000000d00a9b9"
},
{
"red_official_verify_type": 0,
"self": false,
"sub_title": "",
"id": "682c8272000000001703e6d8",
"desc": "小红书号:26105636530",
"image": "https://sns-avatar-qc.xhscdn.com/avatar/645b7f8f2a34639eb26eb1cd.jpg?imageView2/2/w/360/format/webp",
"followed": false,
"red_id": "26105636530",
"name": "Amir Ali",
"show_red_official_verify_icon": false,
"red_official_verified": false,
"link": "xhsdiscover://1/user/user.682c8272000000001703e6d8",
"reason": ""
},
{
"image": "https://sns-avatar-qc.xhscdn.com/avatar/645b7eecf82b98b5c9349913.jpg?imageView2/2/w/360/format/webp",
"red_id": "95588314694",
"show_red_official_verify_icon": false,
"red_official_verified": false,
"self": false,
"link": "xhsdiscover://1/user/user.68a9f16800000000190184cc",
"id": "68a9f16800000000190184cc",
"desc": "小红书号:95588314694",
"sub_title": "",
"red_official_verify_type": 0,
"reason": "",
"name": "Amir Ali",
"followed": false
},
{
"id": "686a1680000000001e001e4e",
"red_official_verified": false,
"sub_title": "",
"reason": "",
"self": false,
"name": "Amir Ali",
"desc": "小红书号:42297699740",
"image": "https://sns-avatar-qc.xhscdn.com/avatar/645b7ecfb46568f58064957a.jpg?imageView2/2/w/360/format/webp",
"followed": false,
"red_id": "42297699740",
"red_official_verify_type": 0,
"show_red_official_verify_icon": false,
"link": "xhsdiscover://1/user/user.686a1680000000001e001e4e"
},
{
"name": "Amir Ali",
"red_id": "11588655182",
"red_official_verify_type": 0,
"self": false,
"link": "xhsdiscover://1/user/user.679648ab000000000e01ca48",
"id": "679648ab000000000e01ca48",
"desc": "小红书号:11588655182",
"image": "https://sns-avatar-qc.xhscdn.com/avatar/645b6985573b2ad2b5243b1d.jpg?imageView2/2/w/360/format/webp",
"followed": false,
"show_red_official_verify_icon": false,
"red_official_verified": false,
"sub_title": "",
"reason": ""
},
{
"name": "Amir Ali",
"followed": false,
"red_id": "95355142911",
"red_official_verify_type": 0,
"red_official_verified": false,
"self": false,
"link": "xhsdiscover://1/user/user.678b1e17000000000d0084f2",
"sub_title": "",
"id": "678b1e17000000000d0084f2",
"desc": "小红书号:95355142911",
"image": "https://sns-avatar-qc.xhscdn.com/avatar/645b7f3c86578b8c6ab3b068.jpg?imageView2/2/w/360/format/webp",
"show_red_official_verify_icon": false,
"reason": ""
}
],
"filters": [
{
"type": "single",
"name": "粉丝数量",
"id": "fans_count",
"group_show_type": 0,
"filter_tags": [
{
"need_location_info": false,
"sub_filters_select_type": "",
"sub_filters": null,
"origin_text": "",
"icon_tail_url": "",
"icon_tail_url_night": "",
"icon_url_night": "",
"id": "all",
"name": "不限",
"icon_url": ""
},
{
"icon_tail_url_night": "",
"need_location_info": false,
"sub_filters": null,
"origin_text": "",
"icon_url_night": "",
"icon_url": "",
"icon_tail_url": "",
"sub_filters_select_type": "",
"id": "0-100",
"name": "0-100"
},
{
"icon_tail_url_night": "",
"need_location_info": false,
"sub_filters": null,
"name": "100-1000",
"origin_text": "",
"icon_url": "",
"icon_url_night": "",
"icon_tail_url": "",
"id": "100-1000",
"sub_filters_select_type": ""
},
{
"origin_text": "",
"icon_url_night": "",
"need_location_info": false,
"sub_filters": null,
"id": "1000-10000",
"name": "1000-1万",
"icon_tail_url_night": "",
"sub_filters_select_type": "",
"icon_url": "",
"icon_tail_url": ""
},
{
"id": "10000-100000",
"name": "1万-10万",
"icon_url": "",
"icon_tail_url": "",
"need_location_info": false,
"sub_filters_select_type": "",
"origin_text": "",
"icon_url_night": "",
"icon_tail_url_night": "",
"sub_filters": null
},
{
"name": "10万以上",
"origin_text": "",
"icon_url": "",
"need_location_info": false,
"id": "100000",
"icon_url_night": "",
"icon_tail_url": "",
"icon_tail_url_night": "",
"sub_filters_select_type": "",
"sub_filters": null
}
],
"word_request_id": "61eed1ba52c1751c5ebe1bd3cdae45a6",
"invisible": true
},
{
"invisible": true,
"type": "single",
"name": "用户类型",
"id": "user_type",
"group_show_type": 0,
"filter_tags": [
{
"need_location_info": false,
"origin_text": "",
"icon_url": "",
"icon_url_night": "",
"icon_tail_url": "",
"icon_tail_url_night": "",
"sub_filters_select_type": "",
"sub_filters": null,
"id": "all",
"name": "不限"
},
{
"origin_text": "",
"icon_url": "",
"icon_tail_url_night": "",
"sub_filters_select_type": "",
"id": "regular_user",
"name": "普通用户",
"icon_url_night": "",
"icon_tail_url": "",
"need_location_info": false,
"sub_filters": null
},
{
"need_location_info": false,
"sub_filters_select_type": "",
"sub_filters": null,
"icon_url": "",
"name": "个人认证",
"origin_text": "",
"icon_url_night": "",
"icon_tail_url": "",
"icon_tail_url_night": "",
"id": "personal_verification"
},
{
"icon_url_night": "",
"need_location_info": false,
"sub_filters_select_type": "",
"sub_filters": null,
"icon_tail_url_night": "",
"id": "business_verification",
"name": "企业认证",
"origin_text": "",
"icon_url": "",
"icon_tail_url": ""
}
],
"word_request_id": "0a1ae450a1c8b13052708c04487576ea"
}
]
}
}💡 Note: For list data, the example shows only 1-2 items for simplicity. The actual count depends on the API response.
