POST

API health

24h health
100%
24h average time
1.95 s
  • Healthy / normal
  • Available
  • Limited
  • Mostly down
Healthy

Last 24 hours

Last 30 days

Read the replies under one comment on a Xiaohongshu note, 10 per page. Get text, likes, IP location and who each reply answers. Pass the note link with a comment_id from the comments results. Use reply_to_id to rebuild the thread.

Send POST https://api.everyinfra.com/api/v1/social with platform set to xiaohongshu and action set to sub_comments. Price $5.56 per 1,000 requests ($0.005556 per call). Failed calls and empty results are not charged. Synchronous. For slow jobs add "mode": "async" to the body, take the job_id and poll.

AI prompt

#
Please help me write a data collection script with the EveryInfra Xiaohongshu Comment replies endpoint (xiaohongshu/sub_comments).

How the endpoint works:
- Request: POST https://api.everyinfra.com/api/v1/social with the header Authorization: Bearer <API key>. Read the key from the EVERYINFRA_API_KEY environment variable and never hard-code it.
- In the request body, set platform to xiaohongshu and action to sub_comments, and put the parameters inside params.
- Required parameters:
  - url: Specifies the full Xiaohongshu note URL, formatted as /explore/<note_id> or /discovery/item/<note_id>. Use recent search URLs that retain query parameters like xsec_token.
  - comment_id: Specifies the parent comment ID to retrieve sub-replies for in the sub_comments action. Obtain this ID from the comments response for the same note and pair it with the corresponding url. It is not a note ID or user ID.
- Optional parameters:
  - page_token: Pagination cursor for the comments, sub_comments, search, user_posts, search_users and hashtag actions: pass back the next_page_token value from a row of the previous response to fetch the next page.
- Returns a list of records. Main fields of each record: id, text (Note body or comment text), like_count (Like count), posted_at, ip_location (IP location (province or country) that…), author_name, author_id (The author's user ID), reply_to_id, reply_to_author_name, reply_to_author_id, next_page_token (Page token (search, comments, sub_comme…), images (Image links); 18 fields in total, full list at https://api.everyinfra.com/api/v1/social/catalog?platform=xiaohongshu.
- Example request body:
{
  "platform": "xiaohongshu",
  "action": "sub_comments",
  "params": {
    "url": "https://www.xiaohongshu.com/explore/6aa7a3f600000000110335f8?xsec_token=YByFNzoKupps8B3qI774Gx7XGxfHpq4QWEvxU4zsD8454%3D",
    "comment_id": "6aa80e9b000000000200c6ad"
  }
}
- Price: $5.56 per 1,000 requests; failed and empty results are not charged.
- For dozens or hundreds of targets, add "mode": "async" to the body: you get a job_id at once and poll GET https://api.everyinfra.com/api/v1/jobs/{job_id} for the result.
- On 422, fix the request using the suggested parameter names and allowed values in the error; on 429 or 503, wait for Retry-After and try again.

Before writing code, ask me which targets I need, how many, which fields, and what output format I want; then confirm the plan and the rough cost with me.

Request parameters

#
NameInTypeRequiredDefaultDescription
AuthorizationheaderstringYes-Bearer followed by your API key. Create it in the console; never put it in a URL or a code repository.
platformbodystringYesxiaohongshuPlatform identifier, fixed value.
actionbodystringYessub_commentsCapability identifier, fixed value.
urlbody.paramsstringYes-Specifies the full Xiaohongshu note URL, formatted as /explore/<note_id> or /discovery/item/<note_id>. Use recent search URLs that retain query parameters like xsec_token. The sub_comments action requires both this url and a valid comment_id.
comment_idbody.paramsstringYes-Specifies the parent comment ID to retrieve sub-replies for in the sub_comments action. Obtain this ID from the comments response for the same note and pair it with the corresponding url. It is not a note ID or user ID.
page_tokenbody.paramsstringNo-Pagination cursor for the comments, sub_comments, search, user_posts, search_users and hashtag actions: pass back the next_page_token value from a row of the previous response to fetch the next page; omit it to start from the first page. Each page is one call, billed per request.

Code samples

#
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": "sub_comments",
  "params": {
    "url": "https://www.xiaohongshu.com/explore/6aa7a3f600000000110335f8?xsec_token=YByFNzoKupps8B3qI774Gx7XGxfHpq4QWEvxU4zsD8454%3D",
    "comment_id": "6aa80e9b000000000200c6ad"
  }
}'

OpenAPI definition (JSON)Samples read the key from the EVERYINFRA_API_KEY environment variable; copied code never contains your key.

Response example

#
Captured November 7, 2026 at 14:47 (UTC) by calling this API with the parameters in the code sample above. results and count are that call's real response with personal information (names, handles, avatars, profile links, contact details) removed; the list keeps the first 2. id, billing and quota differ on every call, so only their shape is shown.
json
{  "id": "req_…",  "platform": "xiaohongshu",  "action": "sub_comments",  "results": [    {      "id": "6aaa0e53000000000b01276f",      "text": "卫生间一个浴缸至少1米,然后一个盥洗盆至少一米,加上卫生间门向内打开,还留了几十公分,加上门至少3米了,宽度一个浴缸加上两个过道还有一个马桶,加上墙体的厚度,至少五六平了。客厅长度和宽度至少有二三十平。如果加上公摊,建筑面积在60平。",      "like_count": 11,      "posted_at": "2026-09-16T03:34:44+00:00",      "author_name": "依•••亦",      "author_id": "•••",      "reply_to_id": "6aa80e9b000000000200c6ad",      "reply_to_author_name": "小•••鱼",      "reply_to_author_id": "•••",      "next_page_token": "n1.6aaa68c700000000150010fb",      "images": [],      "is_author": false,      "author_avatar_url": "https://sns-avatar-qc-ae.rednotecdn.com/•••",      "author_red_id": "•••",      "author_is_ai_agent": false,      "comment_tags": [],      "platform": "xiaohongshu"    },    {      "id": "6aaa1eb000000000150141c3",      "text": "这种看看得了,还当真[偷笑R]",      "like_count": 3,      "posted_at": "2026-09-16T04:44:32+00:00",      "author_name": "小•••D",      "author_id": "•••",      "reply_to_id": "6aaa0e53000000000b01276f",      "reply_to_author_name": "依•••亦",      "reply_to_author_id": "•••",      "next_page_token": "n1.6aaa68c700000000150010fb",      "images": [],      "is_author": false,      "author_avatar_url": "https://sns-avatar-qc-ae.rednotecdn.com/•••",      "author_red_id": "•••",      "author_is_ai_agent": false,      "comment_tags": [],      "platform": "xiaohongshu"    }  ],  "next_page_token": …,  "pagination": { … },  "count": 5,  "billing": {    "charged": …,    "charged_usd": …,    "balance_after_usd": …,    …  },  "quota": { … }}

Response fields

#

Business data is in results. The table lists the fields a record can contain; values the platform does not show are never made up.

FieldMeaning
idThe record's unique ID on the platform. Unique only within one platform; IDs can repeat across platforms.
textNote body or comment text. note and hashtag return the full body; search and user_posts may return a truncated excerpt (up to about 60 and 100 characters respectively). Call note with the note ID for the full text.
like_countLike 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.
posted_atPublish 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.
ip_locationIP location (province or country) that Xiaohongshu displays; not entered by the user. Only some user_posts rows carry it.
author_nameAuthor's display name.
author_idThe 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.
reply_to_idKeeps the platform's own meaning
reply_to_author_nameKeeps the platform's own meaning
reply_to_author_idKeeps the platform's own meaning
next_page_tokenPage token (search, comments, sub_comments, user_posts, search_users, hashtag): pass it back unchanged as page_token, with the other parameters the same, to fetch the next page.
imagesImage 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.
is_authorWhether the note's author wrote this comment. null means this item was not returned this time, not false.
author_avatar_urlThe commenter's avatar link (comments, comments_batch, sub_comments).
author_red_idThe author's Xiaohongshu ID: on comment results (comments, comments_batch, sub_comments) the commenter's, on note the note author's.
author_is_ai_agentWhether the commenter is an account the platform marks as AI; absent when this item was not returned.
mentioned_usersPeople @-mentioned: on comment results, those mentioned in the comment; on note, those mentioned in the note. Each entry has user_id and nickname. Absent when there are none.
comment_tagsKeeps the platform's own meaning
platformSource platform identifier, the same as platform in the request (for example xiaohongshu, tiktok).

Errors and billing

#
401
Missing or invalid key.
402
Insufficient balance. Top up first.
422
Invalid parameter name or value. Fix it using the suggestions in the error. No charge.
429
Per-minute request limit reached. Wait for Retry-After, then try again.
503
Could not complete. The held charge is returned to your balance. If the outcome is unknown, verify it before you retry.
200 empty
No data. No charge.

Errors

Our own visit stats are always on. Google Analytics loads only if you choose “Allow analytics”. Privacy policy