Xiaohongshu APIs - User Profile (V4)
DEPRECATED
This endpoint is deprecated and may be removed in future versions.
prod-global
GET
/api/xiaohongshu/get-user/v4
Retrieves Xiaohongshu user profile data, including user identifiers and profile metadata (e.g., nickname, avatar, bio), as well as public counters such as follower count and like count (when available).
Typical use cases:
- Identifying creators/KOLs and building creator lists
- Enriching user records for analytics and reporting
- Creator monitoring (profile and counter changes over time)
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
token | query | string | Yes | Access token for this API service. |
userId | query | string | Yes | Unique user identifier on Xiaohongshu. |
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/get-user/v4?token=YOUR_API_KEY&userId=VALUE"text
I want to use the "User Profile (V4)" API from Just One API.
API Endpoint: https://api.justoneapi.com/api/xiaohongshu/get-user/v4
HTTP Method: GET
Authentication: Append "?token=YOUR_API_KEY" to the URL.
OpenAPI Definition: https://docs.justoneapi.com/openapi/xiaohongshu-apis/user-profile-v4-en.json
Parameters:
- token (query): Access token for this API service. (Required)
- userId (query): Unique user identifier on Xiaohongshu. (Required)
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/get-user/v4?token=YOUR_API_KEY&userId=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/get-user/v4?token=YOUR_API_KEY&userId=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/get-user/v4?token=YOUR_API_KEY&userId=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/get-user/v4?token=YOUR_API_KEY&userId=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/get-user/v4?token=YOUR_API_KEY&userId=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": {
"red_official_verified": false,
"tags": [
{
"icon": "http://ci.xiaohongshu.com/icons/user/gender-female-v1.png",
"tag_type": "info"
},
{
"name": "广东东莞",
"tag_type": "location"
},
{
"name": "家居博主",
"tag_type": "profession"
},
{
"name": "母婴博主",
"tag_type": "profession"
}
],
"banner_info": {
"image": "http://sns-avatar-qc.rednotecdn.com/user_banner/1040g2k031t8993lslm1g4a1nb69m5jhjfqpbd5g?imageView2/2/w/540/format/jpg&ap=28&sc=USR_BG&src=A",
"bg_color": "927d69",
"like_status": false
},
"follows": 265,
"fstatus": "none",
"collected_brand_num": 0,
"default_collection_tab": "note",
"collected_product_num": 0,
"red_official_verify_type": 0,
"interactions": [
{
"type": "follows",
"name": "关注",
"count": 265,
"is_private": false,
"toast": ""
},
{
"type": "fans",
"name": "粉丝",
"count": 8456,
"is_private": false,
"toast": ""
},
{
"type": "interaction",
"name": "获赞与收藏",
"count": 75707,
"is_private": false,
"toast": ""
}
],
"blocking": false,
"collected": 26386,
"share_link": "https://www.xiaohongshu.com/user/profile/5a901362e8ac2b36c99bce33?xsec_token=YB9xJDlvo14NLtpZy7E8xH3MtMC3QTjxPTP8Kz3t-EYBY=&xsec_source=app_share",
"desc_at_users": [],
"share_info_v2": {
"title": "@小顾小小家的个人主页",
"content": "粉丝: 8456\n获赞与收藏: 7.6万",
"ecom_title": "小顾小小家的橱窗",
"ecom_content": "小顾小小家为你推荐了44件宝藏好物!已有78人买过了!",
"ecom_share_link": "https://www.xiaohongshu.com/user/profile/5a901362e8ac2b36c99bce33?tab=buyer&channelType=share_outside"
},
"user_widget_switch": false,
"real_name_info": "",
"is_recommend_level_illegal": false,
"hula_tabs": {
"all_show_tab_config": [
{
"tab_id": "note",
"tab_name": "笔记",
"tab_index_weight": 0
},
{
"tab_id": "buyer",
"tab_name": "选品",
"tab_index_weight": 1
}
],
"tab_id_selected": "note"
},
"user_desc_info": {
"desc": "🧡一个117平横厅🏠\n🐰一个2岁的儿子米兜兜\n🌈一位美术老师的有趣生活\n🌻guting1008_",
"desc_at_users": [],
"desc_with_placeholder": "🧡一个117平横厅🏠\n🐰一个2岁的儿子米兜兜\n🌈一位美术老师的有趣生活\n🌻guting1008_",
"desc_keywords_switch": true
},
"real_name_deep_target": 1,
"is_login_user_pro_account": false,
"ndiscovery": 276,
"tab_visible": {
"collect": false,
"like": false,
"seed": true,
"buyer": true,
"note": true
},
"blocked": false,
"sec_account_deeplink": "xhsdiscover://rn/accounts/account-detail?targetId=5a901362e8ac2b36c99bce33&new_page_exp=1",
"nboards": 0,
"collected_poi_num": 0,
"nickname": "小顾小小家",
"share_info": {
"title": "小顾小小家",
"content": "🧡一个117平横厅🏠\n🐰一个2岁的儿子米兜兜\n🌈一位美术老师的有趣生活\n🌻guting1008_"
},
"red_official_verify_base_info": "",
"identity_label_migrated": false,
"gender": 1,
"level": {
"image_link": "",
"number": 0
},
"location": "中国 广东 东莞",
"recommend_info": "",
"recommend_info_icon": "",
"brand_account_info": {
"conversions": [
{
"id": "11",
"name": "群聊",
"icon": "https://picasso-static.xiaohongshu.com/fe-platform/c17fa18d287ca13418e1a6ae86270895a10c9d78.png",
"link": "xhsdiscover://message/userPublicGroupList?user_id=5a901362e8ac2b36c99bce33&username=TA",
"is_shop": false,
"is_red_shop": false,
"sub_title": "查看详情"
}
]
},
"avatar_pendant": {
"current_user_pendant": false,
"current_user_pet": false
},
"collected_movie_num": 0,
"userid": "5a901362e8ac2b36c99bce33",
"note_num_stat": {
"posted": 276,
"liked": 49321,
"collected": 26386
},
"zhong_tong_bar_info": {
"conversions": [
{
"icon": "https://picasso-static.xiaohongshu.com/fe-platform/c17fa18d287ca13418e1a6ae86270895a10c9d78.png",
"link": "xhsdiscover://message/userPublicGroupList?user_id=5a901362e8ac2b36c99bce33&username=TA",
"sub_title": "查看详情",
"id": "11",
"name": "群聊"
},
{
"sub_title": "1个评价",
"id": "34",
"name": "评价",
"icon": "https://fe-video-qc.xhscdn.com/fe-platform/5d104f03c28936f28480c1225414c979ce9e96d1.png",
"link": "xhsdiscover://rn/declare/my-evaluation?userid=5a901362e8ac2b36c99bce33&activeTabName=poi&activeTabId=0"
}
]
},
"avatar_like_status": false,
"buyer_info": {
"tab_name": "选品",
"choice_id": "137155093883637391",
"extra_map": {
"curationGoodsSearch": "true"
}
},
"images": "https://sns-avatar-qc.xhscdn.com/avatar/1040g2jo31gjkvenfjs004a1nb69m5jhjrrsug08?imageView2/2/w/360/format/webp",
"collected_book_num": 0,
"red_id": "guting1008",
"red_club_info": {
"red_club": false,
"red_club_level": 0,
"red_club_url": "https://www.xiaohongshu.com/store/mc/landing",
"redclubscore": 0
},
"show_extra_info_button": false,
"tab_public": {
"collection": false,
"collection_note": true,
"collection_board": true,
"seed": true
},
"red_official_verify_content": "",
"liked": 49321,
"collected_notes_num": 0,
"desc": "🧡一个117平横厅🏠\n🐰一个2岁的儿子米兜兜\n🌈一位美术老师的有趣生活\n🌻guting1008_",
"ip_location": "广东",
"result": {
"success": true,
"code": 0,
"message": "success"
},
"imageb": "https://sns-avatar-qc.xhscdn.com/avatar/1040g2jo31gjkvenfjs004a1nb69m5jhjrrsug08?imageView2/2/w/540/format/webp",
"fans": 8456,
"identity_deeplink": "xhsdiscover://rn/app-settings/official/certification/details?type=2&user_id=5a901362e8ac2b36c99bce33&is_mcn=false",
"remark_name": "",
"user_role_type": 6,
"location_jump": true,
"collected_tags_num": 0,
"community_rule_url": "https://www.xiaohongshu.com/user/community-rule"
}
}💡 Note: For list data, the example shows only 1-2 items for simplicity. The actual count depends on the API response.
