Xiaohongshu Product search API
API health
Status data for this API is temporarily unavailable, so its recent state is unknown. This does not mean it is down.
Search products in the Xiaohongshu store by keyword. Each product has title, price, list price, currency, units sold when the page shows them, stock status, image and shop. A page usually holds 19 products (18 to 20 seen); page with next_page_token. These are store products, not notes, and each id works in product_detail.
Price $5.56 per 1,000 requests ($0.005556 per call). Failed calls and empty results are not charged. Synchronous. For slow jobs add "mode": "async" to the body, take the job_id and poll.
AI prompt
Please help me write a data collection script with the EveryInfra Xiaohongshu Product search endpoint (xiaohongshu/product_search).
How the endpoint works:
- Request: POST https://api.everyinfra.com/api/v1/social with the header Authorization: Bearer <API key>. Read the key from the EVERYINFRA_API_KEY environment variable and never hard-code it.
- In the request body, set platform to xiaohongshu and action to product_search, and put the parameters inside params.
- Required parameters:
- keyword: A product search term for the Xiaohongshu store, such as sunscreen. It returns products (SKUs), not notes; each id works as product_id in product_detail.
- Optional parameters:
- page_token: Page token. Leave it out for the first page, then pass back the previous response's next_page_token exactly as received, with the other parameters unchanged.
- Returns a list of records. Main fields of each record: id, title, url (The record's link on Xiaohongshu), price, original_price (List price of the product before discou…), currency, image_url, sold_count (Units sold as the product page shows th…), in_stock (Whether the product is in stock now (pr…), shop_id (Shop ID (product_search, product_detail…), shop_name (Shop name (product_search, product_deta…), next_page_token (Page token (search, comments, sub_comme…).
- Example request body:
{
"platform": "xiaohongshu",
"action": "product_search",
"params": {
"keyword": "咖啡"
}
}
- Price: $5.56 per 1,000 requests; failed and empty results are not charged.
- For dozens or hundreds of targets, add "mode": "async" to the body: you get a job_id at once and poll GET https://api.everyinfra.com/api/v1/jobs/{job_id} for the result.
- On 422, fix the request using the suggested parameter names and allowed values in the error; on 429 or 503, wait for Retry-After and try again.
Before writing code, ask me which targets I need, how many, which fields, and what output format I want; then confirm the plan and the rough cost with me.Request parameters
| Name | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
Authorization | header | string | Yes | - | Bearer followed by your API key. Create it in the console; never put it in a URL or a code repository. |
platform | body | string | Yes | xiaohongshu | Platform identifier, fixed value. |
action | body | string | Yes | product_search | Capability identifier, fixed value. |
keyword | body.params | string | Yes | - | A product search term for the Xiaohongshu store, such as sunscreen. It returns products (SKUs), not notes; each id works as product_id in product_detail. |
page_token | body.params | string | No | - | Page token. Leave it out for the first page, then pass back the previous response's next_page_token exactly as received, with the other parameters unchanged. A page usually holds 19 products (18 to 20 seen) and is one call; the store reorders results, so adjacent pages can share a few products, deduplicate by id. Use a token within 24 hours, and the last page has no next_page_token. |
Code samples
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": "product_search",
"params": {
"keyword": "咖啡"
}
}'OpenAPI definition (JSON)Samples read the key from the EVERYINFRA_API_KEY environment variable; copied code never contains your key.
Response example
No sample response is available for these parameters yet. This preview shows the response shape and fields from the API definition, with … as placeholders; it is not the result of a live call.
{
"id": "req_…",
"platform": "xiaohongshu",
"action": "product_search",
"results": [
{
"id": …,
"title": …,
"url": …,
"price": …,
"original_price": …,
"currency": …,
"image_url": …,
"sold_count": …,
"in_stock": …,
"shop_id": …,
"shop_name": …,
"next_page_token": …,
"platform": …
}
],
"next_page_token": …,
"pagination": { … },
"count": …,
"billing": {
"charged": …,
"charged_usd": …,
"balance_after_usd": …,
…
},
"quota": { … }
}Response fields
Business data is in results. The table lists the fields a record can contain; values the platform does not show are never made up.
| Field | Meaning |
|---|---|
id | The record's unique ID on the platform. Unique only within one platform; IDs can repeat across platforms. |
title | Title. null when the platform has no titles (for example text-only posts). |
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. |
price | Price as a number without a currency symbol; see currency. |
original_price | List price of the product before discount (product_search, product_detail), in CNY; equal to price when there is no strikethrough price. |
currency | Currency code of the price (for example CNY, USD). If price is present but currency is null, do not assume a currency. |
image_url | Image link. Capabilities with several images may return an image_urls array. |
sold_count | Units sold as the product page shows them (product_search, product_detail): exact in search rows; when the detail page shows a rounded figure such as 72k+, this is that lower bound (72000). Products sold by weight or by piece count in that unit. Absent when the page shows none. |
in_stock | Whether the product is in stock now (product_search, product_detail). |
shop_id | Shop ID (product_search, product_detail). |
shop_name | Shop name (product_search, product_detail). |
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. |
platform | Source platform identifier, the same as platform in the request (for example xiaohongshu, tiktok). |
Errors and billing
- 401
- Missing or invalid key.
- 402
- Insufficient balance. Top up first.
- 422
- Invalid parameter name or value. Fix it using the suggestions in the error. No charge.
- 429
- Per-minute request limit reached. Wait for Retry-After, then try again.
- 503
- Could not complete. The held charge is returned to your balance. If the outcome is unknown, verify it before you retry.
- 200 empty
- No data. No charge.