# Xiaohongshu Posts by user API (xiaohongshu.user_posts)

- Canonical page: https://everyinfra.com/en/xiaohongshu-api/user_posts
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "xiaohongshu", "action": "user_posts", "params": {...}}
- Price: $0.005556 per call ($5.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, one page of 20 per call (limit is ignored; pass the top-level next_page_token from the response as page_token for the next page)
- Pagination: pass next_page_token back as page_token for the next page, other params unchanged; one call per page, tokens last 24 hours
- Mode: sync; add "mode": "async" for slow tasks

Xiaohongshu Posts by user lists the notes one account has published, given its `user_id`: title, a body excerpt, cover image, like, save, comment and share counts, and the publish time, plus a playback link and length for video notes. Use it to see what a creator has been posting and which formats perform, when you shortlist creators, watch competitor accounts or check an account before a campaign.

`user_id` is the ID after /user/profile/ in the profile link; the full profile URL or an `author_id` from comment or search results also works, but a nickname does not. `text` here is an excerpt and `url` carries no access token, so call Note details with the note ID for the full body and a link that opens in a browser. `video_url` is signed and expires, so download what you need to keep.

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=xiaohongshu&action=user_posts

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| user_id | not declared | yes | not declared | Specifies the Xiaohongshu user ID (the identifier following /user/profile/ in the URL) or full profile URL for the profile and user_posts actions. The author_id returned by the comment actions also works. Used to fetch profile details or published notes; does not accept username display names. |
| page_token | not declared | no | not declared | Pagination cursor for the comments, sub_comments, search, user_posts, search_users and hashtag actions: pass back the next_page_token value from a row of the previous response to fetch the next page; omit it to start from the first page. Each page is one call, billed per request. |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | The record's unique ID on the platform. Unique only within one platform; IDs can repeat across platforms. |
| url | The record's link on Xiaohongshu. Links from search, note, profile and hashtag usually carry an access token, so they open in a signed-out browser (the token expires; call again for a fresh link). Note links from user_posts carry no token and need one to open in a browser: call note with the note ID to get a link that opens. Profile links from search_users carry no token either; call profile with the user_id for one that opens. Note links from pgy_content_square carry a token, except with `keyword`, where they carry none. |
| title | Title. null when the platform has no titles (for example text-only posts). |
| text | Note body or comment text. note and hashtag return the full body; search and user_posts may return a truncated excerpt (up to about 60 and 100 characters respectively). Call note with the note ID for the full text. |
| like_count | Like count. On note and comment results, the likes on that item; on profile, the total likes the account's notes have received. null means not public or not returned this time, not zero. |
| collect_count | Save count. On note results, how many times that note was saved; on profile, the total saves across the account's notes. null means not public or not returned this time, not zero. |
| comment_count | Comments. null means not disclosed, not 0. |
| share_count | Shares. null means not disclosed, not 0. |
| posted_at | Publish time in ISO 8601, UTC (for example 2026-08-07T12:34:56+00:00). Non-standard strings from the platform are passed through as is, so parse defensively. null means the platform does not disclose it. |
| image_url | Image link. Capabilities with several images may return an image_urls array. |
| author_name | Author's display name. |
| author_id | The author's user ID. Pass it to profile or user_posts. Note results carry the 24-character ID from profile URLs; comment results (comments, comments_batch, sub_comments) usually carry a different 29-character form. The two forms of one person do not match, so convert them with the user_id that profile returns before de-duplicating across batches. |
| avatar_url | Avatar image link. Some platforms return sized CDN links that can expire. |
| author_url | The author's profile link. It carries no access token, so a signed-out browser cannot open it; the url that profile returns for the author_id opens directly. |
| is_video | Whether the note is a video note. The play URL is NOT part of the note detail response (since 2026-10-14): call the separate video action with the same note URL to fetch it; each call is billed per call. |
| next_page_token | Page token (search, comments, sub_comments, user_posts, search_users, hashtag): pass it back unchanged as page_token, with the other parameters the same, to fetch the next page. |
| video_url | Video playback link (MP4), signed and expiring; download promptly if you need to keep it. null for image notes or when not returned. It appears on search/user_posts rows and in the separate video action; the note detail does not carry it (since 2026-10-14) — call the video action with the same note URL when you need the play link. |
| duration_sec | Video length in seconds. null for image notes or when it was not returned this time. |
| duration_seconds | Duration in seconds. null for content that is not video or audio. |
| platform | Source platform identifier, the same as platform in the request (for example xiaohongshu, tiktok). |
| images | Image links. On note, hashtag, search and user_posts, every image of the note in order. On comment results (comments, comments_batch, sub_comments), the images attached to the comment, stickers included; an empty array means none. null means this item was not returned this time. |
| is_goods_note | Whether the note is a shoppable note that carries product links (search, user_posts). |
| is_pinned | Whether the note is pinned to the top of the author's profile (user_posts). Pinned notes come first, so leave them out when you analyze by publish date. |
| ip_location | IP location (province or country) that Xiaohongshu displays; not entered by the user. Only some user_posts rows carry it. |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "xiaohongshu",
  "action": "user_posts",
  "params": {
    "user_id": "5bec178863f51f0001859bd9"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "xiaohongshu",
        "action": "user_posts",
        "params": {
            "user_id": "5bec178863f51f0001859bd9",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-10-24T18:28:34Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed; the list keeps the first 2 of 20. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "xiaohongshu",
  "action": "user_posts",
  "results": [
    {
      "id": "6ad2ee3d000000001500a406",
      "url": "https://www.xiaohongshu.com/explore/6ad2ee3d000000001500a406",
      "title": "西藏的后劲太大",
      "text": "从西藏回来后总觉得空落落的。\n晚上六点后看马路上行人少了不习惯，保障湖夜里聚着的人群没了，常去的网红S湾也冷冷清清，整个人就像在静静等着冬眠，日子过得格外无聊。\n之前在旅途里虽然身体累，但倒头就能睡，",
      "like_count": 4,
      "collect_count": 0,
      "comment_count": 2,
      "share_count": 0,
      "posted_at": "2026-10-17T03:40:45+00:00",
      "image_url": "https://sns-i27-ae.rednotecdn.com/1040g008326dlp9rr44004bqnt5boh6upnbbi730?imageView2/2/w/576/format/heif/q/58|imageMogr2/strip&redImage/frame/0&ap=12&sc=USR_PRV&sign=8a41040bd29d219271a31b35d28b1710&t=6add009f",
      "author_name": "•••",
      "author_id": "5bec178863f51f0001859bd9",
      "avatar_url": "https://sns-avatar-qc-ae.rednotecdn.com/•••",
      "author_url": "https://www.xiaohongshu.com/user/profile/5bec178863f51f0001859bd9",
      "is_video": true,
      "next_page_token": "n1.6a9801c2000000002902d3f5",
      "video_url": "https://sns-v28-ae.rednotecdn.com/stream/79/110/258/01ead2edf98cd6564f037001a147f2cfc3_258.mp4?sign=3488ebb9d403bf590a06aba3c94581b5&t=6ae19ddf",
      "duration_sec": 12,
      "platform": "xiaohongshu",
      "images": [
        "https://sns-i27-ae.rednotecdn.com/1040g008326dlp9rr44004bqnt5boh6upnbbi730?imageView2/2/w/576/format/heif/q/58|imageMogr2/strip&redImage/frame/0&ap=12&sc=USR_PRV&sign=8a41040bd29d219271a31b35d28b1710&t=6add009f"
      ],
      "is_goods_note": false,
      "is_pinned": false,
      "ip_location": "•••",
      "duration_seconds": 12
    },
    {
      "id": "6acc9f40000000001b02e074",
      "url": "https://www.xiaohongshu.com/explore/6acc9f40000000001b02e074",
      "title": "扬州人冬天都喜欢干啥？",
      "text": "很好奇扬州人的冬天白天都喜欢去哪里玩？晚上又喜欢干什么去哪里玩？#如果冬天有味道[话题]# #扬州人的冬天日常分享[话题]# #冬天的味道[话题]# #冬天的烦恼[话题]# #冬天的样子[话题]#",
      "like_count": 2,
      "collect_count": 0,
      "comment_count": 0,
      "share_count": 0,
      "posted_at": "2026-10-12T08:50:08+00:00",
      "image_url": "https://sns-i27-ae.rednotecdn.com/notes_pre_post/1040g3k83267gk1jm44704bqnt5boh6up9ulnts0?imageView2/2/w/576/format/heif/q/58|imageMogr2/strip&redImage/frame/0&ap=12&sc=USR_PRV&sign=c3cc24a4f64405fdd87eaa5922f49a0e&t=6add009f",
      "author_name": "•••",
      "author_id": "5bec178863f51f0001859bd9",
      "avatar_url": "https://sns-avatar-qc-ae.rednotecdn.com/•••",
      "author_url": "https://www.xiaohongshu.com/user/profile/5bec178863f51f0001859bd9",
      "is_video": false,
      "next_page_token": "n1.6a9801c2000000002902d3f5",
      "video_url": null,
      "duration_sec": null,
      "platform": "xiaohongshu",
      "images": [
        "https://sns-i27-ae.rednotecdn.com/notes_pre_post/1040g3k83267gk1jm44704bqnt5boh6up9ulnts0?imageView2/2/w/576/format/heif/q/58|imageMogr2/strip&redImage/frame/0&ap=12&sc=USR_PRV&sign=c3cc24a4f64405fdd87eaa5922f49a0e&t=6add009f"
      ],
      "is_goods_note": false,
      "is_pinned": false,
      "duration_seconds": null
    }
  ],
  "next_page_token": …,
  "pagination": { … },
  "count": 20,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### Where do I find the `user_id`?

Open the creator's profile: the ID is the string after /user/profile/ in the link. You can also pass the full profile URL, or an `author_id` from comment or search results. Nicknames cannot identify an account.

### Why don't the note links open in a browser?

Note links from this capability carry no access token, so a signed-out browser cannot open them. Call Note details with the note ID to get a `url` that opens, along with the full body of the note.

### How do I read every note from an account?

Each call returns one page. Pass the top-level `next_page_token` from the response back as `page_token` to get the next page, until the response has no `next_page_token`. Every page is a separate call, so plan for accounts with long histories.

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=xiaohongshu
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
