# 小红书评论采集 | Xiaohongshu XHS RedNote Comments Scraper (`habit.zhou/xiaohongshu-comments-scraper`) Actor

小红书评论采集:粘贴笔记链接,导出全部评论 — 正文、点赞、回复数、作者、IP 属地、时间。Scrape every comment from any Xiaohongshu / XHS / RedNote note, one row per comment, replies included. No cookies or login. For sentiment analysis, review mining, KOL research, AI datasets.

- **URL**: https://apify.com/habit.zhou/xiaohongshu-comments-scraper.md
- **Developed by:** [Seller Aim](https://apify.com/habit.zhou) (community)
- **Categories:** Social media, Developer tools, AI
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.99 / 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.

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 XHS RedNote Comments Scraper

Pull **every comment** from any Xiaohongshu (小红书 / XHS / RedNote) note. Paste note links, get one clean row per comment — text, author, likes, reply count, IP location, and timestamp. **No cookies, no login, no API key.**

### 中文说明

小红书评论采集工具。粘贴笔记链接(网页链接或 App 分享短链均可),导出该笔记下的**全部评论**:

- 评论正文、点赞数、回复数
- 评论者昵称 / 用户 ID / 主页链接 / 头像
- **IP 属地**、发布时间
- 可选:把**评论回复**一并展开成独立行(带 `parentCommentId`)

**无需 cookie、无需登录、无需自备 API key。** 支持导出 JSON / CSV / Excel / HTML,也可通过 Apify REST API 接入 n8n、Make、Zapier 或自建流水线。

适用场景:**口碑与舆情分析、产品评价挖掘、竞品差评研究、达人粉丝互动分析、AI 训练语料采集**。

### Support / 联系我们

Bug、字段缺失、需要更高并发?请在 Actor 页面的 **Issues** 标签提交,我们通常在 24–72 小时内响应。需要定制字段或 SLA,可通过 Apify 站内聊天联系。

### What does Xiaohongshu Comments Scraper do?

Xiaohongshu's comment threads are where the honest signal lives — what people actually think about a product, a brand, or a creator. This Actor turns those threads into a spreadsheet.

Give it one or more note URLs. For each note it pages through the full comment list and emits **one dataset row per comment**, so the output drops straight into a pivot table, a sentiment model, or a vector store. Optionally it flattens replies into their own rows too.

It reads the public comment surface through a maintained backend — you never supply a Xiaohongshu cookie, and nothing breaks when your session expires.

### Why use it?

- **One row per comment.** No nested JSON to unpack, no post-processing before analysis.
- **IP location included.** Xiaohongshu exposes commenter IP province/region — useful for regional sentiment and for filtering out obvious spam farms.
- **Replies, flattened.** Turn on `includeReplies` and sub-comments arrive as their own rows with `parentCommentId`, so you can rebuild threads or treat them as flat text.
- **Cost is capped by you.** `maxCommentsPerNote` is a hard limit, and you are billed per comment returned — so a run can never surprise you.
- **No cookies, no breakage.** Actors that need your logged-in cookie stop working every few days. This one doesn't use cookies at all.
- **Lightweight and fast.** No browser is launched, so runs start in seconds and use little memory.

### How to use Xiaohongshu Comments Scraper

1. Open the Actor and click **Try for free**.
2. Paste one or more **note URLs** into `noteUrls`. Both formats work:
   - `https://www.xiaohongshu.com/explore/<noteId>`
   - an `xhslink.com/...` share link copied from the app (resolved automatically)
3. Set **Max comments per note** (default 100) — this is your cost ceiling.
4. Optionally switch on **Include replies**.
5. Click **Save & Start**, then download as JSON, CSV, Excel, or HTML.

Want this daily? Add the Actor under the **Schedules** tab — no code required.

### Input

| Field | Type | Description |
|---|---|---|
| `noteUrls` | array | Note URLs or `xhslink.com` share links. Required. |
| `maxCommentsPerNote` | integer | Hard cap per note (1–5000). Default 100. Also your cost cap. |
| `includeReplies` | boolean | Flatten replies into their own rows. Default false. |

```json
{
    "noteUrls": [
        { "url": "https://www.xiaohongshu.com/explore/69fba039000000003803426d" }
    ],
    "maxCommentsPerNote": 200,
    "includeReplies": true
}
```

### Output

One row per comment:

```json
{
    "commentId": "6a1b2c3d000000000f00a1b2",
    "noteId": "69fba039000000003803426d",
    "noteUrl": "https://www.xiaohongshu.com/explore/69fba039000000003803426d",
    "content": "太实用了，已经收藏！",
    "likes": 42,
    "replyCount": 3,
    "authorName": "用户A",
    "authorId": "5e2a3c1d000000000100abc7",
    "authorAvatar": "https://sns-avatar-qc.xhscdn.com/avatar/....jpg",
    "authorUrl": "https://www.xiaohongshu.com/user/profile/5e2a3c1d000000000100abc7",
    "ipLocation": "上海",
    "publishedAt": "2026-04-13T09:42:00.000Z",
    "isReply": false,
    "parentCommentId": null,
    "scrapedAt": "2026-08-10T01:12:00.000Z"
}
```

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

| Field | Description |
|---|---|
| `commentId` | Xiaohongshu's internal comment ID. Use it to deduplicate across runs. |
| `noteId` / `noteUrl` | The note this comment belongs to. |
| `content` | Comment text. |
| `likes` | Like count on the comment. |
| `replyCount` | Number of replies under this comment. |
| `authorName` | Commenter's display name. |
| `authorId` / `authorUrl` | Commenter's user ID and profile link. |
| `authorAvatar` | Avatar image URL. |
| `ipLocation` | IP province / region as shown by Xiaohongshu. |
| `publishedAt` | ISO 8601 comment timestamp. |
| `isReply` | `true` for rows produced by `includeReplies`. |
| `parentCommentId` | Set on reply rows; `null` on top-level comments. |
| `scrapedAt` | ISO 8601 collection timestamp. |

Fields Xiaohongshu does not return for a given comment come back as `null` rather than being silently dropped. In practice `commentId`, `content`, `likes`, `replyCount`, `authorName`, `authorId`, `authorAvatar` and `publishedAt` are populated for essentially every comment, while **`ipLocation` is only present on a subset** (Xiaohongshu does not attach it to every comment) and image-only comments have an empty `content`.

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

You pay **per comment returned** — see the Pricing tab on this Actor for the current rate. Because `maxCommentsPerNote` is a hard cap, your maximum spend per run is simply `notes x maxCommentsPerNote x rate`.

**Platform usage is included** — no separate compute or proxy bill. This Actor runs without a browser, so it is cheap and fast to execute.

#### Free vs. paid Apify plans

Apify free-plan users get **2 sample runs capped at 10 comments each** so you can check the data before committing. Further free-plan runs are blocked with an upgrade prompt — this Actor depends on a paid backend, so unlimited free use isn't something we can subsidise. Any Apify paid plan lifts the cap.

### Tips

- **Deduplicate by `commentId`** when you re-run the same note over time; the Actor already dedupes within a single run.
- **Start with `maxCommentsPerNote: 50`** to sanity-check a note's comment quality before pulling thousands.
- **Leave `includeReplies` off** unless you need them — replies count toward your limit and most sentiment work only needs top-level comments.
- **Group notes per run.** One run with 20 note URLs is cheaper in overhead than 20 separate runs.
- **Filter by `ipLocation`** to build region-by-region sentiment views.

### FAQ

**Do I need a Xiaohongshu account or cookie?**
No. Nothing to log into, nothing to expire.

**Can it get replies to comments?**
Yes — set `includeReplies: true`. Replies arrive as their own rows with `parentCommentId` pointing at the parent, so you can rebuild the thread or analyse everything flat.

**What if a note is private or deleted?**
That note is skipped with a warning and the run continues with the rest — one bad URL never kills the batch.

**Why did I get fewer comments than `maxCommentsPerNote`?**
The note simply has fewer comments, or Xiaohongshu stopped serving more. The cap is a ceiling, not a target — you are only billed for rows actually returned.

**Is scraping Xiaohongshu legal?**
This Actor collects publicly visible, non-private content — what any visitor can see. How you use the output is your responsibility; comply with your local law and Xiaohongshu's Terms of Service, and don't use the data to identify or profile individuals.

**Can I get the data via API?**
Yes. Every run exposes a stable [Apify REST API](https://docs.apify.com/api/v2) for input, dataset, and run status.

**I need other Xiaohongshu data too.**
Our [小红书 API | Xiaohongshu Pro Scraper](https://apify.com/habit.zhou/xiaohongshu-pro-scraper) covers keyword search, note details, creator profiles, topic feeds, hot lists, and keyword suggestions.

# Actor input Schema

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

Xiaohongshu note URLs to pull comments from. Accepts https://www.xiaohongshu.com/explore/<noteId>, /discovery/item/<noteId>, or an xhslink.com share link copied from the app (auto-resolved). Leave empty to run a demo on a currently popular note. 支持网页链接与 App 分享短链;留空则自动演示一篇当前热门笔记。

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

Stop after this many comments per note. Comments are billed per row, so this is your cost cap. 每篇笔记的采集上限,也是你的成本上限。

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

Also return replies nested under top-level comments, flattened into their own rows with parentCommentId set. Replies count toward the limit above. 回复会作为独立行返回,并计入上限。

## Actor input object example

```json
{
  "noteUrls": [
    {
      "url": "https://www.xiaohongshu.com/explore/69fba039000000003803426d"
    }
  ],
  "maxCommentsPerNote": 100,
  "includeReplies": false
}
```

# Actor output Schema

## `comments` (type: `string`):

Every scraped comment, one row each — text, author, likes, IP location, timestamp.

## `consoleOutput` (type: `string`):

Browse and export the comments as JSON, CSV, Excel or HTML.

# 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": [
        {
            "url": "https://www.xiaohongshu.com/explore/69fba039000000003803426d"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("habit.zhou/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 = { "noteUrls": [{ "url": "https://www.xiaohongshu.com/explore/69fba039000000003803426d" }] }

# Run the Actor and wait for it to finish
run = client.actor("habit.zhou/xiaohongshu-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": [
    {
      "url": "https://www.xiaohongshu.com/explore/69fba039000000003803426d"
    }
  ]
}' |
apify call habit.zhou/xiaohongshu-comments-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,habit.zhou/xiaohongshu-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/TYKj5KlxaD392fS6Q/builds/ka56EveWRVFdwWdD1/openapi.json
