Answers
Xiaohongshu user ID vs 小红书号: which one does an API need?
Short answer
APIs want the user ID: the 24-character hexadecimal string in a profile link after /user/profile/, which never changes. The 小红书号 (Xiaohongshu number) shown on the profile is a handle and is not accepted as a lookup key. okdata's Xiaohongshu account profile takes the user ID or a profile or xhslink.com link for $0.02 and returns both, the 小红书号 in username.
A Xiaohongshu profile shows two identifiers, and only one of them works as a key. Under the name, the app prints 小红书号 followed by a number such as 95210384417, or by a custom handle if the owner set one. That is the account's public handle: people quote it to each other, and the owner can edit it. The user ID is different: 24 characters of digits and a to f, such as 5f2b7c1e0000000001006a3d, visible only in the web link xiaohongshu.com/user/profile/5f2b7c1e0000000001006a3d. It is assigned when the account is created and does not change, which is why Xiaohongshu's own web API, scrapers and data tools all ask for it. A media plan full of 小红书号 has to be turned into user IDs before you can pull anything.
Side by side
| User ID | 小红书号 | |
|---|---|---|
| Looks like | 5f2b7c1e0000000001006a3d (24 hex characters) |
95210384417 or a custom handle |
| Where you see it | Profile web link after /user/profile/ |
On the profile under the name |
| Can it change | No | Yes, the owner can edit it |
| In okdata data | id on an account, author.id on a note |
username on an account |
| Accepted as a lookup key | Yes | No |
A nickname (昵称) is a third thing: free text, not unique, and also editable. Never key a sheet on it.
Getting the user ID
- From a profile link or share link. Call Xiaohongshu account profile with
url=set to the profile web link or the xhslink.com link from the app's share button.idin the answer is the user ID;usernameis the 小红书号. - From one of their notes. Note detail returns
author.id, the author's user ID. - From only a 小红书号. There is no lookup by 小红书号 in this catalog. Search it in the app, open the profile, tap share and copy the link, then use step 1.
With the user ID, account notes lists everything the account has posted, newest first. On PGY, Xiaohongshu's creator marketplace, the creator ID is the same 24-character user ID.
| Step | Calls | Cost |
|---|---|---|
| Share link to user ID, 小红书号 and counts | 1 | $0.02 |
| Then the latest 20 notes | 1 | $0.02 |
| 40 creators from a media plan, both steps | 80 | $1.60 |
Example
curl -G "https://api.okdata.online/v1/xiaohongshu/users/get" \
-H "Authorization: Bearer $OKDATA_API_KEY" \
--data-urlencode 'url=https://xhslink.com/m/8Tq2LwRk5Zp' \
--data-urlencode 'fields=id,username,name,followers,posts'
Store id. Keep username next to it for people to read, and refresh it now and then, since it can change.
Limits
- The account-notes list returns the notes but leaves the author's name and handle out; take them from the profile call.
- Banned or deleted accounts return
not_found, which is still charged as one call. - What the profile's 获赞与收藏 figure counts is explained in Xiaohongshu likes and collects; followers and note counts for a list of creators in creator profile followers.
Sources
Where people asked this (read 2026-11-17)
Updated