# Xiaohongshu Comments and Reply Threads Scraper (`automation-lab/xiaohongshu-comments-reply-threads-scraper`) Actor

Extract Xiaohongshu (RedNote) comments and the replies shown under them from note URLs, share links or IDs: text, author, likes, time, IP region, pictures, parent/reply links and incomplete-thread flags. No login.

- **URL**: https://apify.com/automation-lab/xiaohongshu-comments-reply-threads-scraper.md
- **Developed by:** [Automation Lab](https://apify.com/automation-lab) (community)
- **Categories:** Social media, Marketing
- **Features:** Limited permissions
- **Stats:** 6 total users, 2 monthly users, 93.9% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.16 / 1,000 comment or replies

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Xiaohongshu Comments and Reply Threads Scraper

**Collect every comment on a Xiaohongshu (小红书 / RedNote) note — with the replies Xiaohongshu shows under each one — from a note link, an xhslink.com share link or a bare note ID.** Each comment and reply becomes its own row with text, author, likes, posting time, IP region, attached pictures, @-mentions and clean parent/reply links. No login, no cookies and no `xsec_token` needed.

Built for consumer-insight, brand and China-market teams who need what real users say under product reviews, launches and creator posts — in a flat table that loads straight into a spreadsheet, BI tool or sentiment model.

### What does Xiaohongshu Comments and Reply Threads Scraper do?

You paste one or more Xiaohongshu notes. The Actor opens Xiaohongshu's public mobile website anonymously, reads the note's comment feed page by page (20 top-level comments per page) until the end of the thread or your limit, and saves:

- 💬 **Every top-level comment** of the note, in the order Xiaohongshu serves them.
- ↩️ **Replies as their own rows** — the replies Xiaohongshu shows under each comment (up to 3), linked to their thread with `parentId`, `rootCommentId` and `replyToId`.
- 🧵 **Thread completeness** — every comment row has the true `replyCount`, the number of replies saved and a `repliesIncomplete` flag, so you always know which threads have more replies than were collected.
- 👤 **Author details** — public user ID, nickname, avatar, profile link and Xiaohongshu's AI-agent flag.
- ❤️ **Likes** as a number (display values such as `1.2万` are converted) and exactly as shown.
- 📍 **IP region** — the province or country Xiaohongshu shows next to each comment.
- 🖼 **Pictures and mentions** — original-size links of images attached to comments, and every @-mentioned user.

### Who is it for?

| Who | What they use Xiaohongshu comments for |
|---|---|
| Consumer insight and CX teams | Product feedback, complaints and feature requests under review notes |
| Brand and social listening teams | Reactions to launches, campaigns and KOL posts, by region |
| China market researchers | Unfiltered opinions grouped by the commenter's province |
| Influencer and agency managers | Whether a sponsored post's comments are real engagement |
| Data scientists | Chinese-language comment datasets for sentiment, topic and intent models |

### Why use this scraper?

- **No account needed.** It reads the public mobile comment feed anonymously, so you never risk your own Xiaohongshu account and never paste cookies.
- **Any link format.** Full note URLs (with or without `xsec_token`), `/discovery/item/` links, `xhslink.com` share links, the whole share text copied from the app, or a bare 24-character ID.
- **Analysis-ready threads.** Normalized parent/child rows with a stable `threadKey` (`noteId:rootCommentId`) and stable comment IDs — easy to join, deduplicate and load incrementally on a schedule.
- **Honest completeness.** Incomplete threads are flagged instead of silently cut, and a per-note `RUN_SUMMARY` tells you why each note stopped.
- **Fast and cheap to run.** A 400-comment viral note finishes in well under a minute.

### What data can you extract from Xiaohongshu comments?

| Field | Description |
|---|---|
| `recordType` | `comment` (top-level) or `reply` |
| `noteId`, `noteUrl` | The note the comment belongs to |
| `commentId` | Stable ID of this comment or reply |
| `rootCommentId`, `parentId` | Top-level comment of the thread; `parentId` is null on comment rows |
| `replyToId`, `replyToUserId`, `replyToNickname` | Which comment or reply a reply answers, and its author |
| `threadKey`, `position` | `noteId:rootCommentId` and the order within the note or thread |
| `text` | Comment text, including Xiaohongshu emoji codes such as `[笑哭R]` |
| `authorId`, `authorNickname`, `authorAvatarUrl`, `authorProfileUrl`, `authorIsAiAgent` | Public author details |
| `createdAt`, `createdAtTimestamp` | Posting time (ISO 8601 UTC and Unix ms) |
| `likeCount`, `likeCountText` | Likes as a number and as displayed |
| `ipLocation` | Region shown by Xiaohongshu (Chinese), e.g. `广东`, `美国` |
| `pictures` | Original-size image URLs attached to the comment |
| `mentions` | @-mentioned users: `userId`, `nickname`, `profileUrl` |
| `replyCount`, `repliesReturned`, `repliesIncomplete` | True reply total, replies saved, and whether more exist |
| `noteCommentCount`, `noteTopLevelCommentCount` | Totals Xiaohongshu reports for the note |
| `scrapedAt` | Collection time |

### How much does it cost to scrape Xiaohongshu comments?

This Actor uses pay-per-event pricing: a small fee when a run starts plus a fee for each saved row (each top-level comment and each reply is one row). You only pay for rows you get.

| Event | Free plan | Bronze | Silver | Gold and above |
|---|---:|---:|---:|---:|
| Run start (once per run) | $0.005 | $0.005 | $0.005 | $0.005 |
| Comment or reply row | $0.0041354 | $0.003596 | $0.0028049 | $0.0021576 |

Examples at Bronze prices:

- **100 rows** (one typical note): $0.005 + 100 × $0.003596 ≈ **$0.37**
- **1,000 rows** (a few busy notes): ≈ **$3.60**
- **10,000 rows** (a scheduled brand watch): ≈ **$35.97**

Notes with no comments, invalid inputs and failed notes produce no rows and cost nothing beyond the run start. Use **Max rows in total** to cap spend per run; Apify's maximum cost per run setting is also respected. When the maximum cost is reached mid-thread, the last comment keeps only the replies that fit, its `repliesReturned`/`repliesIncomplete` match what was saved, and notes not reached are listed as `not-attempted` in `RUN_SUMMARY`.

### How to scrape Xiaohongshu comments

1. Open the Actor and paste your notes into **Note URLs, share links or IDs** — one per line.
2. Set **Max top-level comments per note** (0 reads the whole thread).
3. Keep **Include replies** on if you want reply rows, and choose how many (1–3) per comment.
4. Optionally set **Max rows in total** as a budget cap.
5. Click **Start**. Download the results as JSON, CSV, Excel or XML, or read them through the API.

### Input

| Field | Type | Default | What it does |
|---|---|---|---|
| `noteUrls` | array of strings | — | Note URLs, xhslink.com share links, share text, or 24-character note IDs. Duplicates are read once. |
| `maxCommentsPerNote` | integer | 100 | Top-level comments per note; replies are not counted. `0` = all. |
| `includeReplies` | boolean | true | Save the replies shown under each comment as separate rows. |
| `maxRepliesPerComment` | integer 1–3 | 3 | Replies to keep per comment when replies are on. |
| `maxResults` | integer | 1000 | Total rows (comments + replies) across all notes. |
| `proxyConfiguration` | object | off | Optional Apify Proxy; not needed normally. |

Example input:

```json
{
  "noteUrls": [
    "https://www.xiaohongshu.com/explore/6ae45c88000000001200dd79",
    "http://xhslink.com/o/1jhV61MlNNc",
    "69db721a00000000220290a8"
  ],
  "maxCommentsPerNote": 0,
  "includeReplies": true,
  "maxRepliesPerComment": 3,
  "maxResults": 2000
}
```

### Output example

A top-level comment and the reply under it (real rows from a test run):

```json
[
  {
    "recordType": "comment",
    "noteId": "6ae45c88000000001200dd79",
    "noteUrl": "https://www.xiaohongshu.com/explore/6ae45c88000000001200dd79",
    "commentId": "6ae5c0d400000000010097a0",
    "rootCommentId": "6ae5c0d400000000010097a0",
    "parentId": null,
    "replyToId": null,
    "replyToUserId": null,
    "replyToNickname": null,
    "threadKey": "6ae45c88000000001200dd79:6ae5c0d400000000010097a0",
    "position": 1,
    "text": "很有气质！一看就是hin有💰的贵妇[喝奶茶R]",
    "authorId": "5f44f1c000000000010072a2",
    "authorNickname": "婷婷玉玉",
    "authorAvatarUrl": "https://sns-avatar-qc.xhscdn.com/avatar/1040g2jo31lofva905m605nq4u7008sl241talug?imageView2/2/w/120/format/jpg",
    "authorProfileUrl": "https://www.xiaohongshu.com/user/profile/5f44f1c000000000010072a2",
    "authorIsAiAgent": false,
    "createdAt": "2026-10-31T10:20:05.000Z",
    "createdAtTimestamp": 1793442005000,
    "likeCount": 0,
    "likeCountText": "0",
    "ipLocation": "广东",
    "pictures": [],
    "mentions": [],
    "replyCount": 1,
    "repliesReturned": 1,
    "repliesIncomplete": false,
    "noteCommentCount": 50,
    "noteTopLevelCommentCount": 41,
    "scrapedAt": "2026-11-01T07:15:23.542Z"
  },
  {
    "recordType": "reply",
    "noteId": "6ae45c88000000001200dd79",
    "noteUrl": "https://www.xiaohongshu.com/explore/6ae45c88000000001200dd79",
    "commentId": "6ae5c9880000000014002186",
    "rootCommentId": "6ae5c0d400000000010097a0",
    "parentId": "6ae5c0d400000000010097a0",
    "replyToId": "6ae5c0d400000000010097a0",
    "replyToUserId": "5f44f1c000000000010072a2",
    "replyToNickname": "婷婷玉玉",
    "threadKey": "6ae45c88000000001200dd79:6ae5c0d400000000010097a0",
    "position": 1,
    "text": "哈哈哈哈哈哈哈哈笑鼠 看来这个项链很衬人！",
    "authorId": "62b982a000000000190297d8",
    "authorNickname": "月亮不亮",
    "authorAvatarUrl": "https://sns-avatar-qc.xhscdn.com/avatar/1040g2jo317tnnckugq005olpgag6d5uours7r3o?imageView2/2/w/120/format/jpg",
    "authorProfileUrl": "https://www.xiaohongshu.com/user/profile/62b982a000000000190297d8",
    "authorIsAiAgent": false,
    "createdAt": "2026-10-31T10:57:13.000Z",
    "createdAtTimestamp": 1793444233000,
    "likeCount": 0,
    "likeCountText": "0",
    "ipLocation": "浙江",
    "pictures": [],
    "mentions": [],
    "replyCount": null,
    "repliesReturned": null,
    "repliesIncomplete": false,
    "noteCommentCount": 50,
    "noteTopLevelCommentCount": 41,
    "scrapedAt": "2026-11-01T07:15:23.542Z"
  }
]
```

The run's key-value store also holds `RUN_SUMMARY`: for every distinct input (duplicates of the same note are listed once), the resolved note ID, status, comments and replies saved, the note's totals and why it stopped.

| `status` | Meaning |
|---|---|
| `ok` | Comments were read until the thread ended or a cap was reached (see `stoppedBy`) |
| `no-comments` | Xiaohongshu returned an empty feed for the note |
| `incomplete` | Xiaohongshu said more comments exist but its feed stopped advancing; the saved rows are kept and `error` explains what happened |
| `not-attempted` | The run stopped before reaching this note (`stoppedBy` gives the reason); run it again to collect it |
| `invalid-input` | The line was not a note link or ID |
| `failed` | The note could not be read; `error` has the reason |

`stoppedBy` is one of `end-of-thread`, `maxCommentsPerNote`, `maxResults` (your row cap), `maxTotalChargeUsd` (the run's maximum cost was reached), `upstream-stalled` or `session-exhausted` (Xiaohongshu kept refusing the anonymous session).

### Tips and limits

- **Replies:** Xiaohongshu's public mobile page shows at most 3 replies under each comment. Full reply threads need a logged-in account, which this Actor never uses. Use `replyCount` and `repliesIncomplete` to see where more replies exist.
- **Order:** top-level comments come in the order Xiaohongshu's mobile page serves them (pinned and popular comments first, then newer ones). There is no sort option.
- **Empty notes:** a note with no comments, a deleted or private note, and a mistyped ID all return zero rows and are marked `no-comments` in `RUN_SUMMARY`.
- **Invalid lines** (not a note link or ID) are skipped and listed as `invalid-input`; if no line is usable the run fails with a clear message.
- **Incremental loads:** `commentId` and `threadKey` are stable, so you can upsert rows from repeated runs.
- **IP region** is what Xiaohongshu displays, not a precise location.
- If Xiaohongshu refuses the anonymous session, the Actor retries with a fresh session (and a fresh proxy IP when a proxy is set) before marking the note `failed`.

### Integrations

- **Google Sheets / Excel:** export the dataset as CSV or connect the Google Sheets integration to append new comments after each run.
- **Scheduled brand monitoring:** create a Schedule that runs daily on your watch-list notes and upsert rows by `commentId` in your database.
- **Sentiment and topic analysis:** send the dataset to a webhook, Make, Zapier or n8n flow that runs a Chinese sentiment model on `text` and groups results by `ipLocation`.
- **Data warehouses:** load the JSON into BigQuery, Snowflake or Postgres; use `threadKey` to rebuild conversations.

### Use the Actor through the API

#### cURL

```bash
curl -X POST "https://api.apify.com/v2/acts/automation-lab~xiaohongshu-comments-reply-threads-scraper/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"noteUrls":["6ae45c88000000001200dd79"],"maxCommentsPerNote":50}'
```

#### JavaScript

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('automation-lab/xiaohongshu-comments-reply-threads-scraper').call({
    noteUrls: ['https://www.xiaohongshu.com/explore/6ae45c88000000001200dd79'],
    maxCommentsPerNote: 0,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.filter((row) => row.repliesIncomplete).length, 'threads have more replies');
```

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("automation-lab/xiaohongshu-comments-reply-threads-scraper").call(
    run_input={"noteUrls": ["69db721a00000000220290a8"], "maxCommentsPerNote": 0}
)
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(row["recordType"], row["ipLocation"], row["text"])
```

### Use with AI agents via MCP

Connect the Actor to Claude, Cursor or another MCP client through Apify's hosted MCP server.

Claude Code:

```bash
claude mcp add --transport http apify \
  "https://mcp.apify.com?tools=automation-lab/xiaohongshu-comments-reply-threads-scraper"
```

Claude Desktop, Cursor or VS Code (JSON config):

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=automation-lab/xiaohongshu-comments-reply-threads-scraper"
    }
  }
}
```

Selecting this Actor also adds Apify's run and storage helper tools (`get-actor-run`, `get-dataset-items`, `get-key-value-store-record`, `abort-actor-run`), so the server exposes more than one tool. List the tools first and use only the ones you need. A reliable agent workflow:

1. **Start one run and keep its run ID.** `call-actor` waits at most 45 seconds (`waitSecs`, default 30), so a large note may still be running when it returns. Keep the returned run ID and `defaultDatasetId`; they are metadata, not results.
2. **Follow that same run.** If it is not finished, call `get-actor-run` for the same run ID with short backoff (for example 2, 4, 8, then every 10 seconds) and a fixed overall deadline (for example 120 seconds). Set the client request timeout above the server wait. If the client times out, check the known run instead of starting a new one. At the deadline, report the run as still running with its ID and stop polling. If the run failed, say so. Any rows it saved are a partial result, not a full one.
3. **Read a bounded slice of results.** Call `get-dataset-items` with the dataset ID, `limit: 20`, an `offset` starting at 0, and only the `fields` you need (for example `recordType,commentId,parentId,text,likeCount,ipLocation,repliesIncomplete`). Stop at 100 rows or 64 KiB of serialized JSON in the model's context, whichever comes first. If your client can inspect a response before it reaches the model, drop or summarize an oversized page and say so. If it cannot, do not claim a hard byte limit and keep `limit` small.
4. **Report what you returned.** State how many rows you read, the next `offset` if more exist, and whether the result is partial. For per-note completeness, read the `RUN_SUMMARY` record with `get-key-value-store-record` and pass on any `incomplete`, `not-attempted` or `failed` notes. Keep full exports (CSV, Excel, JSON) in Apify storage or a downstream tool instead of the model's context.

These deadlines and budgets are example choices for an agent, not Apify defaults, and they do not limit what the Actor collects.

Example prompts:

- "Get all comments on this Xiaohongshu note and tell me the top 5 complaints: https://www.xiaohongshu.com/explore/6ae45c88000000001200dd79"
- "Collect comments from these three notes and group them by IP region."
- "Which comment threads on this note have more replies than were collected?"

### Is it legal to scrape Xiaohongshu comments?

This Actor only reads comments that Xiaohongshu shows publicly to anonymous visitors of its mobile website; it does not log in or bypass access controls. Comments contain personal data (nicknames, user IDs, avatars, regions), so make sure you have a legitimate purpose, follow applicable data protection laws such as GDPR and China's PIPL, minimize what you keep, and respect Xiaohongshu's terms. If in doubt, ask your legal team. This Actor is an independent tool and is not affiliated with, endorsed by or sponsored by Xiaohongshu or RedNote. Results are stored only in your own Apify run storage and follow your account's retention settings. Read more in [Apify's guide to the legality of web scraping](https://blog.apify.com/is-web-scraping-legal/).

### Error reporting

Failed runs report sanitized diagnostic input, Actor/build/run IDs and exceptions to our private GlitchTip error tracker so we can fix problems quickly. Secret fields and URL query strings are removed. Reports are kept for 30 days.

### FAQ

**Do I need a Xiaohongshu account, cookies or the xsec_token?**
No. The Actor reads the public mobile comment feed anonymously; a bare note ID is enough.

**Why are there only up to 3 replies per comment?**
That is what Xiaohongshu's public mobile page shows. Every comment row carries the real `replyCount` and a `repliesIncomplete` flag, so you can see where more replies exist.

**My note returned no rows. What happened?**
Check `RUN_SUMMARY`. `no-comments` means Xiaohongshu returned an empty feed — the note has no comments yet, was deleted or made private, or the ID is mistyped. `invalid-input` means the line was not a note link or ID.

**A run failed with "kept refusing the anonymous mobile session". What should I do?**
Xiaohongshu occasionally rejects a session. Run again; if it repeats, turn on Apify Proxy in **Proxy configuration** so each retry gets a fresh IP.

**Can I monitor notes for new comments?**
Yes. Schedule the Actor and upsert rows by `commentId`; new comments get new IDs.

### Related Actors

- [RedNote Xiaohongshu Profile Scraper](https://apify.com/automation-lab/rednote-xiaohongshu-profile-scraper) — public creator profiles and their recent notes; feed its note IDs into this Actor to collect the comments.

# Changelog

This Actor's version history is a separate document: https://apify.com/automation-lab/xiaohongshu-comments-reply-threads-scraper/changelog.md

# Actor input Schema

## `noteUrls` (type: `array`):

One Xiaohongshu (RedNote) note per line. Accepted: a note URL (<code>https://www.xiaohongshu.com/explore/6ae45c88000000001200dd79</code> or <code>/discovery/item/...</code>; <code>xsec_token</code> is not needed), an <code>xhslink.com</code> share link or the share text that contains it, or a bare 24-character note ID. Duplicate notes are read once.

## `maxCommentsPerNote` (type: `integer`):

Stop each note after this many top-level comments, in the order Xiaohongshu serves them on its mobile web page. Reply rows are not counted against this limit. Set to 0 to read every top-level comment the note has.

## `includeReplies` (type: `boolean`):

Also save the replies Xiaohongshu shows under each top-level comment as their own rows, linked to the comment by parentId, rootCommentId and replyToId. Xiaohongshu's public mobile page shows at most 3 replies per comment; every comment row carries the true replyCount and a repliesIncomplete flag when the thread has more replies than were returned.

## `maxRepliesPerComment` (type: `integer`):

How many of the shown replies to keep under each top-level comment (1 to 3). Ignored when Include replies is off.

## `maxResults` (type: `integer`):

Stop the whole run after this many rows (top-level comments plus replies, across all notes). Each row is one billable result. Defaults to 1000 when left empty.

## `proxyConfiguration` (type: `object`):

Not needed by default: Xiaohongshu serves its public mobile comment feed to the Actor's own address. Turn on Apify Proxy only if your runs start getting refused.

## Actor input object example

```json
{
  "noteUrls": [
    "https://www.xiaohongshu.com/explore/6ae45c88000000001200dd79"
  ],
  "maxCommentsPerNote": 20,
  "includeReplies": true,
  "maxRepliesPerComment": 3,
  "maxResults": 20,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

All comment and reply rows with text, author, likes, time, IP region, pictures and reply completeness.

## `threads` (type: `string`):

The same rows reduced to thread structure: thread key, record type, position, parent and reply-to links.

## `summary` (type: `string`):

Per-note status (ok, no-comments, incomplete, not-attempted, invalid-input, failed), rows saved, note totals and stop reason.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "noteUrls": [
        "https://www.xiaohongshu.com/explore/6ae45c88000000001200dd79"
    ],
    "maxCommentsPerNote": 20,
    "maxResults": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("automation-lab/xiaohongshu-comments-reply-threads-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "noteUrls": ["https://www.xiaohongshu.com/explore/6ae45c88000000001200dd79"],
    "maxCommentsPerNote": 20,
    "maxResults": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("automation-lab/xiaohongshu-comments-reply-threads-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "noteUrls": [
    "https://www.xiaohongshu.com/explore/6ae45c88000000001200dd79"
  ],
  "maxCommentsPerNote": 20,
  "maxResults": 20
}' |
apify call automation-lab/xiaohongshu-comments-reply-threads-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,automation-lab/xiaohongshu-comments-reply-threads-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/4K7ZDeJdlThFFdoIo/builds/SiLgrnjHCuBAxEMLt/openapi.json
