# 小红书 热榜 API (xiaohongshu.trending)

- Canonical page: https://everyinfra.com/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 | 这次调用最多返回的条数，整数，1–30；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| url | 该记录在小红书上的链接。search、note、profile、hashtag 返回的链接一般带访问令牌，未登录的浏览器也能打开（令牌有时效，过期后重新调用即可）；user_posts 返回的笔记链接不带令牌，在浏览器里打开需要令牌：用笔记 ID 调 note 能拿到可以打开的链接；search_users 返回的主页链接同样不带令牌，用 user_id 调 profile 拿能打开的链接。pgy_content_square 不带 keyword 时笔记链接带令牌，带 keyword 时不带（用笔记 ID 调 note 拿能打开的链接）。followers_list 返回的是粉丝的主页链接，同样不带令牌；note_location 返回的笔记链接带上了请求里的令牌（请求里没带就没有）。 |
| title | 标题。平台无标题概念时（如纯文本帖）为 null。 |
| author_name | 作者昵称（显示名）。 |
| is_video | 是否视频笔记。视频播放地址不在详情返回里（2026-10-14 起）：要地址请用同一篇笔记的 url 单独调用 video 接口，按次计费。 |
| image_url | 图片链接。多图能力可能返回 image_urls 数组。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 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
