# Xiaohongshu user ID vs 小红书号: which one does an API need?

> The 小红书号 on a profile is a handle people can see and change; the user ID is a fixed 24-character hex string in the profile link. Which one APIs want, and how to get from one to the other.

Canonical page: https://okdata.online/answers/xiaohongshu-user-id-vs-red-id/

**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

1. **From a profile link or share link.** Call [Xiaohongshu account profile](/apis/xiaohongshu/users/get/) with `url=` set to the profile web link or the xhslink.com link from the app's share button. `id` in the answer is the user ID; `username` is the 小红书号.
2. **From one of their notes.** [Note detail](/apis/xiaohongshu/notes/get/) returns `author.id`, the author's user ID.
3. **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](/apis/xiaohongshu/users/notes/list/) 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

```bash
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](/answers/xiaohongshu-likes-and-collects/); followers and note counts for a list of creators in [creator profile followers](/answers/xiaohongshu-creator-profile-followers/).

## Endpoints used

- [Xiaohongshu account profile](https://okdata.online/apis/xiaohongshu/users/get/) `xiaohongshu.users.get`: $0.02 per call
- [Xiaohongshu account notes](https://okdata.online/apis/xiaohongshu/users/notes/list/) `xiaohongshu.users.notes.list`: $0.02 per call · about 20 notes per page
- [Xiaohongshu note detail](https://okdata.online/apis/xiaohongshu/notes/get/) `xiaohongshu.notes.get`: $0.02 per call

## More about Xiaohongshu (RedNote)

- [Xiaohongshu (RedNote) API](https://okdata.online/apis/xiaohongshu/)
- [Xiaohongshu API in Python: notes, profiles and comments (2026)](https://okdata.online/guides/xiaohongshu-api-python/)
- [How to export Xiaohongshu comments for a keyword](https://okdata.online/guides/xiaohongshu-note-comments/)
- [How to shortlist Xiaohongshu PGY creators by rate and reads](https://okdata.online/guides/xiaohongshu-pgy-creator-rates/)
- [How to search Xiaohongshu notes and export them to CSV](https://okdata.online/guides/xiaohongshu-search-export-notes/)
- [How do I export every note from a Xiaohongshu creator's profile?](https://okdata.online/answers/xiaohongshu-export-creator-notes/)
- [How do I turn a Xiaohongshu share link (xhslink.com) into note data?](https://okdata.online/answers/xiaohongshu-note-from-share-link/)
- [How do I get an AI daily report of what competitors posted on Xiaohongshu and Douyin?](https://okdata.online/answers/ai-competitor-daily-report/)
- [Xiaohongshu returns error 300011 (account abnormal). How do I keep collecting notes?](https://okdata.online/answers/xiaohongshu-300011-account-abnormal/)
- [How do I get a Xiaohongshu creator's follower count, likes and note count by API?](https://okdata.online/answers/xiaohongshu-creator-profile-followers/)
- [Scraping it yourself vs a per-call data API: cost, upkeep and risk](https://okdata.online/compare/scraping-vs-data-api/)
- [How to choose a social media data API (2026)](https://okdata.online/compare/social-media-data-apis/)
- [MCP servers for social media data: self-hosted vs hosted](https://okdata.online/compare/social-media-data-mcp-servers/)
- [Xiaohongshu data APIs: official, third-party or open-source (2026)](https://okdata.online/compare/xiaohongshu-data-apis/)

## Sources

- [XHS-Downloader README: profile and note link formats (/user/profile/作者ID/作品ID)](https://github.com/JoeanAmier/XHS-Downloader) (read 2026-11-12)

Where people asked this (read 2026-11-17): 

- https://github.com/xpzouying/xiaohongshu-mcp/pull/729

Updated 2026-11-12
