# RedNote / Xiaohongshu Scraper — Search, Posts, Users, Comments (`dltik/rednote-xiaohongshu-scraper`) Actor

All-in-one RedNote (Xiaohongshu) scraper: search by keyword, fetch post details, user posts, comments. Get title, content, images, hashtags, likes, collects, comments count, author. China's #1 lifestyle platform, 250M MAU. Cookie-based, $0.005/result.

- **URL**: https://apify.com/dltik/rednote-xiaohongshu-scraper.md
- **Developed by:** [dltik](https://apify.com/dltik) (community)
- **Categories:** Social media, AI, Marketing
- **Stats:** 6 total users, 4 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

$5.00 / 1,000 result fetcheds

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/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 Scraper — Search, Posts, Users, Comments (All-in-One)

> Scrape **Xiaohongshu (RedNote)** — China's #1 lifestyle platform, 250M+ monthly active users. **All-in-one** actor with 4 modes: keyword search, post details, user posts, comments. Get title, content, hashtags, likes, collects, comments count, author, IP location, images. Cookie-based, **$0.005 per result** ($5 per 1,000).

⭐ **Bookmark this RedNote / Xiaohongshu Scraper** — Apify ranks actors by bookmarks, so it directly helps the visibility of this scraper on the Apify Store.

### What is the RedNote / Xiaohongshu Scraper?

The **RedNote / Xiaohongshu Scraper** is an Apify actor that pulls structured data from [Xiaohongshu](https://www.xiaohongshu.com/) (international name: **RedNote**) — China's leading social commerce platform with 250M+ MAU. Unlike scrapers that split functionality across 5 separate paid actors, this is **one actor with 4 modes**:

| Mode | Input | Output |
|---|---|---|
| `search` | keyword | top notes matching |
| `post` | note URL/ID | full note details |
| `user_posts` | user ID/URL | all posts by user |
| `comments` | note URL/ID | comments + replies |

Tech: HTTP-only via the public note SSR (works without auth for `post`) + the official internal web API (cookies required for `search`/`user_posts`/`comments`). No browser, no proxy bandwidth burn.

### Use cases

- **Brand monitoring on RedNote** — track mentions of your brand across Xiaohongshu posts, get sentiment proxies via like/comment ratios.
- **Influencer discovery** — find rising creators in beauty, lifestyle, fashion (XHS's biggest verticals); pull their full post history.
- **Trend research** — search Xiaohongshu daily for "#summer trends" and watch hashtags rise/fall.
- **Cross-border ecommerce** — Western brands (Sephora, Nike, Apple) leak into XHS organically — track that conversation.
- **Competitive intel** — scrape your competitor's RedNote profile to count posts, engagement, content cadence.
- **Social commerce research** — XHS is where Chinese millennials decide what to buy; use this Xiaohongshu scraper to map purchasing intent signals.

### Input

```json
{
  "mode": "search",
  "queries": ["coffee recipes", "skincare routine"],
  "maxResultsPerInput": 100,
  "cookiesString": "web_session=abc...; xsecappid=xhs-pc-web; ..."
}
````

For `post` mode (no cookies needed for many public notes):

```json
{
  "mode": "post",
  "noteUrls": [
    "https://www.xiaohongshu.com/explore/65e5e5f4000000001a032b9c",
    "65e5e5f4000000001a032b9c"
  ]
}
```

For `user_posts` (cookies required):

```json
{
  "mode": "user_posts",
  "userIds": ["https://www.xiaohongshu.com/user/profile/5d8...", "5d8b8a..."],
  "maxResultsPerInput": 200,
  "cookiesString": "..."
}
```

### Output

Note record (modes `search`, `post`, `user_posts`):

```json
{
  "note_id": "65e5e5f4000000001a032b9c",
  "url": "https://www.xiaohongshu.com/explore/65e5e5f4000000001a032b9c",
  "type": "normal",
  "title": "Best coffee in Shanghai 2026",
  "description": "Full body of the post...",
  "user": {
    "user_id": "5d8b8a...",
    "nickname": "ExampleCreator",
    "avatar": "https://sns-avatar.xhscdn.com/..."
  },
  "interactions": {
    "liked_count": 1284,
    "collected_count": 312,
    "comment_count": 87,
    "share_count": 23
  },
  "images": ["https://sns-img.xhscdn.com/..."],
  "hashtags": ["coffee", "shanghai", "2026Trends"],
  "ip_location": "Shanghai",
  "time": 1714665600000
}
```

Comment record (mode `comments`):

```json
{
  "note_id": "65e5e5f4000000001a032b9c",
  "comment_id": "...",
  "content": "Looks amazing!",
  "user": { "user_id": "...", "nickname": "..." },
  "like_count": 42,
  "sub_comment_count": 3,
  "ip_location": "Beijing",
  "time": 1714665601000
}
```

### How to get your XHS cookies (2 min)

1. Open [xiaohongshu.com](https://www.xiaohongshu.com) and log in.
2. F12 → **Application** tab → **Cookies** → click `https://www.xiaohongshu.com`.
3. Copy all cookies as a single line: `name=value; name2=value2; ...`. Quick way: in the Console tab type `document.cookie` and copy the result.
4. Paste into the `cookiesString` input.

Cookies needed: `web_session`, `xsecappid`, `a1`, `webId` (most are auto-included via `document.cookie`).

### Pricing

**PAY\_PER\_EVENT — $0.005 per result** (= $5 per 1,000). Failed runs not charged. One charge per note in `search`/`user_posts`/`post`, one per comment in `comments` mode.

### FAQ — Xiaohongshu Scraper alternatives

**Why one actor instead of 5 separate?** The RedNote ecosystem on Apify Store is currently split into 5 single-purpose actors (search, post, user, comments, video). With this Xiaohongshu Scraper you get all 4 modes in one — half the friction, all the data.

**Does it require cookies?** Only for `search`, `user_posts`, `comments`. For `post` mode (single note details) the public SSR page works without cookies for most notes.

**Geofencing — does it work outside China?** XHS serves the international `xiaohongshu.com` domain globally. Most public notes return a parseable `__INITIAL_STATE__` from any IP. For protected content, use Apify residential proxy with a region close to East Asia for best success rate.

**Rate limits?** XHS doesn't publish official limits but is aggressive on suspicious patterns. Recommendation: ≤ 200 results per minute per session, take breaks between batches. The actor handles backoff automatically.

**Anti-scraping bypass?** This scraper uses XHS's public SSR HTML (for note details) + the internal web API (for search/user/comments) — both are intended for the official web client. No CAPTCHA bypass, no signed-request reverse engineering, just legitimate cookie-based access.

**Can I download images / videos?** Image URLs are in the output. For bulk download, pipe the URLs into [Apify Web Scraper](https://apify.com/apify/web-scraper) or your own image-fetcher.

***

⭐ **Found this RedNote / Xiaohongshu Scraper useful? Bookmark it** — Apify ranks actors by bookmarks, it's the strongest single signal for Store visibility.

#### Related actors

- [Substack Scraper](https://apify.com/dltik/substack-scraper) — Western newsletter platform, posts + comments + sentiment
- [Reddit Scraper](https://apify.com/dltik/reddit-scraper) — Western community discussion mining
- [Bilibili Scraper](https://apify.com/dltik/bilibili-scraper) — Chinese video platform metadata
- [TikTok Scraper](https://apify.com/dltik/tiktok-scraper) — sister platform, ByteDance ecosystem

License: MIT · Author: [dltik](https://apify.com/dltik)

# Actor input Schema

## `mode` (type: `string`):

What to scrape. search = keyword search; post = single note details by URL/ID; user\_posts = all notes by a user; comments = comments on a note.

## `queries` (type: `array`):

List of keywords to search. One result per matching note. Example: \['cooking recipes','coffee']

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

Full URLs (https://www.xiaohongshu.com/explore/<id>) or raw 24-char note IDs.

## `userIds` (type: `array`):

List of XHS user IDs (24 hex chars) or full profile URLs (https://www.xiaohongshu.com/user/profile/<id>).

## `maxResultsPerInput` (type: `integer`):

Cap results per input item. For search: max notes per keyword. For comments: max comments per note. For user\_posts: max posts per user.

## `cookiesString` (type: `string`):

Paste your XHS cookies as a single string (from DevTools → Application → Cookies → xiaohongshu.com → Copy all as 'name=value; name2=value2'). Without cookies, only public note URLs work.

## `proxyConfig` (type: `object`):

Optional. Recommended: residential proxy from China-friendly region.

## Actor input object example

```json
{
  "mode": "post",
  "queries": [
    "coffee"
  ],
  "noteUrls": [],
  "userIds": [],
  "maxResultsPerInput": 50,
  "proxyConfig": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "queries": [
        "coffee"
    ],
    "noteUrls": [],
    "userIds": [],
    "proxyConfig": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("dltik/rednote-xiaohongshu-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 = {
    "queries": ["coffee"],
    "noteUrls": [],
    "userIds": [],
    "proxyConfig": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("dltik/rednote-xiaohongshu-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 '{
  "queries": [
    "coffee"
  ],
  "noteUrls": [],
  "userIds": [],
  "proxyConfig": {
    "useApifyProxy": true
  }
}' |
apify call dltik/rednote-xiaohongshu-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "RedNote / Xiaohongshu Scraper — Search, Posts, Users, Comments",
        "description": "All-in-one RedNote (Xiaohongshu) scraper: search by keyword, fetch post details, user posts, comments. Get title, content, images, hashtags, likes, collects, comments count, author. China's #1 lifestyle platform, 250M MAU. Cookie-based, $0.005/result.",
        "version": "1.0",
        "x-build-id": "N3tuOMe37eHARcUqz"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/dltik~rednote-xiaohongshu-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-dltik-rednote-xiaohongshu-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/dltik~rednote-xiaohongshu-scraper/runs": {
            "post": {
                "operationId": "runs-sync-dltik-rednote-xiaohongshu-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/dltik~rednote-xiaohongshu-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-dltik-rednote-xiaohongshu-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": [
                    "mode"
                ],
                "properties": {
                    "mode": {
                        "title": "Scraping mode",
                        "enum": [
                            "search",
                            "post",
                            "user_posts",
                            "comments"
                        ],
                        "type": "string",
                        "description": "What to scrape. search = keyword search; post = single note details by URL/ID; user_posts = all notes by a user; comments = comments on a note.",
                        "default": "post"
                    },
                    "queries": {
                        "title": "Search queries (mode=search)",
                        "type": "array",
                        "description": "List of keywords to search. One result per matching note. Example: ['cooking recipes','coffee']",
                        "items": {
                            "type": "string"
                        }
                    },
                    "noteUrls": {
                        "title": "Note URLs or IDs (mode=post or comments)",
                        "type": "array",
                        "description": "Full URLs (https://www.xiaohongshu.com/explore/<id>) or raw 24-char note IDs.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "userIds": {
                        "title": "User profile IDs or URLs (mode=user_posts)",
                        "type": "array",
                        "description": "List of XHS user IDs (24 hex chars) or full profile URLs (https://www.xiaohongshu.com/user/profile/<id>).",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxResultsPerInput": {
                        "title": "Max results per query / user / note",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Cap results per input item. For search: max notes per keyword. For comments: max comments per note. For user_posts: max posts per user.",
                        "default": 50
                    },
                    "cookiesString": {
                        "title": "Cookies (recommended for full data)",
                        "type": "string",
                        "description": "Paste your XHS cookies as a single string (from DevTools → Application → Cookies → xiaohongshu.com → Copy all as 'name=value; name2=value2'). Without cookies, only public note URLs work."
                    },
                    "proxyConfig": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Optional. Recommended: residential proxy from China-friendly region."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
