Xiaohongshu search_posts API
Xiaohongshu search_posts data in one REST call — normalized to the stable JSON schema shared across every FetchPI platform.
- 1 documented endpoints
- GET /v1/xhs/search/posts
Contract summary (English): Search Xiaohongshu posts (capability xhs.search_posts)
- Normalized response entity
- xiaohongshu/search_posts
- capability
- xhs.search_posts
Every response also carries freshness (cache / default / live) and billing metadata.
Use cases
- Find {{platform}} content and accounts matching a keyword, with normalized results ready for scoring.
- Follow trending topics and hot lists to catch emerging conversations early.
- Alert on search and trend queries so your team sees shifts as they happen.
Response fields
Xiaohongshu note search response (normalized envelope)
Response envelope for GET /v1/xhs/search/posts (capability xhs.search_posts). Same normalized note entities as user_posts (search cards ship without the author block); echoes the effective query. Pages by an upstream page number behind the opaque platform cursor; the vendor search_id needed for deep pages is a pending calibration item.
| Field | Type | Required | Description |
|---|---|---|---|
| query | string | Optional | Echo of the effective search query. |
| data | post[] | Required | — |
| next_cursor | string | null | Required | Opaque pagination cursor; null when results are exhausted. Cursor validity is tied to the provider that produced the page. |
| meta.request_id | string | Required | — |
| meta.freshness.mode | cache | default | live | Required | — |
| meta.freshness.age_seconds | integer | null | Optional | — |
| meta.freshness.source_layer | cache | db | upstream | Required | — |
| meta.freshness.stale | boolean | Optional | — |
| meta.billing.cache_hit | boolean | Required | — |
| meta.billing.amount_credits | integer | Required | Credits actually charged for this request (the settlement unit; 1 credit = $0.0001, permanent). |
Field notes are shown in the contract's original English.
Response meta
| Field | Type | Required | Description |
|---|---|---|---|
| mode | cache | default | live | Required | Effective mode after merging param > max_age > source policy (D-004). |
| age_seconds | integer | null | Optional | Age of served data; null when unknown. |
| source_layer | cache | db | upstream | Required | Which layer served the response (PRD §10). |
| stale | boolean | Optional | True when stale data was served under stale_if_error / SWR (D-004). |
| billing.amount_credits | integer | Required | Micro-USD (1e-6 USD) actually charged for this request. |
| billing.cache_hit | boolean | Required | — |
Field notes are shown in the contract's original English.
Example request & response
/v1/xhs/search/postscurl -H "Authorization: Bearer $MESHDATA_API_KEY" \
"https://api.fetchpi.com/v1/xhs/search/posts?q=meshdata"{
"data": [
{
"id": "66f2c1de000000001f0167b1",
"platform": "xiaohongshu",
"type": "post",
"author": null,
"title": "search hit one",
"text": null,
"created_at": null,
"metrics": {
"likes": 512,
"collects": 0,
"comments": 0,
"shares": 0
},
"attachments": [
{
"type": "photo",
"url": "https://cdn.example.com/s1-cover.jpg"
}
],
"fetched_at": "2026-09-18T09:05:00Z"
}
],
"next_cursor": null,
"meta": {
"request_id": "req_01HTXQ8Z9HTQ",
"freshness": {
"mode": "live",
"age_seconds": 0,
"source_layer": "upstream",
"stale": false
},
"billing": {
"amount_credits": 300,
"cache_hit": false
}
}
}Free demo
Create a free account, grab an API key and call this endpoint from the browser-based Playground.
Try it in the PlaygroundParameter tables, error codes and response semantics for this endpoint live in the API documentation.
Open the endpoint referenceFrequently asked questions
What is the difference between cache and live freshness?
cache answers from the stored snapshot without touching the upstream; live queries fresher data and may cost extra credits — see the freshness section of the docs.
Can I try this endpoint for free?
Yes — register an account, grab an API key and call it from the Playground in the console.
How is the search_posts capability billed?
Data API calls are billed per request in credits, with different cache/live freshness multipliers. Current per-capability prices live on the pricing page.
Pricing
Per-request credit billing with cache/live freshness options — current prices live on the pricing page.