Xiaohongshu APIxiaohongshu.com ↗
Access Xiaohongshu note content and user profiles via API. Returns post text, images, video, tags, engagement stats, follower counts, and bios.
What is the Xiaohongshu API?
The Xiaohongshu API provides two endpoints for retrieving public content from China's Little Red Book platform: get_note_detail and get_user_profile. A single note detail response surfaces 11 fields including title, description, images, video metadata, interaction stats (likes, collects, comments, shares), tags, and the author's location. The user profile endpoint returns follower and following counts, bio, avatar, gender, and profile tags.
curl -X GET 'https://api.parse.bot/scraper/112e2db4-437f-4511-96f5-f0f62d23a010/get_note_detail?note_id=641ae75d0000000013031c27&xsec_token=ABT8T8RWGBbr54coTFB8akFqALRtAqAmE1k1Z3_GvW86s%3D' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace xiaohongshu-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Xiaohongshu (小红书) SDK — fetch notes and user profiles."""
from parse_apis.xiaohongshu____api import Xiaohongshu, NoteNotFound
client = Xiaohongshu()
# Fetch a note by ID (requires its per-note xsec_token from feed/share links)
note = client.notes.get(
note_id="641ae75d0000000013031c27",
xsec_token="ABT8T8RWGBbr54coTFB8akFqALRtAqAmE1k1Z3_GvW86s=",
)
print(note.title, note.type, note.interact_info.liked_count)
# Access nested resources: author info and images
print(note.user.nickname, note.user.avatar)
for img in note.images[:2]:
print(img.url, img.width, img.height)
# Fetch the note author's full profile
profile = client.userprofiles.get(user_id=note.user.user_id)
print(profile.nickname, profile.fans, profile.ip_location)
for tag in profile.tags:
print(tag.type, tag.name)
# Handle a note that doesn't exist or has an expired token
try:
client.notes.get(note_id="000000000000000000000000", xsec_token="invalid")
except NoteNotFound as exc:
print(f"Note not found: {exc.note_id}")
print("exercised: notes.get / userprofiles.get / NoteNotFound error handling")Fetches a single note full content by its ID. Returns title, description, images, video (when present), tags, author info, and interaction stats. Requires both note_id and xsec_token. The token is per-note and cannot be reused across different notes. Video notes include stream URL, duration, and resolution; image notes include an ordered image list with dimensions.
| Param | Type | Description |
|---|---|---|
| note_idrequired | string | The note/post ID, a 24-character hex string. |
| xsec_tokenrequired | string | Per-note security token unique to each note. Cannot be reused across different notes. Obtained from feed data or share links for the specific note. |
{
"type": "object",
"fields": {
"tags": "array of objects with id, name, type",
"time": "integer (creation timestamp in milliseconds)",
"type": "string (normal or video)",
"user": "object with user_id, nickname, avatar",
"title": "string",
"video": "object with duration, url, format, width, height (present only for video notes)",
"images": "array of objects with url, width, height, file_id",
"note_id": "string",
"description": "string (post body text)",
"ip_location": "string (author location at time of posting)",
"interact_info": "object with liked_count, collected_count, comment_count, share_count (all strings, may use Chinese units)",
"last_update_time": "integer (last update timestamp in milliseconds)"
}
}About the Xiaohongshu API
Note Detail
The get_note_detail endpoint accepts two required parameters: note_id and xsec_token. The xsec_token is a per-note security token tied specifically to the note being requested — it is not reusable across different notes and must be obtained separately for each one. The response distinguishes between note types via the type field (normal or video). For video notes, a video object is included with duration, url, format, width, and height. Image notes return an images array of objects with url, width, height, and file_id. Both types include tags (each with id, name, and type), a time timestamp in milliseconds, and an ip_location string indicating the poster's reported region.
User Profile
The get_user_profile endpoint takes a user_id and returns a profile object containing nickname, description (bio), avatar URL, gender (0 for male, 1 for female), red_id (the platform's human-readable username), follows and fans counts as strings, ip_location, and a tags array of profile tags that may include type, name, and icon fields. Follower and following counts are returned as strings rather than integers, consistent with how the platform displays large numbers.
Coverage and Constraints
Both endpoints cover publicly accessible content. Search functionality and post creation are not available through this API. The xsec_token requirement for get_note_detail means callers must supply a valid token per note — tokens cannot be generated client-side or reused. Note IDs and their corresponding tokens are typically found in note URLs shared from the platform.
The Xiaohongshu API is a managed, monitored endpoint for xiaohongshu.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when xiaohongshu.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official xiaohongshu.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Tracking engagement metrics (likes, collects, comments) on specific Xiaohongshu notes over time
- Extracting product-related tags and descriptions from Little Red Book posts for market research
- Building creator profiles by combining follower counts, bio text, and avatar from get_user_profile
- Aggregating image and video assets from notes by type for content analysis
- Monitoring ip_location fields to map regional content distribution across notes
- Enriching influencer databases with Xiaohongshu fan counts, follows, and profile tags
- Identifying trending topic tags on notes by collecting the tags array across multiple note IDs
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does Xiaohongshu have an official developer API?+
What does get_note_detail return for video posts versus image posts?+
video object with duration, url, format, width, and height. For standard image notes (type: 'normal'), that object is absent and the images array contains one or more objects with url, width, height, and file_id. Both types return the same core fields: title, description, tags, time, user, ip_location, and interaction stats.Why does get_note_detail require an xsec_token in addition to the note_id?+
xsec_token paired with each note_id; a mismatched or reused token will not return data.Does the API return comment content or a list of commenters on a note?+
get_note_detail endpoint returns a comment count as part of the interaction stats, but individual comment text and commenter details are not included in the response. The API covers note-level content and aggregate counts. You can fork it on Parse and revise to add a comment-listing endpoint if that data is needed.Is search — finding notes by keyword or hashtag — available through this API?+
get_note_detail and profile lookup by ID via get_user_profile. You can fork it on Parse and revise to add a search endpoint that accepts keyword or tag inputs.