# 小红书 视频详情 API (xiaohongshu.video)

- Canonical page: [https://everyinfra.com/xiaohongshu-api/video](https://everyinfra.com/xiaohongshu-api/video?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "xiaohongshu", "action": "video", "params": {...}}
- Price: $0.005556 per call ($5.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: single object
- 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=video

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| url | not declared | yes | not declared | 小红书笔记完整链接，路径为 /explore/<笔记ID> 或 /discovery/item/<笔记ID>；优先使用近期搜索结果中的完整 URL，保留 xsec_token 等查询参数。sub_comments 还需同一笔记下的 comment_id。 |

## 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 返回的笔记链接不带令牌（用笔记 ID 调 note 拿能打开的链接）。followers_list 返回的是粉丝的主页链接，同样不带令牌；note_location 返回的笔记链接带上了请求里的令牌（请求里没带就没有）。 |
| video_url | 视频播放地址（mp4），带签名、会过期，要留存请及时下载。图文笔记或这次没拿到时为 null。search/user_posts 行与 video 接口返回；note 详情不含（2026-10-14 起要地址请单独调用 video 接口）。 |
| duration_sec | 视频时长，单位秒。图文笔记或这次没拿到时为 null。 |
| duration_seconds | 时长，单位秒。非视频/音频内容为 null。 |
| video_width | 视频画面宽度（像素，search、video）。 |
| video_height | 视频画面高度（像素，search、video）。 |
| 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": "video",
  "params": {
    "url": "https://www.xiaohongshu.com/explore/6aa7a3f600000000110335f8?xsec_token=YByFNzoKupps8B3qI774Gx7XGxfHpq4QWEvxU4zsD8454%3D"
  }
}'
```

```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": "video",
        "params": {
            "url": "https://www.xiaohongshu.com/explore/6aa7a3f600000000110335f8?xsec_token=YByFNzoKupps8B3qI774Gx7XGxfHpq4QWEvxU4zsD8454%3D",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-10-15T15:16:12Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "xiaohongshu",
  "action": "video",
  "results": {
    "id": "6aa7a3f600000000110335f8",
    "url": "https://www.xiaohongshu.com/explore/6aa7a3f600000000110335f8?xsec_token=YByFNzoKupps8B3qI774Gx7XGxfHpq4QWEvxU4zsD8454%3D",
    "video_url": "https://sns-v27-ae.rednotecdn.com/stream/79/110/258/01eaa76c635e8a794f037001a09ed91663_258.mp4?sign=b73cfc2583abfbb40fb4d8bee0a7cc2b&t=6ad58b80",
    "duration_sec": 283,
    "platform": "xiaohongshu"
  },
  "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
