# Xiaohongshu Trending API (xiaohongshu.trending)

- Canonical page: https://everyinfra.com/en/xiaohongshu-api/trending
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "xiaohongshu", "action": "trending", "params": {...}}
- Price: $0.005556 per call ($5.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, default 20, max 30 per call
- 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=trending

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| limit | integer (1–30) | no | 20 | The most rows to return in this call, an integer from 1 to 30. The default applies when you leave it out, and a call can return fewer rows. Larger values return 422 before any charge. |

## 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). |
| author_name | Author's display name. |
| 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. |
| image_url | Image link. Capabilities with several images may return an image_urls array. |
| 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": "trending",
  "params": {}
}'
```

```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": "trending",
        "params": {},
    },
    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": "trending",
  "results": [
    {
      "id": "6ad37038000000001303dfad",
      "url": "https://www.xiaohongshu.com/explore/6ad37038000000001303dfad?xsec_token=YCw7qdw4BrTHKOluaOFx0EwfP63jKAwxKU5sUT0tC2PMw%3D",
      "title": "厨房早知道这些，我也不至于这么累",
      "author_name": "•••",
      "is_video": true,
      "image_url": "https://sns-na-i1.xhscdn.com/1040g008326e5i15jl6005orjhjv7r9vsbuvdlh0?imageView2/format/jpg/q/90",
      "platform": "xiaohongshu"
    },
    {
      "id": "6acb2117000000001802c26a",
      "url": "https://www.xiaohongshu.com/explore/6acb2117000000001802c26a?xsec_token=YCVPA9X-3nD0XXBBrhBx0IJp-l-hYVS0W_-p1KoFL9ESc%3D",
      "title": "初三 ｜年级前十的学习好物分享",
      "author_name": "•••",
      "is_video": true,
      "image_url": "https://sns-na-i1.xhscdn.com/1040g00832661cki74a0g5q5enesmfh0el2326gg?imageView2/format/jpg/q/90",
      "platform": "xiaohongshu"
    }
  ],
  "count": 20,
  "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
