Xiaohongshu (RedNote) comments API
Based on the 2026-10-25 specification snapshot
Quick answer
POST /xhs/pushs/task with a note URL starts an asynchronous task that collects the note's comments. order_type takes hot, time or both; crawl_second_layer=true adds second-layer replies; get_all=true turns off the duplicate check and collects every comment. Poll GET /xhs/pushs/task/{task_id}; once DONE it returns the comments and total_count, up to 1000 per page. Each comment links back to its note through post_id and has the author, content, a sentiment label and timestamps. Data is collected by web crawlers from content publicly published on Xiaohongshu.
What teams use it for
- Read what users ask and complain about under product reviews and recommendations.
- Collect the questions people leave in comments to inform product pages, FAQs or customer service.
- Compare comment sentiment across notes about competing products.
Endpoints
Base URL: https://api.infominer.io/api/v2. Send your API key in the auth-header request header.
| Method | Path | What it does |
|---|---|---|
| POST | /xhs/pushs/task |
Creates a comment task from a note URL, with sort order, second-layer replies and a duplicate-check switch. |
| GET | /xhs/pushs/task/{task_id} |
Polls a note comment task; once DONE it returns comments, up to 1000 per page. |
Request parameters
POST /xhs/pushs/task
| Parameter | In | Type | Required | Default / allowed | Description |
|---|---|---|---|---|---|
post_url |
body | string | Yes | Xiaohongshu note URL. | |
crawl_second_layer |
body | boolean | No | false |
Also collect second-layer replies. |
get_all |
body | boolean | No | false |
Turn off the duplicate check and collect every comment. |
order_type |
body | string | No | default hot; allowed hot | time | both |
Comment sort order. |
GET /xhs/pushs/task/{task_id}
| Parameter | In | Type | Required | Default / allowed | Description |
|---|---|---|---|---|---|
task_id |
path | string | Yes | Task ID returned when the task was created. | |
page |
query | integer | No | 1 |
Page number, starting at 1. |
pageSize |
query | integer | No | 1000 |
Comments per page, max 1000. |
Response fields
| Data | Fields | Endpoint |
|---|---|---|
| Comments | id, post_id, author, author_id, content, push_type, sentiment, tm, tm_crawler, region | GET /xhs/pushs/task/{task_id} |
Code examples
curl: create the task
curl -X POST https://api.infominer.io/api/v2/xhs/pushs/task \
-H "auth-header: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"post_url": "https://www.xiaohongshu.com/explore/000000000000000000000001", "order_type": "time", "crawl_second_layer": true}'
curl: poll the task by ID
curl "https://api.infominer.io/api/v2/xhs/pushs/task/$TASK_ID?page=1&pageSize=1000" \
-H "auth-header: YOUR_API_KEY"
Python (requests): create, poll, read
import time
import requests
BASE_URL = "https://api.infominer.io/api/v2"
HEADERS = {"auth-header": "YOUR_API_KEY"}
# 1. Create the task
resp = requests.post(
f"{BASE_URL}/xhs/pushs/task",
headers=HEADERS,
json={
"post_url": "https://www.xiaohongshu.com/explore/000000000000000000000001",
"order_type": "time",
"crawl_second_layer": True,
},
timeout=30,
)
resp.raise_for_status()
task = resp.json()
# 2. Poll until the task leaves INIT / RUNNING
for _ in range(120):
resp = requests.get(
f"{BASE_URL}/xhs/pushs/task/{task['id']}",
headers=HEADERS,
params={
"page": 1,
"pageSize": 1000,
},
timeout=30,
)
resp.raise_for_status()
result = resp.json()
status = result.get("status") or result.get("task", {}).get("status")
if status not in ("INIT", "RUNNING"):
break
time.sleep(15)
else:
raise SystemExit("task still running; poll it again later")
if status == "FAILED":
raise SystemExit("task failed")
if status != "DONE":
print("task ended with status", status, "- results may be incomplete")
# 3. Read the records (use page / pageSize to fetch further pages)
for row in result.get("data", []):
print(row["post_id"], row["author"], row["content"][:60])
Sample response
Illustrative data written by hand: accounts are sample_user_n and IDs are obviously fake. Fields follow the 2026-10-25 specification snapshot; the sample shows a subset, and the full list is in the table above.
Poll response once the task is DONE (illustrative data)
{
"task": {
"id": "00000000-0000-4000-8000-000000000001",
"status": "DONE"
},
"total_count": 2,
"data": [
{
"id": "0000000000000101",
"post_id": "000000000000000000000001",
"author": "sample_user_3",
"author_id": "0000000000000003",
"tm": 1781065800,
"tm_crawler": 1781150400,
"content": "请问敏感肌可以用吗?",
"sentiment": "Neutral"
},
{
"id": "0000000000000102",
"post_id": "000000000000000000000001",
"author": "sample_user_4",
"author_id": "0000000000000004",
"tm": 1781067600,
"tm_crawler": 1781150400,
"content": "跟着你的步骤用了两周,脸没那么干了",
"sentiment": "Positive"
}
]
}
Limits and notes
- Comments are read up to 1000 per page.
- crawl_second_layer defaults to false. The snapshot does not describe how second-layer replies are nested in the response or linked to their parent comment, so confirm that with trial data.
- Comment tasks run a duplicate check by default; set get_all to true to collect every comment.
- Volume per note and refresh frequency are confirmed per project scope.
More Xiaohongshu (RedNote) API pages
- Note search
- Comments and replies
- User timeline
Request a trial
In the request form below, mention Xiaohongshu and tell us the keywords or categories to search, whether you need comments and second-layer replies, and the expected volume. We confirm the scope and reply with the arrangements for the trial and API key.
Fill in the form to request a trial. We confirm the scope and reply with trial and integration arrangements.
Fill in the request formFAQ
- Can I get the replies under Xiaohongshu comments?
- Yes. Set crawl_second_layer to true when you create the comment task.
- Which note URL does post_url take?
- A Xiaohongshu note URL. The samples on this page use https://www.xiaohongshu.com/explore/{note_id}; accepted URL formats are confirmed with trial data.
- How do comments link to their note?
- Every comment record has a post_id field pointing at its note.
- How is the data collected? Is this the official Xiaohongshu API?
- By web crawlers, from content publicly published on Xiaohongshu. LargitData is not affiliated with Xiaohongshu and this is not Xiaohongshu's own API. Whether this suits your use depends on the purpose and jurisdiction and is for your legal team to assess; we can provide a description of sources and collection methods.