# 小红书 蒲公英内容广场榜 API (xiaohongshu.pgy_content_square)

- Canonical page: https://everyinfra.com/xiaohongshu-api/pgy_content_square
- Endpoint: POST /api/v1/social with {"platform": "xiaohongshu", "action": "pgy_content_square", "params": {...}}
- Price: $0.016 per call ($16 per 1,000 requests); failed and empty results are not charged
- Returns: list, one page of 20 per call (limit is ignored; pass the top-level next_page_token from the response as page_token for the next page)
- Pagination: pass next_page_token back as page_token for the next page, other params unchanged; one call per page, tokens last 24 hours; up to 100 rows
- 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=pgy_content_square

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| board | enum: app_promo / brand_collab / ecommerce_hot / ecommerce_promo / hot / lead_gen / product_seeding / seeding_direct | no | not declared | 哪个榜（小红书蒲公英内容广场的热门内容榜）：hot 小红书热门（默认）/ product_seeding 产品种草 / ecommerce_promo 电商推广 / brand_collab 蒲公英合作 / lead_gen 客资收集 / ecommerce_hot 电商热门 / seeding_direct 种草直达 / app_promo 应用推广。带 keyword 时不生效。 |
| keyword | not declared | no | not declared | 按关键词搜蒲公英内容广场的笔记，如 咖啡；不传看整个榜。带 keyword 时按关键词搜，不支持榜单和时间窗（board、time_window 不生效），按热度排，近一两个月发布的笔记都可能出现；这时返回行没有点赞数、评论数、视频地址、视频时长、作者头像，笔记链接不带令牌。 |
| page_token | not declared | no | not declared | 翻页令牌。第一页不传；之后把上一页响应里的 next_page_token 原样传回取下一页，其余参数不变。每页 20 条，每页算一次调用；每个榜最多 100 条（5 页），翻到底时响应里没有 next_page_token。 |
| time_window | enum: 14d / 30d / 3d / 7d | no | not declared | 统计时间窗：3d 近 3 天 / 7d 近 7 天（默认）/ 14d 近 14 天 / 30d 近 30 天。带 keyword 时不生效。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| rank | 在榜单上的名次（pgy_content_square；带 keyword 时是按热度排的搜索结果名次），从 1 开始，翻页时接着上一页往下数。 |
| 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。 |
| is_video | 是否视频笔记。视频播放地址不在详情返回里（2026-10-14 起）：要地址请用同一篇笔记的 url 单独调用 video 接口，按次计费。 |
| like_count | 点赞数。笔记、评论类结果是这条内容的点赞数；reviews 是这条商品评价被点「有用」的次数；profile 里是该账号所有笔记累计获得的点赞数。null 表示不公开或这次没拿到，不等于 0。 |
| collect_count | 收藏数。笔记类结果是这篇笔记被收藏的次数；profile 里是该账号笔记累计被收藏的次数。null 表示不公开或这次没拿到，不等于 0。 |
| comment_count | 评论数。null 表示不公开，不等于 0。 |
| view_count | 阅读数（pgy_content_square），蒲公英内容广场显示的这篇笔记的阅读量。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| images | 图片链接列表。note、hashtag、search、user_posts 是笔记的全部图片（按原顺序）；评论类结果（comments、comments_batch、sub_comments）是评论所附的图片，含表情包贴图，没有图片时为空数组；reviews 是买家晒的图，没有晒图时为空数组。null 表示这次没拿到这一项。 |
| video_url | 视频播放地址（mp4），带签名、会过期，要留存请及时下载。图文笔记或这次没拿到时为 null。search/user_posts 行与 video 接口返回；note 详情不含（2026-10-14 起要地址请单独调用 video 接口）。 |
| duration_sec | 视频时长，单位秒。图文笔记或这次没拿到时为 null。 |
| duration_seconds | 时长，单位秒。非视频/音频内容为 null。 |
| is_ad | 是不是投放的广告笔记（pgy_content_square）。 |
| author_id | 作者的用户 ID，可直接传给 profile、user_posts。笔记类结果里是 24 位，与主页链接里的 ID 相同；评论类结果（comments、comments_batch、sub_comments）里多为 29 位的另一种写法。同一个人的两种写法不同，跨批次去重前先用 profile 换成它返回的 user_id。 |
| author_name | 作者昵称（显示名）。 |
| author_avatar_url | 评论者的头像链接（comments、comments_batch、sub_comments）。 |
| author_follower_count | 作者粉丝数。null 表示不公开。 |
| 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": "pgy_content_square",
  "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": "pgy_content_square",
        "params": {},
    },
    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": "pgy_content_square",
  "results": [
    {
      "rank": …,
      "id": …,
      "url": …,
      "title": …,
      "is_video": …,
      "like_count": …,
      "collect_count": …,
      "comment_count": …,
      "view_count": …,
      "posted_at": …,
      "images": …,
      "video_url": …,
      "duration_sec": …,
      "duration_seconds": …,
      "is_ad": …,
      "author_id": …,
      "author_name": …,
      "author_avatar_url": …,
      "author_follower_count": …,
      "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
