# Xiaohongshu Pugongying content boards API (xiaohongshu.pgy_content_square)

- Canonical page: https://everyinfra.com/en/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 | Which Pugongying content-square board `pgy_content_square` reads: `hot` (Xiaohongshu hot, default), `product_seeding`, `ecommerce_promo`, `brand_collab`, `lead_gen`, `ecommerce_hot`, `seeding_direct` or `app_promo`. Ignored when `keyword` is set. |
| keyword | not declared | no | not declared | Optional: search the content square's notes by this word, such as `coffee`; leave it out for the whole board. A keyword search is sorted by popularity and supports no boards or time windows (`board` and `time_window` are ignored), so notes from the last month or two may appear; its rows have no like_count, comment_count, video_url, duration_sec or author_avatar_url, and their links carry no access token. |
| 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. Each page holds 20 notes and is one call; a board holds at most 100 (5 pages), and the last page has no `next_page_token`. |
| time_window | enum: 14d / 30d / 3d / 7d | no | not declared | Time window for `pgy_content_square`: `3d`, `7d` (default), `14d` or `30d`. Ignored when `keyword` is set. |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| rank | Position on the board from 1 (pgy_content_square; with `keyword`, the position in the popularity-sorted search results), continuing from the previous page. |
| 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). |
| 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. |
| like_count | Like count. On note and comment results, the likes on that item; on profile, the total likes the account's notes have received. null means not public or not returned this time, not zero. |
| collect_count | Save count. On note results, how many times that note was saved; on profile, the total saves across the account's notes. null means not public or not returned this time, not zero. |
| comment_count | Comments. null means not disclosed, not 0. |
| view_count | Read count the Pugongying content square shows for the note (pgy_content_square). |
| posted_at | Publish time in ISO 8601, UTC (for example 2026-08-07T12:34:56+00:00). Non-standard strings from the platform are passed through as is, so parse defensively. null means the platform does not disclose it. |
| images | Image links. On note, hashtag, search and user_posts, every image of the note in order. On comment results (comments, comments_batch, sub_comments), the images attached to the comment, stickers included; an empty array means none. null means this item was not returned this time. |
| video_url | Video playback link (MP4), signed and expiring; download promptly if you need to keep it. null for image notes or when not returned. It appears on search/user_posts rows and in the separate video action; the note detail does not carry it (since 2026-10-14) — call the video action with the same note URL when you need the play link. |
| duration_sec | Video length in seconds. null for image notes or when it was not returned this time. |
| duration_seconds | Duration in seconds. null for content that is not video or audio. |
| is_ad | Whether the note is a paid ad placement (pgy_content_square). |
| author_id | The author's user ID. Pass it to profile or user_posts. Note results carry the 24-character ID from profile URLs; comment results (comments, comments_batch, sub_comments) usually carry a different 29-character form. The two forms of one person do not match, so convert them with the user_id that profile returns before de-duplicating across batches. |
| author_name | Author's display name. |
| author_avatar_url | The commenter's avatar link (comments, comments_batch, sub_comments). |
| author_follower_count | Author's follower count. null means not disclosed. |
| 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": "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
