# Xiaohongshu (RedNote) Scraper — XHS Notes, Search & Comments (`brick_joey_yto/xiaohongshu-scraper`) Actor

Scrape Xiaohongshu / RedNote (XHS): note search by keyword, note detail, comment trees, creator profiles and trending hot-list. Signed web-API client — supply your own web_session cookie, no third-party API key needed. $1/1,000 rows.

- **URL**: https://apify.com/brick_joey_yto/xiaohongshu-scraper.md
- **Developed by:** [William Billings](https://apify.com/brick_joey_yto) (community)
- **Categories:** Social media, Developer tools, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 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.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Xiaohongshu (RedNote) Scraper — XHS notes, search, comments & trends

The only Xiaohongshu / RedNote (XHS, 小红书) data actor that runs on **your own account cookie** — no per-call API reseller markup, no third-party key. One input gives you note search, full note detail, comment trees, creator profiles and the XHS trending hot-list in one normalized schema.

XHS is China's most influential social-commerce platform — product discovery, KOL marketing and consumer trend data that doesn't exist anywhere else. Western sellers and brands use it to track Chinese consumer trends, monitor competitor campaigns and find KOL partners.

### How it works

| Mode | Input | Output |
|---|---|---|
| `search` | Keywords | Notes matching each keyword (20/page, auto-paginated) |
| `note` | Note URL / ID / share link | Full note detail — title, desc, likes, images, video, tags |
| `comments` | Note URL / ID | Complete comment tree with authors and likes |
| `user` | Profile URL / ID | Creator profile (followers, notes, likes) + their posted notes |
| `hot` | — | Trending XHS search hot-list |

### What you need (setup, 2 minutes)

XHS requires a logged-in session for its data endpoints — there is no anonymous API. This actor signs every request exactly like the official web app; you supply one cookie value:

1. Log in at [xiaohongshu.com](https://www.xiaohongshu.com) (any account — international phone numbers work)
2. Open devtools → **Application → Cookies → xiaohongshu.com**
3. Copy the **`web_session`** value into the `xhsCookie` input (or paste the whole cookie string)

That's it — the actor generates the device fingerprint (`a1`, `webId`) and all `X-s`/`X-s-common`/`X-t` request signatures itself. Residential proxies are recommended for heavy runs and can be enabled in **Proxy configuration**.

### Example input

```json
{
  "mode": "search",
  "keywords": ["skincare", "luxury bags"],
  "xhsCookie": "web_session=YOUR_VALUE",
  "sort": "popularity_descending",
  "maxPages": 3
}
```

```json
{
  "mode": "comments",
  "targets": ["https://www.xiaohongshu.com/explore/64ab12cd000000001c00c35e"],
  "xhsCookie": "web_session=YOUR_VALUE",
  "maxComments": 500
}
```

`targets` also accepts `xhslink.com` share links — they're resolved automatically.

### Example output

```json
{
  "recordType": "note",
  "noteId": "64ab12cd000000001c00c35e",
  "type": "normal",
  "title": "5 products I repurchased 3 times",
  "desc": "Honest skincare review after 6 months...",
  "likedCount": 18432,
  "collectedCount": 9201,
  "commentCount": 1204,
  "shareCount": 887,
  "time": 1760000000000,
  "userId": "5f8e7d6c0000000001004e28",
  "nickname": "小鹿测评",
  "tags": ["skincare", "review"],
  "imageUrls": ["https://sns-na-i1.xhscdn.com/..."],
  "url": "https://www.xiaohongshu.com/explore/64ab12cd000000001c00c35e",
  "scrapedAt": "2026-10-04T21:00:00.000000+00:00"
}
```

### Use cases

- **Cross-border e-com sellers** — product research: what Chinese consumers actually buy and discuss
- **Brands entering China** — competitor campaign monitoring, KOL discovery and vetting
- **Agencies** — comment sentiment mining for brand campaigns
- **Researchers / AI builders** — Chinese-language social content datasets
- **Trend watchers** — `hot` mode on a schedule = daily XHS trend feed

### Pricing

Pay per dataset row — **$1 per 1,000 results**. A 3-page keyword search costs ~$0.06. No subscriptions, no per-call markup; you pay only for rows returned.

### FAQ

**Why do I need a cookie?** XHS login-walls all data endpoints — every actor in this niche either resells API access at a markup (socialdatax et al.) or uses your cookie. With your own `web_session` you get the full official data at Apify cost — nothing in between.

**Is my cookie safe?** The `xhsCookie` input is marked secret and never logged or stored beyond the run. XHS cookies are account-bound — the actor only reads public data, the same requests your browser makes.

**Do I need residential proxies?** Recommended for volume — XHS risk-controls datacenter IPs harder than residential ones. Enable **Apify proxy → RESIDENTIAL** in proxy configuration for long runs.

**Does it work without a cookie?** The run still succeeds and emits an error row explaining what's needed — useful for testing the pipeline before adding credentials.

### Limitations

- Requires your own XHS account (free to register — international numbers accepted)
- Cookies expire (weeks) — refresh `xhsCookie` if runs start returning auth errors
- XHS risk control can rate-limit heavy runs — use residential proxies and moderate page counts
- Follower/note counts on profiles are what the web API returns

**Is it legal to scrape this data?** The actor only accesses publicly available data — the same pages/APIs a browser sees. Scraping public data for research, monitoring, and analysis is common practice, but platform Terms of Service and the rules in your jurisdiction still apply to how you use it. Consult legal counsel for your specific case.

### More from this developer

**Monitors & business intel:** [ATS Jobs Monitor](https://apify.com/brick_joey_yto/ats-jobs-monitor) · [Sports Scores & Odds Monitor](https://apify.com/brick_joey_yto/sports-scores-odds-monitor) · [Prediction Markets Monitor](https://apify.com/brick_joey_yto/prediction-markets-monitor) · [Crypto Token Monitor](https://apify.com/brick_joey_yto/crypto-token-monitor) · [Crypto Derivatives Monitor](https://apify.com/brick_joey_yto/crypto-derivatives-monitor) · [Google News Monitor](https://apify.com/brick_joey_yto/google-news-monitor) · [App Store Monitor](https://apify.com/brick_joey_yto/app-store-monitor) · [Pump.fun Monitor](https://apify.com/brick_joey_yto/memecoin-launch-monitor) · [StockTwits Scraper](https://apify.com/brick_joey_yto/stocktwits-scraper) · [Yahoo Finance Scraper](https://apify.com/brick_joey_yto/yahoo-finance-scraper) · [Product Hunt Monitor](https://apify.com/brick_joey_yto/product-hunt-monitor) · [Hacker News Monitor](https://apify.com/brick_joey_yto/hackernews-monitor) · [AI Visibility Tracker](https://apify.com/brick_joey_yto/ai-brand-monitor)

**Alt-social & OSINT:** [Gab Scraper](https://apify.com/brick_joey_yto/gab-search-scraper) · [BitChute Scraper](https://apify.com/brick_joey_yto/bitchute-search-scraper) · [Truth Social Scraper](https://apify.com/brick_joey_yto/truth-social-scraper) · [Telegram Scraper](https://apify.com/brick_joey_yto/telegram-scraper) · [Discord Scraper](https://apify.com/brick_joey_yto/discord-scraper) · [Rumble Video Scraper](https://apify.com/brick_joey_yto/rumble-video-scraper) · [Odysee Scraper](https://apify.com/brick_joey_yto/odysee-scraper) · [Kick Scraper](https://apify.com/brick_joey_yto/kick-scraper) · [4chan Scraper](https://apify.com/brick_joey_yto/4chan-scraper) · [Bitcointalk Scraper](https://apify.com/brick_joey_yto/bitcointalk-scraper)

**Creator platforms:** [Bluesky Scraper](https://apify.com/brick_joey_yto/bluesky-search-scraper) · [Threads Scraper](https://apify.com/brick_joey_yto/threads-profile-scraper) · [Farcaster Scraper](https://apify.com/brick_joey_yto/farcaster-scraper) · [Spoutible Scraper](https://apify.com/brick_joey_yto/spoutible-scraper) · [Pixelfed Scraper](https://apify.com/brick_joey_yto/pixelfed-scraper) · [Substack Notes Scraper](https://apify.com/brick_joey_yto/substack-notes-scraper) · [Dailymotion Scraper](https://apify.com/brick_joey_yto/dailymotion-scraper) · [Roblox Scraper](https://apify.com/brick_joey_yto/roblox-scraper)

**Gov & regulatory:** [Federal Register Monitor](https://apify.com/brick_joey_yto/federal-register-monitor) · [Federal Court Monitor](https://apify.com/brick_joey_yto/federal-court-monitor) · [FDA Compliance Monitor](https://apify.com/brick_joey_yto/fda-compliance-monitor) · [Clinical Trials Monitor](https://apify.com/brick_joey_yto/clinical-trials-monitor) · [Lobbying Monitor](https://apify.com/brick_joey_yto/lobbying-monitor)

# Actor input Schema

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

What to do

## `keywords` (type: `array`):

Search mode: keywords to search (one run per keyword). Example: \["skincare", "luxury bag"]

## `targets` (type: `array`):

note/comments/user modes: note or profile URLs, xhslink.com share links, or bare 24-char note/user IDs

## `xhsCookie` (type: `string`):

Your XHS login cookie — paste the full cookie string or just the 'web_session' value (devtools → Application → Cookies → xiaohongshu.com). Required for search, comments, user and note detail.

## `sort` (type: `string`):

Ordering for keyword search results

## `maxPages` (type: `integer`):

Search mode: result pages per keyword (20 notes per page)

## `maxComments` (type: `integer`):

Comments mode: cap per note

## `maxUserNotes` (type: `integer`):

User mode: posted-notes cap per user

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

Overall row cap across all targets

## `proxyConfiguration` (type: `object`):

Residential proxies strongly recommended — XHS aggressively gates datacenter IPs

## Actor input object example

```json
{
  "mode": "search",
  "keywords": [],
  "targets": [],
  "sort": "general",
  "maxPages": 3,
  "maxComments": 200,
  "maxUserNotes": 50,
  "maxResults": 500
}
```

# Actor output Schema

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

Dataset containing note, comment, user and hot-search rows

# 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 = {
    "mode": "search"
};

// Run the Actor and wait for it to finish
const run = await client.actor("brick_joey_yto/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 = { "mode": "search" }

# Run the Actor and wait for it to finish
run = client.actor("brick_joey_yto/xiaohongshu-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 '{
  "mode": "search"
}' |
apify call brick_joey_yto/xiaohongshu-scraper --silent --output-dataset

```

## MCP server setup

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