XHS (Xiaohongshu) Usage Guide (App V2 Version)
Xiaohongshu API documentation organized based on TikHub OpenAPI (
https://api.tikhub.io).
This document only includes App V2 series endpoints.
⚠️ Important Notice · Series Migration Announcement (Effective 2026-06-17)
- The App series (App V1) and Web series (Web V2 / Web V3) have been permanently taken offline since 2026-06-17. Please do not call them anymore. Please migrate all endpoints uniformly to App V2. App V2 is very stable and is currently the only recommended and supported series; there is no need to configure any backup / fallback endpoints.
- Background for series deprecation: Web V3 has long-term poor stability, and Web V2 has entered the deprecation process, so the Web series is no longer retained; App V1 maintenance has also been stopped. If your previous code is still calling these series, please replace them as soon as possible with the corresponding App V2 endpoints below.
Table of Contents
General Notes
- Base URL:
https://api.tikhub.io - Authentication:Include
Authorization: Bearer YOUR_API_KEYin the request header. - Series Notes:The App series (App V1) and Web series (Web V2 / Web V3) were permanently taken offline on 2026-06-17; App V2 is currently the only recommended and supported series, the most stable and with the most complete data, and there is no need to configure any backup / fallback endpoints.
- Either ID or share link:Most endpoints support either an object ID (
note_id/user_id/page_id) or a share link (share_text, supports APP / Web long and short links). If both are provided, ID takes precedence; if you only have a share link, passshare_textdirectly without first resolving the ID. - Note types:Image notes and video notes use separate App V2 endpoints; see Section 1 for details.
1. Single Note
Xiaohongshu notes are divided into two types: image notes (text-image notes) and video notes. App V2 provides separate endpoints for both types, with the most complete data.
1.1 Image Note (Text-Image Note)
Get the full detail data for a text-image note (image URLs, title, body, tags, engagement data, etc.).
- Method:GET
- Path:
/api/v1/xiaohongshu/app_v2/get_image_note_detail - Official Docs:docs.tikhub.io/420136391e0
- Parameters:
note_id(string, optional):Note ID, e.g."697c0eee000000000a03c308"share_text(string, optional):Xiaohongshu share link (supports APP / Web)- Either one; prefer
note_id; if both are provided,note_idprevails
1import requests
2
3BASE_URL = "https://api.tikhub.io"
4HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}
5
6url = f"{BASE_URL}/api/v1/xiaohongshu/app_v2/get_image_note_detail"
7params = {
8 "note_id": "697c0eee000000000a03c308",
9 # "share_text": "https://www.xiaohongshu.com/discovery/item/...",
10}
11r = requests.get(url, headers=HEADERS, params=params)
12print(r.json())1.2 Video Note
Get the full detail data for a video note (video URL, cover, duration, title, body, engagement data, etc.).
- Method:GET
- Path:
/api/v1/xiaohongshu/app_v2/get_video_note_detail - Official Docs:docs.tikhub.io/420136392e0
- Parameters:
note_id(string, optional):e.g."697c0eee000000000a03c308"share_text(string, optional)- Either one; prefer
note_id
1url = f"{BASE_URL}/api/v1/xiaohongshu/app_v2/get_video_note_detail"
2params = {
3 "note_id": "697c0eee000000000a03c308",
4 # "share_text": "https://www.xiaohongshu.com/discovery/item/...",
5}
6r = requests.get(url, headers=HEADERS, params=params)
7print(r.json())2. User Information
Use user_id to get a Xiaohongshu user's public profile data (nickname, avatar, bio, follower count, following count, note count, etc.).
💡 Only have a share link? The App V2 endpoint supports either
user_id/share_text; just pass the user profile share link directly toshare_textwithout first resolvinguser_id.
Get detailed information for a specified user, including nickname, avatar, bio, follower count, following count, note count, etc.
- Method:GET
- Path:
/api/v1/xiaohongshu/app_v2/get_user_info - Official Docs:docs.tikhub.io/420136395e0
- Parameters:
user_id(string, optional):User ID, e.g."61b46d790000000010008153"share_text(string, optional):Xiaohongshu user share link (supports APP / Web)- Either one; prefer
user_id; if both are provided,user_idprevails
1import requests
2
3BASE_URL = "https://api.tikhub.io"
4HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}
5
6url = f"{BASE_URL}/api/v1/xiaohongshu/app_v2/get_user_info"
7params = {
8 "user_id": "61b46d790000000010008153",
9 # "share_text": "https://www.xiaohongshu.com/user/profile/...",
10}
11r = requests.get(url, headers=HEADERS, params=params)
12print(r.json())3. User Works
Pull the user's note list by user_id; all endpoints use cursor pagination. App V2 provides two endpoints: the user's published note list and the user's publicly collected note list.
💡 Only have a share link? The endpoint supports either
user_id/share_text; just pass the share link directly toshare_text.
3.1 Get User's Published Note List
Get the list of notes published by the specified user, using cursor pagination.
- Method:GET
- Path:
/api/v1/xiaohongshu/app_v2/get_user_posted_notes - Official Docs:docs.tikhub.io/420136396e0
- Parameters:
user_id(string, optional):User ID, e.g."61b46d790000000010008153"share_text(string, optional):Xiaohongshu user share link (supports APP / Web)- Either one; prefer
user_id; if both are provided,user_idprevails cursor(string, optional):Pagination cursor, leave blank on the first request; when paging, take thecursorof the last note in thenoteslist from the previous response (path example:$.data.data.notes[-1].cursor)
1import requests
2
3BASE_URL = "https://api.tikhub.io"
4HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}
5
6url = f"{BASE_URL}/api/v1/xiaohongshu/app_v2/get_user_posted_notes"
7params = {
8 "user_id": "61b46d790000000010008153",
9 "cursor": "", # Empty for first request / 首次留空
10}
11r = requests.get(url, headers=HEADERS, params=params)
12print(r.json())3.2 Get User's Publicly Collected Note List
Get the list of notes publicly collected by the specified user (not notes they published themselves, but content they collected), using cursor pagination.
- Method:GET
- Path:
/api/v1/xiaohongshu/app_v2/get_user_faved_notes - Official Docs:docs.tikhub.io/420136397e0
- Parameters:
user_id(string, optional):e.g."5a8cf39111be10466d285d6b"share_text(string, optional)- Either one; prefer
user_id cursor(string, optional):Pagination cursor, leave blank on the first request; when paging, pass thenote_idof the last note on the previous page
1url = f"{BASE_URL}/api/v1/xiaohongshu/app_v2/get_user_faved_notes"
2params = {
3 "user_id": "5a8cf39111be10466d285d6b",
4 "cursor": "",
5}
6r = requests.get(url, headers=HEADERS, params=params)
7print(r.json())4. Comments
Xiaohongshu comments are divided into two levels: first-level comments (the comment list under a note) and second-level comments (replies/sub-comment list under a specific comment).
4.1 First-Level Comments (Comment List Under a Note)
- Method:GET
- Path:
/api/v1/xiaohongshu/app_v2/get_note_comments - Official Docs:docs.tikhub.io/420136394e0
- Parameters:
note_id(string, optional):Note IDshare_text(string, optional):Share link (either one withnote_id, prefernote_id)cursor(string, optional):Pagination cursor, leave blank on the first requestindex(integer, optional):Comment index, pass0on the first requestpageArea(string, optional):Collapse state,UNFOLDED(default) /FOLDEDsort_strategy(string, optional):Sort order,default/latest_v2(default) /like_count
1import requests
2
3BASE_URL = "https://api.tikhub.io"
4HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}
5
6url = f"{BASE_URL}/api/v1/xiaohongshu/app_v2/get_note_comments"
7params = {
8 "note_id": "697c0eee000000000a03c308",
9 "cursor": "",
10 "index": 0,
11 "pageArea": "UNFOLDED",
12 "sort_strategy": "latest_v2",
13}
14r = requests.get(url, headers=HEADERS, params=params)
15print(r.json())4.2 Second-Level Comments (Sub-Comments / Reply List)
Get all replies (sub-comments) under a specific first-level comment, using cursor pagination.
- Method:GET
- Path:
/api/v1/xiaohongshu/app_v2/get_note_sub_comments - Official Docs:docs.tikhub.io/420748830e0
- Parameters:
note_id(string, optional)share_text(string, optional) (either one withnote_id, prefernote_id)comment_id(string, required):Parent comment IDcursor(string, optional):Leave blank on the first request; take it from$.data.cursorwhen pagingindex(integer, optional):Pass1on the first request, take it from$.data.cursorwhen paging
1url = f"{BASE_URL}/api/v1/xiaohongshu/app_v2/get_note_sub_comments"
2params = {
3 "note_id": "699916e6000000001d0253da",
4 "comment_id": "PARENT_COMMENT_ID",
5 "cursor": "",
6 "index": 1,
7}
8r = requests.get(url, headers=HEADERS, params=params)
9print(r.json())5. Search
Xiaohongshu search is divided into two types: search notes and search users, both provided by App V2.
When paging, remember to carry the
search_id/search_session_idreturned by the initial search.
5.1 Search Notes
- Method:GET
- Path:
/api/v1/xiaohongshu/app_v2/search_notes - Official Docs:docs.tikhub.io/420136398e0
- Parameters:
keyword(string, required):Search keyword, e.g."美食推荐"page(integer, optional):Page number, starting from1sort_type(string, optional):Sort order,general(comprehensive, default) /time_descending(latest) /popularity_descending(most liked) /comment_descending(most commented) /collect_descending(most collected) /english_preferred(English first)note_type(string, optional):Note type,不限(default) /视频笔记/普通笔记/直播笔记time_filter(string, optional):Publish time,不限(default) /一天内/一周内/半年内search_id(string, optional):Pass the value from the initial response when pagingsearch_session_id(string, optional):Pass the value from the initial response when pagingsource(string, optional):Source, defaultexplore_feedai_mode(integer, optional):AI mode,0(off, default) /1(on)
1import requests
2
3BASE_URL = "https://api.tikhub.io"
4HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}
5
6url = f"{BASE_URL}/api/v1/xiaohongshu/app_v2/search_notes"
7params = {
8 "keyword": "美食推荐",
9 "page": 1,
10 "sort_type": "general",
11 "note_type": "不限",
12 "time_filter": "不限",
13 # Pass search_id and search_session_id from first response for pagination / 翻页时需要带上首次响应里的 search_id 和 search_session_id
14 # "search_id": "...",
15 # "search_session_id": "...",
16}
17r = requests.get(url, headers=HEADERS, params=params)
18print(r.json())5.2 Search Users
Returns 20 results per page by default, supports pagination.
- Method:GET
- Path:
/api/v1/xiaohongshu/app_v2/search_users - Official Docs:docs.tikhub.io/420136399e0
- Parameters:
keyword(string, required):Search keyword, e.g."美食博主"page(integer, optional):Page number, starting from1search_id(string, optional):Pass the value from the initial response when pagingsource(string, optional):Source, defaultexplore_feed
1url = f"{BASE_URL}/api/v1/xiaohongshu/app_v2/search_users"
2params = {
3 "keyword": "美食博主",
4 "page": 1,
5 # Pass search_id from first response for pagination / 翻页时带上首次响应里的 search_id
6 # "search_id": "...",
7}
8r = requests.get(url, headers=HEADERS, params=params)
9print(r.json())6. Topics
Xiaohongshu topic-related endpoints are divided into two parts: topic details and note list under a topic.
⚠️ All endpoints use
page_id(topic/topic tag ID) as the unique identifier.
6.1 Topic Details
Get topic details (topic name, views, discussion count, share info, etc.).
- Method:GET
- Path:
/api/v1/xiaohongshu/app_v2/get_topic_info - Official Docs:docs.tikhub.io/420136407e0
- Parameters:
page_id(string, required):Topic page ID, e.g."5c1cc866febed9000184b7c1"source(string, optional):Source, defaultnormalnote_id(string, optional):Source note ID, can be passed when jumping to a topic from a note
1import requests
2
3BASE_URL = "https://api.tikhub.io"
4HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}
5
6url = f"{BASE_URL}/api/v1/xiaohongshu/app_v2/get_topic_info"
7params = {
8 "page_id": "5c1cc866febed9000184b7c1",
9 "source": "normal",
10 # "note_id": "...", # Optional: pass when navigating from a note / 从笔记跳转过来时可带
11}
12r = requests.get(url, headers=HEADERS, params=params)
13print(r.json())
14# Response contains page_info (name/views/discussions), tabs, share_info, etc. / 返回包含 page_info(名称/浏览量/讨论数)、tabs、share_info 等6.2 Topic Note List (Notes Under a Topic)
Get the list of notes under a specific topic/topic tag, using cursor pagination.
- Method:GET
- Path:
/api/v1/xiaohongshu/app_v2/get_topic_feed - Official Docs:docs.tikhub.io/420136408e0
- Parameters:
page_id(string, **required__): Topic page IDsort(string, optional):trend(most popular, default) /time(latest)cursor_score(string, optional):Pagination cursor score, when paging pass thecursor_scoreof the last item on the previous pagelast_note_id(string, optional):When paging, pass the note ID of the last note on the previous page (items[-1].id)last_note_ct(string, optional):When paging, pass the creation time of the last note on the previous page (items[-1].create_time)session_id(string, optional):Session ID, keep consistent when pagingfirst_load_time(string, optional):Initial load timestamp, keep consistent when pagingsource(string, optional):Source, defaultnormal
1url = f"{BASE_URL}/api/v1/xiaohongshu/app_v2/get_topic_feed"
2
3# First request: pass only page_id and sort / 首次请求:只传 page_id 和 sort
4params = {
5 "page_id": "5c1cc866febed9000184b7c1",
6 "sort": "trend",
7}
8r = requests.get(url, headers=HEADERS, params=params)
9data = r.json()
10print(data)
11
12# Next page: pass through the following fields from the first response / 翻页请求:从首次响应中取下列字段透传
13# items = data["data"]["items"]
14# next_params = {
15# "page_id": "5c1cc866febed9000184b7c1",
16# "sort": "trend",
17# "cursor_score": items[-1]["cursor_score"],
18# "last_note_id": items[-1]["id"],
19# "last_note_ct": items[-1]["create_time"],
20# "session_id": data["data"]["session_id"],
21# "first_load_time": data["data"]["first_load_time"],
22# }