# RedNote (Xiaohongshu) Comments Scraper (`toolzerhub/rednote-xiaohongshu-comments-scraper`) Actor

Collect public comments for a RedNote (Xiaohongshu) post, with an optional switch to include replies under one result limit.

- **URL**: https://apify.com/toolzerhub/rednote-xiaohongshu-comments-scraper.md
- **Developed by:** [ToolzerHub](https://apify.com/toolzerhub) (community)
- **Categories:** Social media, Automation, For creators
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.20 / 1,000 results

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/platform/actors/running/actors-in-store#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

## RedNote (Xiaohongshu) Comments Scraper

Collect public comments from one RedNote or Xiaohongshu post, with optional nested replies and one result cap for the whole run.

### Choose the depth

| Setting | Default | What it changes |
|---|---:|---|
| **`include_replies`** | `false` | When `true`, the Actor opens each returned top-level comment's reply thread. |
| **`comment_sort`** | `latest` | Accepts `default`, `latest`, or `popular`. |
| **`maxItems`** | `100` | Caps comments and replies together. Set `0` to continue until RedNote runs out of pages. |

Replies cost extra requests. The Actor fetches each top-level thread separately, so turning **`include_replies`** on can multiply the work by roughly the number of comment threads. Leave it off for a quick read.

### Run it

Supply either **`post_url`** or **`post_id`**. A recognizable public URL is resolved automatically.

```json
{
  "post_id": "69280b85000000001e00971c",
  "comment_sort": "popular",
  "include_replies": true,
  "maxItems": 50
}
```

### Comment rows

| Field | Contents |
|---|---|
| **`id`** | Comment or reply ID |
| **`content`** | Comment text |
| **`user`** | Comment author details |
| **`like_count`** | Likes on the comment |
| **`time`** | Unix timestamp |
| **`sub_comment_count`** | Number of replies reported for a top-level comment |

```json
{
  "id": "6933e4fa00000000380056a6",
  "content": "Which trail was this?",
  "user": {
    "nickname": "wanderlust22",
    "red_id": "1082232385"
  },
  "like_count": 12,
  "time": 1765008661,
  "sub_comment_count": 2
}
```

### Where a run stops

Pagination follows RedNote's continuation cursor. The run ends at **`maxItems`**, when no next page exists, when a page is empty, or when RedNote repeats the same cursor. With replies enabled, top-level comments and replies both count toward the same cap.

### Questions

**Why did I receive fewer rows than `maxItems`?**

**`maxItems`** is a ceiling, not a promised count. The run stops when RedNote has no more comment pages.

**Do I need a session cookie to read comments?**

No login, cookie, or session token is required or accepted.

Need the post itself first? [RedNote Post Scraper](https://apify.com/thenetaji/rednote-post-scraper) accepts the same post URL or ID.

# Actor input Schema

## `post_url` (type: `string`):

Full public RedNote post URL. A recognizable public post ID is extracted automatically.

## `post_id` (type: `string`):

Public post ID when you do not have a URL.

## `maxItems` (type: `integer`):

Maximum rows to save. Set 0 to keep collecting until the source is exhausted.

## `include_replies` (type: `boolean`):

Also collect replies for each returned top-level comment.

## `comment_sort` (type: `string`):

Order for post comments.

## Actor input object example

```json
{
  "post_url": "https://www.xiaohongshu.com/explore/69280b85000000001e00971c",
  "post_id": "69280b85000000001e00971c",
  "maxItems": 20,
  "include_replies": false,
  "comment_sort": "latest"
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing all scraped data

# 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 = {
    "post_url": "https://www.xiaohongshu.com/explore/69280b85000000001e00971c",
    "post_id": "69280b85000000001e00971c",
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("toolzerhub/rednote-xiaohongshu-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 = {
    "post_url": "https://www.xiaohongshu.com/explore/69280b85000000001e00971c",
    "post_id": "69280b85000000001e00971c",
    "maxItems": 20,
}

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

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

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

```

## CLI example

```bash
echo '{
  "post_url": "https://www.xiaohongshu.com/explore/69280b85000000001e00971c",
  "post_id": "69280b85000000001e00971c",
  "maxItems": 20
}' |
apify call toolzerhub/rednote-xiaohongshu-comments-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=toolzerhub/rednote-xiaohongshu-comments-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/e8D2sRiwyhFgXpSeJ/builds/8MQ3CdBex8ZgcRTCY/openapi.json
