# Xiaohongshu Product search API (xiaohongshu.product_search)

- Canonical page: https://everyinfra.com/en/xiaohongshu-api/product_search
- Endpoint: POST /api/v1/social with {"platform": "xiaohongshu", "action": "product_search", "params": {...}}
- Price: $0.005556 per call ($5.56 per 1,000 requests); failed and empty results are not charged
- Returns: list, one page of up to 20 per call; the number of rows varies from page to page and a short page is not the end (limit is ignored; pass the top-level next_page_token from the response as page_token for the next page; no next_page_token means the end)
- 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

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| keyword | not declared | yes | not declared | 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 | not declared | no | not declared | 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`. |

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

## 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": "product_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": "product_search",
        "params": {
            "keyword": "咖啡",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

No real sample for these example parameters yet: structure only, every value is a placeholder (…).

```text
{
  "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": { … }
}
```

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