# Xiaohongshu Search API (xiaohongshu.search)

- Canonical page: https://everyinfra.com/en/xiaohongshu-api/search
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "xiaohongshu", "action": "search", "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 Search looks up notes by `keyword` and returns one page of note cards: title, a short excerpt of the body, like and save counts, the author and the publish time. Video notes also carry the play link in `video_url` and the length in `duration_sec`, and cards tagged with a place carry `poi_name`. It shows what people are posting about a topic right now and which notes draw the most engagement, which makes it a starting point for trend research, brand monitoring and finding creators to work with.

Narrow the page with `sort` (newest, most liked, most commented or most saved), `date_range` (the last 24 hours, 7 days, month, six months or year; `any_time` for no limit) and `content_type` (image or video notes). Keep in mind that `text` in search results is an excerpt; pass the result's `url` to the Note details capability when you need the full body. A null `like_count` or `collect_count` means the value was not returned this time, not that it is zero.

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| keyword | not declared | yes | not declared | Specifies the query string used to search Xiaohongshu note content (e.g., "sensitive skin sunscreen") in the search action. Searches note text, not user IDs. |
| content_type | enum: all / image / video | no | not declared | Filters returned notes by content type, such as image/text or video. Use the allowed values listed for the current action. |
| date_range | enum: any_time / last_1_year / last_24_hours / last_30_days / last_6_months / last_7_days | no | not declared | Filters notes by publish time: any_time (no limit, the same as omitting it), last_24_hours (the past 24 hours), last_7_days (the past 7 days), last_30_days (the past month), last_6_months (the past six months) or last_1_year (the past year). With last_30_days and last_1_year a page can hold fewer than 20 notes, and a page with none is not charged; add sort=newest for fuller pages. These two values work in synchronous calls only. Keep the same value while paging. |
| 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. |
| sort | enum: most_collected / most_commented / most_liked / newest / relevance | no | not declared | Sets the order of note lists in the search action: relevance, newest, most_liked, most_commented or most_collected. Use only the allowed values listed for the action. |

## 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). |
| poi_id | ID of the place tagged on the search result card (search); absent when no place is tagged. |
| poi_name | Place name: on search, the place tagged on the result card; on note_location, the part of the note's tagged place after the dot, such as a café branch. Absent when no place, or several places, are tagged. |
| 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_cooperation_note | Whether the note is a paid brand collaboration (search, note); absent when this could not be determined. |
| author_is_verified | platform-native meaning |
| updated_at | platform-native meaning |
| author_red_id | The author's Xiaohongshu ID: on comment results (comments, comments_batch, sub_comments) the commenter's, on note the note author's. |
| video_width | platform-native meaning |
| video_height | platform-native meaning |

## 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": "search",
  "params": {
    "keyword": "小户型收纳"
  }
}'
```

```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": "search",
        "params": {
            "keyword": "小户型收纳",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-10-15T15:15:15Z. `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": "search",
  "results": [
    {
      "id": "6a55fff400000000110058c3",
      "url": "https://www.xiaohongshu.com/explore/6a55fff400000000110058c3?xsec_token=YBwgl4W48szr36c1jFWrf2WWLLGDKYfA5rrXQivgGAj1A%3D",
      "title": "抽屉乱救星！亚克力薄抽治愈收纳焦虑｜附教程",
      "text": "我发现这种又薄、还自带分隔的亚克力薄抽，简直就是为收纳小工具小零件而生的。今天就来分享详细的改造教程，评论区等你们交作业",
      "like_count": 10388,
      "collect_count": 19173,
      "comment_count": 257,
      "share_count": 2323,
      "posted_at": "2026-07-14T09:23:00+00:00",
      "image_url": "https://sns-na-i6.xhscdn.com/1040g2sg322jlesv1mse043d8j25m1nmqtti8mog?imageView2/2/w/608/format/heif/q/56|imageMogr2/strip&redImage/frame/0/enhance/4&ap=5&sc=SRH_PRV&sign=b642658d19400d337f2d5296494687c7&t=6ad0ee01",
      "author_name": "•••",
      "author_id": "•••",
      "avatar_url": "https://sns-avatar-qc.xhscdn.com/•••",
      "author_url": "https://www.xiaohongshu.com/•••",
      "is_video": true,
      "next_page_token": "n1.p2",
      "video_url": "http://sns-video-v6.xhscdn.com/stream/79/110/258/01ea55fdf56356a44f0370019f5ff0eb8f_258.mp4?sign=734255c44c5f43e96d8b4a12707707a8&t=6ad58b41",
      "duration_sec": 124,
      "platform": "xiaohongshu"
    },
    {
      "id": "6ac221730000000015002ebb",
      "url": "https://www.xiaohongshu.com/explore/6ac221730000000015002ebb?xsec_token=YBPVyCh77T_2_QF6CFfJ2TiJ8GngzcLJj_Iho466OzP5o%3D",
      "title": "鬼才🔥3平开放式小厨房超实用设计！",
      "text": "#家的1%幸福效应  #howto装扮我的家  #适己化装修  #小户型也有完美厨房  #开放式厨房  #利用厨房空间",
      "like_count": 38783,
      "collect_count": 30796,
      "comment_count": 1021,
      "share_count": 6986,
      "posted_at": "2026-10-04T09:50:43+00:00",
      "image_url": "https://sns-na-i6.xhscdn.com/1040g008325t8oj9j4q005pl7le7nc96up4p8rk8?imageView2/2/w/608/format/heif/q/56|imageMogr2/strip&redImage/frame/0/enhance/4&ap=5&sc=SRH_PRV&sign=ee3e432a917938b82ba55751f30a860e&t=6ad0ee01",
      "author_name": "•••",
      "author_id": "•••",
      "avatar_url": "https://sns-avatar-qc.xhscdn.com/•••",
      "author_url": "https://www.xiaohongshu.com/•••",
      "is_video": true,
      "next_page_token": "n1.p2",
      "video_url": "http://sns-video-v6.xhscdn.com/stream/1/110/258/01eac221721521f001037001a106536b1a_258.mp4?sign=e98d44d7b6f666dc2c4e841655d8c578&t=6ad58b41",
      "duration_sec": 189,
      "platform": "xiaohongshu",
      "poi_id": "42303030413832584538"
    }
  ],
  "next_page_token": …,
  "pagination": { … },
  "count": 20,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### Why is the note text cut short?

Search results carry the excerpt Xiaohongshu shows on its result cards, usually a few dozen characters. For the full body and every image, call Note details with the `url` from the result row; that link already carries the access token the note page needs.

### How do I get the next page?

Pass the top-level `next_page_token` from the response back as `page_token` and keep every other parameter the same. Leaving out `page_token` starts from the first page. Each page is one call, and a call that returns no rows is not charged.

### Where do I get the video for a video note?

Take `video_url` from the search row. It is an MP4 play link that is signed and expires, so download the file promptly if you need to keep it; `duration_sec` gives its length, and image notes leave both null. Note details does not return the play link, so if you only have a note link, call Video details with it.

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