# Xiaohongshu Comments Scraper - RedNote Nested Reply Threads (`sian.agency/xiaohongshu-rednote-comments-scraper`) Actor

Scrape every comment and every nested reply from any Xiaohongshu (RedNote) note. Paste note URLs, share links or 24-character note IDs. One flat row per comment and per reply, carrying the thread linkage, author, avatar, IP city, likes and attached pictures.

- **URL**: https://apify.com/sian.agency/xiaohongshu-rednote-comments-scraper.md
- **Developed by:** [SIÁN OÜ](https://apify.com/sian.agency) (community)
- **Categories:** Social media, AI, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.90 / 1,000 comments

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Xiaohongshu Comments Scraper — RedNote Replies, Authors & IP City 💬

[![SIÁN Agency Store](https://img.shields.io/badge/Store-SI%C3%81N%20Agency-1AE392)](https://apify.com/sian.agency?fpr=sian) [![Xiaohongshu Scraper](https://img.shields.io/badge/Store-Xiaohongshu%20Notes%20%26%20Search-FF2442)](https://apify.com/sian.agency/xiaohongshu-rednote-scraper?fpr=sian) [![Xiaohongshu KOL Analytics](https://img.shields.io/badge/Store-Xiaohongshu%20KOL%20Analytics-FF2442)](https://apify.com/sian.agency/xiaohongshu-kol-analytics?fpr=sian) [![Weibo Scraper](https://img.shields.io/badge/Store-Weibo%20Scraper-E6162D)](https://apify.com/sian.agency/weibo-scraper?fpr=sian)

#### 🎉 One flat row per comment **and** per reply — with the thread linkage on the row

##### Built for anyone who has tried to open a nested `replies[]` array in a spreadsheet

***

### 🔎 What is the Xiaohongshu Comments Scraper — and when should you use it?

The **Xiaohongshu Comments Scraper** turns Every comment and nested reply under any Xiaohongshu (RedNote) note into clean, structured rows you can filter, export and feed straight into a spreadsheet, database or AI agent. No account, no portal API key, no browser automation to maintain.

**Use it when you need:** the comment thread under a specific RedNote note, in the original Chinese, with one flat row per comment and per reply. Each row names the thread root, the exact comment being answered and that comment's author. Alongside that sit the commenter's display name, Xiaohongshu ID, public Red ID, avatar, profile link and like count. The IP city RedNote publishes beside a comment comes through where it is published, as do any full-size attached pictures, @-mentions and hashtags. Three booleans decoded from the platform's own tag array say whether the note's author wrote the comment, whether they liked it, and whether it is pinned.

**Use something else when:** you want the notes themselves rather than the conversation under them. Use [Xiaohongshu Scraper - Notes, Users & Search](https://apify.com/sian.agency/xiaohongshu-rednote-scraper?fpr=sian) for note details, creator profiles, a creator's full published back catalogue, and keyword search across notes and users. Use [Xiaohongshu KOL Analytics](https://apify.com/sian.agency/xiaohongshu-kol-analytics?fpr=sian) for creator-marketplace numbers for a RedNote KOL: audience profile, cost-effectiveness and content tags. This actor reads comment threads on Xiaohongshu only, and only on notes that are publicly visible.

### 🤖 Use with AI agents

Already connected to the [Apify MCP server](https://mcp.apify.com)? Just ask for this Actor by name: sian.agency/xiaohongshu-rednote-comments-scraper

**Your agent can pay for its own runs.** This Actor is eligible for [agentic payments](https://docs.apify.com/platform/actors/publishing/monetize), so an agent can discover it, run it and settle the bill over [x402](https://www.x402.org/) (USDC on Base) or [Skyfire](https://www.skyfire.xyz/) — without an Apify account or API token of its own. Billing is the same either way: per successful row, never for errors.

Otherwise copy this prompt into Claude, ChatGPT, Cursor or any MCP-enabled assistant:

```text
I want the comment and reply threads under specific Xiaohongshu (RedNote) notes using the Apify Actor `sian.agency/xiaohongshu-rednote-comments-scraper`.

Use it when I need: the comment thread under a specific RedNote note, in the original Chinese, with one flat row per comment and per reply. Each row names the thread root, the exact comment being answered and that comment's author. Alongside that sit the commenter's display name, Xiaohongshu ID, public Red ID, avatar, profile link and like count. The IP city RedNote publishes beside a comment comes through where it is published, as do any full-size attached pictures, @-mentions and hashtags. Three booleans decoded from the platform's own tag array say whether the note's author wrote the comment, whether they liked it, and whether it is pinned.

Don't use it when: you want the notes themselves rather than the conversation under them — use xiaohongshu-rednote-scraper or xiaohongshu-kol-analytics instead.

How to call it: put one or more note references in `noteUrls` — a browser URL (`https://www.xiaohongshu.com/explore/...` or `/discovery/item/...`), an `xhslink.com` share link copied from the phone app, or a bare 24-character note ID, mixed freely in one list; set `sortBy` to `latest` for newest-first or `normal` for RedNote's own ranking; leave `includeReplies` on to get every reply as its own row and raise `maxRepliesPerComment` to 0 for whole threads; bound the spend with `maxCommentsPerNote` (top-level comments per note, 0 for all) and `maxResults` (the hard row ceiling for the run). There is no like-count sort: the source accepts one and then ignores it, so sort on the `likeCount` column after export instead.

Start with this input:
{
  "noteUrls": [
    "https://www.xiaohongshu.com/explore/6a79fb020000000027023c9c"
  ],
  "sortBy": "latest",
  "includeReplies": true,
  "maxRepliesPerComment": 20,
  "maxCommentsPerNote": 100,
  "maxResults": 1000
}

Ask me which note links to read, and whether reply threads should be included or only the top-level comments, then run the Actor and summarise the results as a table.
```

**Things you can ask your agent for:**

- *Pull every comment on these five competitor launch notes and group the complaints by theme.*
- *Find the comments the creator replied to herself, and show me what she said back.*
- *Rebuild the longest reply thread on this note in order, so I can read the argument end to end.*

Machine-readable API, MCP config and OpenAPI definition for this Actor are published at [apify.com/sian.agency/xiaohongshu-rednote-comments-scraper.md](https://apify.com/sian.agency/xiaohongshu-rednote-comments-scraper.md).

### 📋 Overview

**Comment threads are where Chinese consumers say what they actually think.** A RedNote note is a polished post. The 300 comments underneath it are a focus group nobody moderated, and this Actor exports all of them.

**What you get:**

- ✅ **Flat rows, not nested arrays**: every reply is its own row carrying `parentCommentId`, `replyToCommentId` and `replyToAuthorName`. Open the CSV in Sheets and it just works.
- 🧵 **Reply threads that go deep**: set `maxRepliesPerComment` to 0 and a 200-reply argument comes back whole, page by page, with no duplicates.
- 🎯 **Signals the platform buries**: whether the note's author wrote the comment, whether they liked it, whether it is pinned. Three booleans, decoded from a tag array most tools hand back raw or discard.
- 💰 **Charged per row returned**: a note with no comments costs you nothing. Turn replies off and the reply charge never fires.
- 📍 **IP city where RedNote publishes it**: the province or city shown beside the comment, filled whenever the commenter's settings allow it.
- 🖼️ **Comment pictures at full size**: unboxing shots and defect photos come through as image URLs, not thumbnails.

***

### ✨ Features

- 🔗 **Three input formats**: browser URL, xhslink share link from the phone app, or a bare 24-character note ID. Mix them in one list.
- 🧵 **Nested reply expansion**: replies are fetched thread by thread and flattened, so a conversation rebuilds with a single group-by.
- ↩️ **Reply-to attribution**: inside a long thread, a reply usually answers another reply rather than the root. Both links are on the row.
- 🔀 **Two comment orders**: newest-first for monitoring, or the ranking RedNote itself shows.
- 📌 **Pinned, author-written and author-liked flags** as plain booleans.
- 🏷️ **@-mentions and hashtags** split out of the comment text into their own arrays.
- 👤 **Full author block**: display name, Xiaohongshu ID, public Red ID, avatar and a direct profile link.
- 📊 **Thread totals on every row**: how many comments the note has in all, and how many are top-level, so you can tell what a capped run left behind.
- 🛑 **Two spend caps**: per note and per run, both set before anything is fetched.
- 🚫 **No login, cookies or API key** anywhere in the process.

***

### 🎬 Quick Start

Paste one or more note links, press Start, and read the dataset. Everything else has a working default, so a first run needs exactly one field. Results land as JSON, CSV or Excel.

```bash
curl -X POST "https://api.apify.com/v2/acts/sian.agency~xiaohongshu-rednote-comments-scraper/runs?token=YOUR_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"noteUrls": ["https://www.xiaohongshu.com/explore/6a79fb020000000027023c9c"]}'
```

***

### 🚀 Getting Started (3 Simple Steps)

#### Step 1: Copy the note link

Open the note in a browser and copy the address bar, or hit Share in the app and copy the `xhslink.com` link. Both work.

#### Step 2: Paste it into Note URLs

Add as many notes as you like. Use Bulk edit to paste a whole list, one per line.

#### Step 3: Press Start

Leave the rest alone for a first run, or set `maxRepliesPerComment` to 0 if you want every reply of every thread.

**That's it. Within a minute or two you'll have:**

- Every top-level comment, newest first
- Every reply, linked to the comment it answers
- Authors, avatars, IP cities, likes and any attached pictures

***

### 📥 Input Configuration

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `noteUrls` | array | No | Note URLs, xhslink share links or 24-character note IDs |
| `sortBy` | string | No | `latest` (newest first) or `normal` (RedNote's own ranking) |
| `includeReplies` | boolean | No | Fetch reply threads. On by default |
| `maxRepliesPerComment` | integer | No | Replies per thread. `0` takes every reply |
| `maxCommentsPerNote` | integer | No | Top-level comments per note. `0` takes the whole thread |
| `maxResults` | integer | No | Hard ceiling on rows for the whole run |

**Example:**

```json
{
  "noteUrls": ["https://www.xiaohongshu.com/explore/6a79fb020000000027023c9c"]
}
```

**Several notes, every reply, capped spend:**

```json
{
  "noteUrls": [
    "https://www.xiaohongshu.com/explore/6a79fb020000000027023c9c",
    "http://xhslink.com/a/EXAMPLE",
    "69ec85eb000000001e00cd6c"
  ],
  "sortBy": "latest",
  "includeReplies": true,
  "maxRepliesPerComment": 0,
  "maxCommentsPerNote": 0,
  "maxResults": 5000
}
```

**Top-level comments only, cheapest mode:**

```json
{
  "noteUrls": ["6a79fb020000000027023c9c"],
  "includeReplies": false,
  "maxCommentsPerNote": 200
}
```

***

### 📤 Output

One row per comment and one row per reply, with **30+ fields** on each:

| Field | Type | Description |
|-------|------|-------------|
| `commentId` | string | The comment's own ID |
| `content` | string | What was written, in the original Chinese |
| `likeCount` | integer | Likes on this comment or reply |
| `ipLocation` | string | Province or city RedNote shows, where published |
| `postedAt` | string | ISO timestamp, UTC |
| `isReply` | boolean | True for a reply row |
| `parentCommentId` | string | The thread root — group on this |
| `replyToCommentId` | string | The exact comment being answered |
| `replyToAuthorName` | string | Who is being answered |
| `replyCount` | integer | Replies under a top-level comment |
| `authorName` | string | Who wrote it |
| `authorRedId` | string | Their public Red ID |
| `authorAvatarUrl` | string | Profile picture |
| `authorProfileUrl` | string | Direct link to their profile |
| `authorIsNoteAuthor` | boolean | The creator answering their own audience |
| `likedByNoteAuthor` | boolean | The creator liked this comment |
| `isPinned` | boolean | Pinned to the top of the thread |
| `pictureUrls` | array | Full-size images attached to the comment |
| `mentionedUsers` | array | Accounts tagged in the text |
| `hashtags` | array | Topic tags used in the text |
| `noteCommentTotal` | integer | Comments on the note in total |

**Example — a reply:**

```json
{
  "commentId": "6a956f660000000015010a98",
  "content": "为啥我一搜都是一百多的",
  "likeCount": 0,
  "postedAt": "2026-08-31T12:11:18.000Z",
  "ipLocation": "河南",
  "isReply": true,
  "parentCommentId": "6a9534a200000000020121e3",
  "replyToCommentId": "6a9534a200000000020121e3",
  "replyToAuthorName": "优雅的不纳拿",
  "authorName": "巫师Qiya",
  "authorRedId": "63611470514",
  "authorProfileUrl": "https://www.xiaohongshu.com/user/profile/aba20d57cda73d0896d49573b7ed3",
  "authorIsNoteAuthor": false,
  "likedByNoteAuthor": false,
  "isPinned": false,
  "pictureCount": 0,
  "hashtags": [],
  "noteId": "6a79fb020000000027023c9c",
  "noteUrl": "https://www.xiaohongshu.com/explore/6a79fb020000000027023c9c",
  "noteCommentTotal": 330,
  "status": "success"
}
```

***

### 💼 Use Cases & Examples

#### 1. China market entry research

**A brand manager wants to know how Chinese consumers actually talk about a product category before committing to a launch.**

**Input:** the twenty most-engaged notes in the category
**Output:** several thousand comments and replies, with IP city where published
**Use:** an unmoderated focus group, in the customer's own words, for a fraction of what an agency panel costs

#### 2. Brand and campaign monitoring

**An agency runs a KOL campaign and needs to know what happened underneath each sponsored note.**

**Input:** the campaign's note links, on a daily schedule
**Output:** every comment and reply, with pinned and author-liked flags
**Use:** the flags reveal which reactions the creator chose to amplify. That is a different signal from raw like counts, and one no screenshot gives you

#### 3. Training data for Chinese-language models

**An ML team needs conversational Chinese with real turn-taking, not scraped articles.**

**Input:** a list of high-comment notes across topics
**Output:** rows where every reply names the comment it answers and that comment's author
**Use:** dialogue trees rebuild without guessing who was talking to whom

#### 4. Competitor product research

**A product team wants the complaints under a competitor's launch posts.**

**Input:** the competitor's note links
**Output:** comment text plus full-size attached pictures
**Use:** defect photos, side-by-side comparisons and unboxing shots come through as image URLs instead of being lost with the rest of the payload

#### 5. Community management and moderation review

**A creator or brand needs a record of everything said under their own notes.**

**Input:** their own note links
**Output:** the complete thread, replies included
**Use:** audit what was said, spot spam patterns in the mention and hashtag columns, and keep an export the RedNote interface will not give you

#### 6. KOL vetting before a partnership

**A media buyer wants to know whether a creator's audience is real and engaged.**

**Input:** several notes from the creator under review
**Output:** comment authors, their Red IDs, IP cities and like distribution
**Use:** a thread of one-word comments from accounts with no history reads very differently from a genuine discussion

***

### 🔗 Integration Examples

#### JavaScript/Node.js

```javascript
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_TOKEN' });

const run = await client.actor('sian.agency/xiaohongshu-rednote-comments-scraper').call({
  noteUrls: ['https://www.xiaohongshu.com/explore/6a79fb020000000027023c9c'],
  includeReplies: true,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();

// Rebuild one thread
const threads = {};
for (const row of items) {
  const key = row.parentCommentId || row.commentId;
  (threads[key] ??= []).push(row);
}
```

#### Python

```python
from apify_client import ApifyClient
client = ApifyClient('YOUR_TOKEN')

run = client.actor('sian.agency/xiaohongshu-rednote-comments-scraper').call(
    run_input={
        'noteUrls': ['https://www.xiaohongshu.com/explore/6a79fb020000000027023c9c'],
        'includeReplies': True,
    }
)

for item in client.dataset(run['defaultDatasetId']).iterate_items():
    prefix = '    ↳ ' if item.get('isReply') else ''
    print(prefix, item['authorName'], item['content'])
```

#### cURL

```bash
curl -X POST 'https://api.apify.com/v2/acts/sian.agency~xiaohongshu-rednote-comments-scraper/runs?token=YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"noteUrls": ["https://www.xiaohongshu.com/explore/6a79fb020000000027023c9c"]}'
```

#### Automation Workflows (N8N / Zapier / Make)

1. **Trigger**: a schedule, or a webhook when a new campaign note goes live
2. **HTTP Request**: call the Actor with the note links
3. **Process**: filter on `isReply`, or group on `parentCommentId`
4. **Action**: push to a sentiment model, a warehouse, or a Slack digest

***

### 📊 Performance & Pricing

#### FREE Tier (Try It Now)

- **10 rows** per run — every field, same quality, no credit card
- Enough to see the thread linkage working on a real note before you commit

#### PAID Tier (Production Ready)

- **Unlimited** rows per run, across as many notes as you like
- Charged per row returned: a note with no comments costs nothing, and error rows are never billed
- Replies are billed separately from comments, so switching them off genuinely lowers the bill

💰 **Priced under the category leader on every paid tier** — $0.0058 per comment against their $0.00599, and $0.0049 against their $0.00499 floor. The row you get back also needs less work before it is usable.

🔗 [View current pricing](https://apify.com/sian.agency/xiaohongshu-rednote-comments-scraper?fpr=sian)

***

### ❓ Frequently Asked Questions

**Q: Are replies nested inside the comment, or separate rows?**
A: Separate rows. Each one carries `isReply: true`, a `parentCommentId` pointing at the thread root and a `replyToCommentId` pointing at the comment it actually answers. Group on `parentCommentId` to rebuild a thread. Nested arrays are the common approach and they turn into `replies/0/content`, `replies/1/content` columns the moment you export to CSV.

**Q: Does every comment have an IP city?**
A: No. RedNote shows it only where the commenter's own settings publish it. Checked on two live notes the same afternoon, one returned an IP city on all 10 comments of a page, the other on 1 of 25. The column is always there and is filled whenever the data is.

**Q: Can I sort comments by like count?**
A: Not honestly, so it is not offered. The source accepts a like-count sort and then returns default order regardless. The response even reports which ranking it fell back to. Rather than ship a control that quietly does nothing, you get newest-first and RedNote's own default. Sort on the `likeCount` column after export.

**Q: How many comments can I pull from one note?**
A: All of them. Comment pages are walked until the source says there are no more, and reply threads paginate the same way. The caps exist so you can bound the spend; set them to 0 and raise `maxResults` to take everything.

**Q: Which link formats work?**
A: A browser URL (`/explore/...` or `/discovery/item/...`), an `xhslink.com` share link from the app, or a bare 24-character note ID. A creator profile link will be rejected before anything is charged, because it points at a person and not a note.

**Q: Do I need a login, cookies or an API key?**
A: No. Paste links and press Start.

**Q: Will I get sentiment scores or English translations?**
A: No. You get the comment text exactly as written, in Chinese. Any tool offering a sentiment column here is generating it, not collecting it. Run the `content` column through your own model and you keep control of how it was scored.

**Q: What happens if a note has been deleted?**
A: It comes back as an error row explaining why, and it is not charged. The rest of your notes carry on.

***

### 🐛 Troubleshooting

**A note returned zero rows**

- Open the link in a browser. If the note is gone or has been made private, there is nothing to collect and you were not charged.
- If you can see comments in the browser but not here, send us the link on Telegram.

**"That does not look like a Xiaohongshu note reference"**

- The link points at a profile, a search page or a topic page rather than one note.
- Copy the address while the note itself is open.

**A share link failed**

- Share links expire. Open it once in a browser, then copy the `www.xiaohongshu.com` address it lands on.

**Fewer replies than the note shows**

- `maxRepliesPerComment` defaults to 20. Set it to 0 for the whole thread.
- Check `maxResults` too — it stops the run across all notes, replies included.

**The run stopped early on a free plan**

- The FREE tier returns 10 rows per run. Add credits or a payment method to lift it.

***

### ⚠️ Trademark Disclaimer

Xiaohongshu, RedNote and 小红书 are trademarks of Xingin Information Technology Co., Ltd. This tool is not affiliated with, endorsed by or sponsored by Xiaohongshu, and collects only publicly visible comments.

***

### ⚖️ Is it legal to scrape data?

Our actors are ethical and do not extract any private user data, such as email addresses, gender, or location. They only extract what the user has chosen to share publicly. We therefore believe that our actors, when used for ethical purposes by Apify users, are safe.

However, you should be aware that your results could contain personal data. Personal data is protected by the **GDPR** in the European Union and by other regulations around the world. You should not scrape personal data unless you have a legitimate reason to do so. If you're unsure whether your reason is legitimate, consult your lawyers.

You can also read Apify's blog post on the [legality of web scraping](https://blog.apify.com/is-web-scraping-legal/).

***

### 🤝 Support

[![Telegram Support](https://img.shields.io/badge/Telegram-Support%20Group-0088cc?logo=telegram)](https://t.me/+vyh1sRE08sAxMGRi)

**Join our active support community**

- For issues or questions, open an issue on the Actor's Issues tab
- Check [SIÁN Agency Store](https://apify.com/sian.agency?fpr=sian) for more automation tools
- 📧 <apify@sian-agency.online>

***

**Built by [SIÁN Agency](https://www.sian-agency.online)** | **[More Tools](https://apify.com/sian.agency?fpr=sian)**

# Actor input Schema

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

🔗 **WHICH NOTES:** the comment threads you want. Add as many as you like.

✅ **Three formats, mixable in one list:**

- Browser URL — `https://www.xiaohongshu.com/explore/6a79fb02...`
- Share link from the app — `http://xhslink.com/...`
- Bare 24-character note ID

🚫 **Not a note:** a creator profile, a search page or a topic page.

💡 **TIP:** Bulk edit takes a list, one per line. Duplicates are dropped before anything is fetched, so you never pay twice for one note.

## `sortBy` (type: `string`):

🔀 **ORDER:** which way to walk the comment pages.

- **Latest first** — newest comments at the top. Use this to monitor a live note.
- **Default order** — the ranking Xiaohongshu itself shows, which surfaces what the platform considers most relevant.

ℹ️ There is no sort-by-likes option: the data source accepts one and then returns default order anyway. Rather than give you a control that quietly does nothing, sort on the `likeCount` column after export.

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

💬 **REPLY THREADS:** on by default.

Every reply becomes its own row, linked to the comment it sits under (`parentCommentId`) and to the exact comment it answers (`replyToCommentId`, `replyToAuthorName`). Group on `parentCommentId` to rebuild a thread.

💰 Replies are billed separately from comments, and a little higher, because a reply thread is fetched one thread at a time. Turn this off to collect top-level comments only — faster and cheaper.

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

↩️ **THREAD DEPTH:** how far down a single reply thread to go.

Set **0 to take every reply**, however long the thread runs. Most threads are short — roughly three quarters of comments have no replies at all — so this only bites on the handful of viral comments that collect dozens of answers.

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

🔢 **PER NOTE:** top-level comments to collect from each note. Replies do not count against it.

Set **0 to take the whole thread**. Keeping the cap per note rather than per run means one viral note cannot eat the entire budget of a multi-note run.

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

🛑 **RUN CEILING:** the hard limit on everything this run returns — comments and replies together — and therefore the ceiling on what it can charge. The run stops the moment it is reached.

💡 This is the one knob to reach for when you want a predictable bill.

## Actor input object example

```json
{
  "noteUrls": [
    "https://www.xiaohongshu.com/explore/6a79fb020000000027023c9c"
  ],
  "sortBy": "latest",
  "includeReplies": true,
  "maxRepliesPerComment": 20,
  "maxCommentsPerNote": 100,
  "maxResults": 1000
}
```

# Actor output Schema

## `xiaohongshuComments` (type: `string`):

Every comment and reply this run returned, with the thread linkage on each row.

## `scrapingSummary` (type: `string`):

HTML summary showing successful and failed results with key metrics

# 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/6a79fb020000000027023c9c",
        "https://www.xiaohongshu.com/explore/69ec85eb000000001e00cd6c"
    ],
    "sortBy": "latest",
    "includeReplies": true,
    "maxRepliesPerComment": 20,
    "maxCommentsPerNote": 100,
    "maxResults": 1000
};

// Run the Actor and wait for it to finish
const run = await client.actor("sian.agency/xiaohongshu-rednote-comments-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/6a79fb020000000027023c9c",
        "https://www.xiaohongshu.com/explore/69ec85eb000000001e00cd6c",
    ],
    "sortBy": "latest",
    "includeReplies": True,
    "maxRepliesPerComment": 20,
    "maxCommentsPerNote": 100,
    "maxResults": 1000,
}

# Run the Actor and wait for it to finish
run = client.actor("sian.agency/xiaohongshu-rednote-comments-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/6a79fb020000000027023c9c",
    "https://www.xiaohongshu.com/explore/69ec85eb000000001e00cd6c"
  ],
  "sortBy": "latest",
  "includeReplies": true,
  "maxRepliesPerComment": 20,
  "maxCommentsPerNote": 100,
  "maxResults": 1000
}' |
apify call sian.agency/xiaohongshu-rednote-comments-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,sian.agency/xiaohongshu-rednote-comments-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/qYy00epkywTwmXiPG/builds/B3BEvUSaDp1fp36F9/openapi.json
