# Xiaohongshu (RedNote) Comments Scraper - Reply Threads (`zen-studio/rednote-comments-scraper`) Actor

Extract every Xiaohongshu (RedNote) comment with nested reply threads, author profile, avatar URL, IP city, like counts, attached pictures, and @-mentions. Paste note URLs or 24-character note IDs. 30+ fields per comment, export to JSON, CSV, or Excel.

- **URL**: https://apify.com/zen-studio/rednote-comments-scraper.md
- **Developed by:** [Zen Studio](https://apify.com/zen-studio) (community)
- **Categories:** Social media, Videos, Automation
- **Stats:** 3 total users, 2 monthly users, 93.8% runs succeeded, NaN 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.
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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 | Nested Replies, Author Profiles, IP City (2026)

<blockquote style="border-left:4px solid #4C945E;background:#F0FDF4;padding:12px 16px">
<span style="font-size:16px;font-weight:700;color:#1C1917">30+ fields per comment, every upstream field preserved</span> <span style="font-size:15px;color:#57534E"> — author profile with avatar URL, IP city, like counts, attached pictures, @-mentions, and the full nested reply tree under every comment on any Xiaohongshu (小红书) note.</span>
</blockquote>

![RedNote Comments Scraper](https://iili.io/BmGqX5v.png)

<table>
<tr>
<td colspan="5" style="padding:10px 14px;background:#4C945E;border:none;border-radius:4px 4px 0 0">
<span style="color:#FAFAF9;font-size:14px;font-weight:700;letter-spacing:0.5px">Zen Studio · Chinese-platform suite</span>
<span style="color:#E8F5E9;font-size:13px">&nbsp;&nbsp;&bull;&nbsp;&nbsp;RedNote (小红书), Douyin (抖音), Xigua (西瓜视频)</span>
</td>
</tr>
<tr>
<td style="padding:10px 12px;border:1px solid #E7E5E4;background:#E8F5E9;border-right:none;border-top:none;vertical-align:top;width:20%">
<span style="white-space:nowrap"><img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/NWYsOG96fMDy8ycdf-actor-sAWbV6wp5XO5aEapx-C7gOsPJt9Q-xiaohongshu-search-scraper-logo-square.png" width="20" height="20" style="vertical-align:middle;border-radius:4px"> &nbsp;<a href="https://apify.com/zen-studio/rednote-comments-scraper" style="color:#4C945E;text-decoration:none;font-weight:700;font-size:13px">RedNote&nbsp;Comments</a></span><br>
<span style="color:#4C945E;font-size:11px;font-weight:600">&#10148; You are here</span>
</td>
<td style="padding:10px 12px;border:1px solid #E7E5E4;border-right:none;border-top:none;vertical-align:top;width:20%">
<span style="white-space:nowrap"><img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/NWYsOG96fMDy8ycdf-actor-hO5NqsA6aC1bz3jra-MjB05eVFEt-xiaohongshu-search-scraper-logo-square.png" width="20" height="20" style="vertical-align:middle;border-radius:4px"> &nbsp;<a href="https://apify.com/zen-studio/rednote-search-scraper" style="color:#1C1917;text-decoration:none;font-weight:700;font-size:13px">RedNote&nbsp;Search</a></span><br>
<span style="color:#78716C;font-size:11px">500 notes / 30s, 24 fields</span>
</td>
<td style="padding:10px 12px;border:1px solid #E7E5E4;border-right:none;border-top:none;vertical-align:top;width:20%">
<span style="white-space:nowrap"><img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/NWYsOG96fMDy8ycdf-actor-3TJaaOJDU1AMiOoJM-Vu2eVr0P6N-douyin-profile-scraper-logo.png" width="20" height="20" style="vertical-align:middle;border-radius:4px"> &nbsp;<a href="https://apify.com/zen-studio/douyin-search-scraper" style="color:#1C1917;text-decoration:none;font-weight:700;font-size:13px">Douyin&nbsp;Search</a></span><br>
<span style="color:#78716C;font-size:11px">Keyword + filters, 60+ fields</span>
</td>
<td style="padding:10px 12px;border:1px solid #E7E5E4;border-right:none;border-top:none;vertical-align:top;width:20%">
<span style="white-space:nowrap"><img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/NWYsOG96fMDy8ycdf-actor-3UkyCcaAQLuQPa2DB-nKbW8d285P-douyin-profile-scraper-logo.png" width="20" height="20" style="vertical-align:middle;border-radius:4px"> &nbsp;<a href="https://apify.com/zen-studio/douyin-transcripts-scraper" style="color:#1C1917;text-decoration:none;font-weight:700;font-size:13px">Douyin&nbsp;Transcripts</a></span><br>
<span style="color:#78716C;font-size:11px">50+ languages, .srt + MP4</span>
</td>
<td style="padding:10px 12px;border:1px solid #E7E5E4;border-top:none;vertical-align:top;width:20%">
<span style="white-space:nowrap"><img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/NWYsOG96fMDy8ycdf-actor-dexCSKEZtKS8hg4fT-lD4weyiYga-shigua-____-scraper-logo.jpg" width="20" height="20" style="vertical-align:middle;border-radius:4px"> &nbsp;<a href="https://apify.com/zen-studio/xigua-video-search-scraper" style="color:#1C1917;text-decoration:none;font-weight:700;font-size:13px">Xigua&nbsp;Search</a></span><br>
<span style="color:#78716C;font-size:11px">Keyword + comments + MP4</span>
</td>
</tr>
</table>

#### Copy to your AI assistant

````

zen-studio/rednote-comments-scraper on Apify. Pulls every top-level comment + nested reply on any Xiaohongshu (小红书) note with author profile, avatar URL, IP city, and full target\_comment refs. Call ApifyClient("TOKEN").actor("zen-studio/rednote-comments-scraper").call(run\_input={...}), then client.dataset(run\["defaultDatasetId"]).list\_items().items. noteUrls accepts share URLs or bare 24-char hex note IDs. Full spec: GET https://api.apify.com/v2/acts/zen-studio~rednote-comments-scraper/builds/default (Bearer TOKEN) → inputSchema, actorDefinition.storages.dataset, readme. Token: https://console.apify.com/account/integrations

````

### Key Features

- **30+ fields per comment** — author profile, avatar URL, public `red_id` handle, IP city, like counts, @-mentions, attached pictures, pinned tags, the entire `target_comment` reference for every reply
- **Nested reply threads** — every top-level comment carries a `replies[]` array; cap thread depth with `maxRepliesPerComment` (set to `0` for the entire tree)
- **No headless browser, no proxy needed** — paste note URLs or 24-character note IDs, hit Start
- **Three sort orders** — `latest`, `recommended`, `most_liked`
- **Free tier** — 5 lifetime runs, ~20 comments from the first note, no credit card

### How to Scrape Xiaohongshu Comments

#### Basic — single note, default settings

```json
{
    "noteUrls": ["https://www.xiaohongshu.com/discovery/item/69db721a00000000220290a8"]
}
````

#### Multiple notes, capped budget

```json
{
    "noteUrls": [
        "https://www.xiaohongshu.com/discovery/item/69db721a00000000220290a8",
        "69dc63550000000015004853"
    ],
    "maxCommentsPerNote": 200,
    "maxRepliesPerComment": 10
}
```

#### Top-voted threads only, no replies

```json
{
    "noteUrls": ["69db721a00000000220290a8"],
    "sortBy": "most_liked",
    "includeReplies": false,
    "maxCommentsPerNote": 50
}
```

#### Full thread tree for one viral comment

```json
{
    "noteUrls": ["69db721a00000000220290a8"],
    "maxCommentsPerNote": 1,
    "maxRepliesPerComment": 0
}
```

### Input Parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `noteUrls` | array | *required* | One or more Xiaohongshu note links or bare 24-character note IDs. Each note runs independently. |
| `sortBy` | enum | `latest` | `latest`, `recommended`, or `most_liked` |
| `includeReplies` | boolean | `true` | When `true`, every comment carries a nested `replies[]` array |
| `maxRepliesPerComment` | integer | `5` | Replies to fetch under each top-level comment. `0` = unlimited |
| `maxCommentsPerNote` | integer | `0` | Top-level comments per note. `0` = all |

### What Data Can You Extract from Xiaohongshu Comments?

Every dataset row is one top-level comment with its full reply thread nested inside.

**Comment fields:**

- `id`, `note_id`, `url_to_note`, `content`, `time`
- `like_count`, `sub_comment_count`, `liked`, `ip_location`
- `pictures` (when the comment has attached images)
- `show_tags`, `show_tags_v2` (includes `Pinned`, `Author liked` labels)
- `at_users`, `hash_tags`, `media_source_type`
- `sort_by`, `comment_index_in_note`

**Author profile (`user`):**

- `userid`, `red_id` (public XHS handle), `nickname`
- `images` (avatar URL), `ai_agent`, `level`

**Each nested reply (`replies[]`):**

- All the comment fields above (where applicable)
- `target_comment` with the parent's `id`, `status`, and full `user` profile

#### Output Example

```json
{
  "id": "69dc63550000000015004853",
  "note_id": "69db721a00000000220290a8",
  "url_to_note": "https://www.xiaohongshu.com/discovery/item/69db721a00000000220290a8",
  "content": "千万不要点进作者的主页，不然就出不来了[捂脸R][捂脸R]",
  "time": 1776051029,
  "ip_location": "Shanghai",
  "like_count": 119,
  "sub_comment_count": 11,
  "liked": false,
  "collected": false,
  "user": {
    "userid": "ae72f2a6105526a05fb17d369ee6e",
    "red_id": "27209397831",
    "nickname": "晚风轻吟",
    "images": "https://sns-avatar-qc.xhscdn.com/avatar/1040g2jo31uu4q7413q005qca0u389c1cvfo51i0?imageView2/2/w/120/format/jpg",
    "ai_agent": false,
    "level": { "image": "" },
    "current_user": "false",
    "additional_tags": {}
  },
  "at_users": [],
  "show_tags": [],
  "show_tags_v2": [
    { "text": "Pinned", "type": "user_top", "pos": "cmt_bottom", "style_id": "red" }
  ],
  "pictures": null,
  "hash_tags": null,
  "media_source_type": null,
  "sub_comment_cursor": "{\"cursor\":\"69dc6a7d000000001500ab19\",\"index\":1}",
  "replies": [
    {
      "id": "69dc6a7d000000001500ab19",
      "content": "不信你的话，点进去第一反应就是咽了几口口水[暗中观察R]",
      "time": 1776052862,
      "ip_location": "Guangdong",
      "like_count": 93,
      "liked": false,
      "user": {
        "userid": "a651518b161bd8d20adb86abd4798",
        "red_id": "4646143817",
        "nickname": "八方来财",
        "images": "https://sns-avatar-qc.xhscdn.com/avatar/1040g2jo31q83819h7u005pdi1p9kpa9hcpnh30g?imageView2/2/w/120/format/jpg",
        "ai_agent": false
      },
      "target_comment": {
        "id": "69dc63550000000015004853",
        "status": 4,
        "user": {
          "userid": "ae72f2a6105526a05fb17d369ee6e",
          "red_id": "27209397831",
          "nickname": "晚风轻吟",
          "images": "https://sns-avatar-qc.xhscdn.com/avatar/1040g2jo31uu4q7413q005qca0u389c1cvfo51i0?imageView2/2/w/120/format/jpg"
        }
      },
      "at_users": [],
      "show_tags": [],
      "show_tags_v2": [
        { "text": "Author liked", "type": "author_liked" }
      ]
    },
    {
      "id": "69dc736a000000001500a5a1",
      "content": "果然  不关注都出不来[笑哭R]",
      "time": 1776055146,
      "ip_location": "Beijing",
      "like_count": 2,
      "user": {
        "userid": "6539e3ce000000000d006d07",
        "red_id": "4583774467",
        "nickname": "熙熙大王",
        "images": "https://sns-avatar-qc.xhscdn.com/avatar/1040g2jo31iojfqsd1a605p9psf738r870uj84a8?imageView2/2/w/120/format/jpg"
      },
      "target_comment": {
        "id": "69dc63550000000015004853",
        "user": { "userid": "698a0786000000002100b02c", "nickname": "晚风轻吟" }
      },
      "show_tags": ["author_liked"]
    }
    // ... 3 more replies
  ],
  "sort_by": "latest",
  "comment_index_in_note": 0,
  "status": 4,
  "score": 10000000,
  "hidden": false,
  "downvoted": false,
  "share_strategy": 0,
  "comment_type": 0,
  "translation_strategy": 9,
  "show_type": "common",
  "relatable_to_note": false,
  "biz_label": { "product_review": false, "group_invite": "false", "rich_text": "unknown" },
  "track_id": "interaction-service.local",
  "friend_liked_msg": "",
  "sub_comments": [
    // raw upstream `sub_comments` inline (mirrors the first entry of `replies`)
  ]
}
```

### Advanced Usage

#### Cap cost on a viral note

```json
{ "noteUrls": ["69db721a00000000220290a8"], "maxCommentsPerNote": 100, "maxRepliesPerComment": 3 }
```

#### Bulk-collect comments from a known set of notes

```json
{
  "noteUrls": [
    "69db721a00000000220290a8",
    "69dc63550000000015004853",
    "69dcf76e000000003501618e"
  ],
  "sortBy": "most_liked",
  "maxCommentsPerNote": 50
}
```

#### IP-city sentiment study — top comments only

```json
{ "noteUrls": ["69db721a00000000220290a8"], "sortBy": "most_liked", "includeReplies": false, "maxCommentsPerNote": 500 }
```

### Pricing — Pay Per Event (PPE)

**$5.99 per 1,000 comments.** Each comment counts as one billable result — both top-level comments and nested replies.

| Event | Per call | Per 1,000 |
|-------|----------|-----------|
| Comment result (top-level or nested reply) | $0.00599 | $5.99 |

Free tier: 5 lifetime runs, ~20 comments from the first note, replies off.

### FAQ

**Which note URL formats are accepted?**
Full share URLs (`/discovery/item/<id>` or `/explore/<id>`, with or without `xsec_token` query params) and bare 24-character hex IDs.

**Why does my dataset have fewer rows than I expected?**
Each row is one top-level comment, with the full reply tree embedded inside its `replies[]` array. If you ran with `maxCommentsPerNote: 50`, you get up to 50 rows — but the total billed comments include every nested reply too.

**What's IP location?**
Xiaohongshu attaches a coarse geographic label to each comment (province or city, e.g. `Beijing`, `Shanghai`, `Guangdong`). Roughly 70% of top-level comments and 50% of replies carry it.

**Are author avatars included?**
Yes — `user.images` on every comment and reply is a direct CDN URL to the author's avatar.

**Can I get the full reply tree under one comment?**
Yes. Set `maxRepliesPerComment: 0` and target the comment by pinning its note (`maxCommentsPerNote: 1`) — the scraper paginates all replies until the upstream cursor exhausts.

**What sort orders are supported?**
`latest` (newest first, the Xiaohongshu app default), `recommended` (curated relevance), `most_liked` (by like count).

**Can I detect pinned comments?**
Yes — `show_tags_v2` carries a `{ "type": "user_top", "text": "Pinned" }` entry on the pinned comment.

**Does the actor follow `@`-mentions?**
The `at_users` array on each comment lists the mentioned users with `user_id` and `nickname`. The scraper does not recursively fetch their profiles.

**What happens if a note has comments disabled or is removed?**
You'll get zero comments for that note ID and the run continues with the next note.

**How fresh is the data?**
Live from Xiaohongshu at run time — no cache.

### Support

- **Bugs**: Issues tab
- **Features**: Issues tab

### Legal Compliance

Extracts publicly available data. Users must comply with Xiaohongshu's terms and data protection regulations (GDPR, CCPA).

***

*Pull every top-level comment and nested reply on any Xiaohongshu (小红书) note with author profile, avatar URL, IP city, like counts, and the full target\_comment reference for each reply.*

# Actor input Schema

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

Add one or more Xiaohongshu note links. Bare 24-character note IDs work too.<br><br>• Full URL: <code>https://www.xiaohongshu.com/discovery/item/69db721a00000000220290a8?xsec\_token=...</code><br>• Bare ID: <code>69db721a00000000220290a8</code><br><br>Each note runs independently with its own <b>Max comments per note</b> budget.

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

How comments are ranked.<br><br>• <b>Latest</b> — newest first (default; matches the Xiaohongshu app's own default)<br>• <b>Recommended</b> — Xiaohongshu's curated relevance ranker<br>• <b>Most liked</b> — by like count; surfaces the top-voted threads

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

When ON (default), every top-level comment row carries a nested <code>replies\[]</code> array.<br><br>Turn OFF to scrape only top-level comments and keep cost predictable.<br><br>Each reply counts as one billable result — use <b>Max replies per comment</b> to cap thread depth.

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

Top-level comments to collect per note. <b>Set to 0 to fetch all</b>.<br><br>Use this on viral notes (a single trending note can have 1,000+ comments).

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

How many replies to fetch under each top-level comment. <b>Set to 0 for all replies</b> (no cap).<br><br>Each reply counts as one billable result, so this is the most effective lever for viral notes with deep reply threads.

## Actor input object example

```json
{
  "noteUrls": [
    "https://www.xiaohongshu.com/discovery/item/69db721a00000000220290a8"
  ],
  "sortBy": "latest",
  "includeReplies": true,
  "maxCommentsPerNote": 0,
  "maxRepliesPerComment": 5
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset of comments — one row per top-level comment with nested replies.

# 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/discovery/item/69db721a00000000220290a8"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("zen-studio/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/discovery/item/69db721a00000000220290a8"] }

# Run the Actor and wait for it to finish
run = client.actor("zen-studio/rednote-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 '{
  "noteUrls": [
    "https://www.xiaohongshu.com/discovery/item/69db721a00000000220290a8"
  ]
}' |
apify call zen-studio/rednote-comments-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Xiaohongshu (RedNote) Comments Scraper - Reply Threads",
        "description": "Extract every Xiaohongshu (RedNote) comment with nested reply threads, author profile, avatar URL, IP city, like counts, attached pictures, and @-mentions. Paste note URLs or 24-character note IDs. 30+ fields per comment, export to JSON, CSV, or Excel.",
        "version": "0.0",
        "x-build-id": "Iy5xdhCM4aQYLFrSD"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/zen-studio~rednote-comments-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-zen-studio-rednote-comments-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/zen-studio~rednote-comments-scraper/runs": {
            "post": {
                "operationId": "runs-sync-zen-studio-rednote-comments-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/zen-studio~rednote-comments-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-zen-studio-rednote-comments-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "noteUrls"
                ],
                "properties": {
                    "noteUrls": {
                        "title": "🔗 Note URLs or IDs",
                        "minItems": 1,
                        "type": "array",
                        "description": "Add one or more Xiaohongshu note links. Bare 24-character note IDs work too.<br><br>• Full URL: <code>https://www.xiaohongshu.com/discovery/item/69db721a00000000220290a8?xsec_token=...</code><br>• Bare ID: <code>69db721a00000000220290a8</code><br><br>Each note runs independently with its own <b>Max comments per note</b> budget.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "sortBy": {
                        "title": "Sort comments by",
                        "enum": [
                            "latest",
                            "recommended",
                            "most_liked"
                        ],
                        "type": "string",
                        "description": "How comments are ranked.<br><br>• <b>Latest</b> — newest first (default; matches the Xiaohongshu app's own default)<br>• <b>Recommended</b> — Xiaohongshu's curated relevance ranker<br>• <b>Most liked</b> — by like count; surfaces the top-voted threads",
                        "default": "latest"
                    },
                    "includeReplies": {
                        "title": "Include replies under each comment",
                        "type": "boolean",
                        "description": "When ON (default), every top-level comment row carries a nested <code>replies[]</code> array.<br><br>Turn OFF to scrape only top-level comments and keep cost predictable.<br><br>Each reply counts as one billable result — use <b>Max replies per comment</b> to cap thread depth.",
                        "default": true
                    },
                    "maxCommentsPerNote": {
                        "title": "Max comments per note",
                        "minimum": 0,
                        "maximum": 100000,
                        "type": "integer",
                        "description": "Top-level comments to collect per note. <b>Set to 0 to fetch all</b>.<br><br>Use this on viral notes (a single trending note can have 1,000+ comments).",
                        "default": 0
                    },
                    "maxRepliesPerComment": {
                        "title": "Max replies per comment",
                        "minimum": 0,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "How many replies to fetch under each top-level comment. <b>Set to 0 for all replies</b> (no cap).<br><br>Each reply counts as one billable result, so this is the most effective lever for viral notes with deep reply threads.",
                        "default": 5
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
