# RedNote (Xiaohongshu) Scraper — Reliable & Pay-Per-Result (`actorzlab/rednote-scraper`) Actor

Scrape RedNote (Xiaohongshu / 小红书): search notes by keyword, get user posts, fetch note details, and retrieve user profiles. Powered by the proven open-source xhs Python library. Brand monitoring, influencer discovery, competitor analysis, China-market research.

- **URL**: https://apify.com/actorzlab/rednote-scraper.md
- **Developed by:** [Khalil Drissi](https://apify.com/actorzlab) (community)
- **Categories:** Social media, Marketing
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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 — Reliable, Maintained, Pay-Per-Result

Scrape **RedNote (Xiaohongshu / 小红书)** at scale: search notes by keyword, pull all posts from a user, fetch note details, and retrieve user profiles. Built for brand monitoring, influencer discovery, competitor analysis, and China-market research.

**$3 per 1,000 results.** Billed only for successfully scraped records.

---

### Why this Actor

Existing Apify RedNote scrapers average **below 1.5★** because they fight RedNote's signing rotation with hand-rolled implementations that break monthly. This Actor delegates signing to [**xhs**](https://github.com/ReaJason/xhs) — a proven open-source Python library (MIT) that has tracked every signing scheme change since 2023 and was last updated in July 2025. When the upstream releases a fix, we bump our pinned version and redeploy within 48 hours.

**Result:** you get a scraper that breaks less often and recovers faster when RedNote rotates its API.

---

### Features

- **4 modes** — search, user posts, note detail, user profile
- **Structured output** — engagement stats (likes/collects/comments/shares), image URLs, video URL, hashtags, publish time, location
- **Residential proxy support** — recommended for production use
- **Pay-per-result** — $0.003/record, charged only on success
- **Run stats** — every run writes a `runStats` key to the key-value store with item count, version, and error count

---

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `mode` | enum | `search` | `search` / `userPosts` / `note` / `profile` |
| `query` | string | — | Keyword to search (mode=search) |
| `userUrl` | string | — | Profile URL (mode=userPosts, mode=profile) |
| `noteUrl` | string | — | Note URL with xsec_token (mode=note) |
| `maxResults` | integer | 50 | Cap on records extracted (1–1000) |
| `cookie` | string | — | Xiaohongshu web session cookie — **strongly recommended** |
| `includeImages` | boolean | true | Include CDN image URLs in output |
| `proxyConfiguration` | object | RESIDENTIAL | Proxy settings |

#### Getting your cookie

1. Open [xiaohongshu.com](https://www.xiaohongshu.com) and log in
2. Open DevTools (F12) → Network tab → filter by XHR
3. Click any request → Headers → copy the full **Cookie** header value
4. Paste into the `cookie` input field

Without a cookie, most endpoints return authentication errors. The cookie does not expire immediately but may need refreshing if the actor returns auth errors after a few days.

---

### Worked examples

#### Search (brand monitoring)
```json
{
  "mode": "search",
  "query": "Laneige water sleeping mask",
  "maxResults": 200,
  "cookie": "<your-cookie>"
}
````

#### User Posts (influencer content audit)

```json
{
  "mode": "userPosts",
  "userUrl": "https://www.xiaohongshu.com/user/profile/5e1a2b3c4d5e6f7a8b9c0d1e",
  "maxResults": 100,
  "cookie": "<your-cookie>"
}
```

#### Note Detail (competitor research)

```json
{
  "mode": "note",
  "noteUrl": "https://www.xiaohongshu.com/explore/67a1bc2def3456789012abcd?xsec_token=ABCxyz&xsec_source=pc_feed",
  "cookie": "<your-cookie>"
}
```

#### Profile (influencer vetting)

```json
{
  "mode": "profile",
  "userUrl": "https://www.xiaohongshu.com/user/profile/5e1a2b3c4d5e6f7a8b9c0d1e",
  "cookie": "<your-cookie>"
}
```

***

### Output

#### Note record (modes: search, userPosts, note)

```json
{
  "noteId": "67a1bc2def3456789012abcd",
  "url": "https://www.xiaohongshu.com/explore/67a1bc2def3456789012abcd",
  "title": "My daily skincare routine for oily skin",
  "contentText": "Here's what I use every morning #skincare #beauty",
  "author": {
    "userId": "5e1a2b3c4d5e6f7a8b9c0d1e",
    "nickname": "BeautyByLi",
    "avatar": "https://sns-avatar-qc.xhscdn.com/avatar/example.jpg"
  },
  "stats": {
    "likes": 12000,
    "collects": 3456,
    "comments": 789,
    "shares": 234
  },
  "images": [
    "https://sns-img-qc.xhscdn.com/img/example1.jpg"
  ],
  "videoUrl": null,
  "hashtags": ["skincare", "beauty", "oilyskin"],
  "publishTime": "2024-05-24T08:00:00+00:00",
  "location": null,
  "_mode": "search",
  "scrapedAt": "2026-05-24T10:00:00.000000+00:00"
}
```

#### Profile record (mode: profile)

```json
{
  "userId": "abc123def456789012345678",
  "nickname": "FoodieWang",
  "bio": "Food blogger | Beijing & Shanghai | Sharing my best finds",
  "avatar": "https://sns-avatar-qc.xhscdn.com/avatar/foodie.jpg",
  "gender": 2,
  "location": "Beijing",
  "stats": {
    "followers": 123000,
    "following": 456,
    "posts": 234
  },
  "_mode": "profile",
  "scrapedAt": "2026-05-24T10:00:00.000000+00:00"
}
```

***

### Pricing

| Volume | Cost |
|---|---|
| 100 results | $0.30 |
| 1,000 results | $3.00 |
| 10,000 results | $30.00 |

Note: Apify requires a 14-day delay before new pricing takes effect.

***

### How it stays working

RedNote rotates its request-signing scheme roughly every 1–3 months. Instead of re-implementing signing ourselves, this Actor is a thin wrapper around [**xhs**](https://github.com/ReaJason/xhs), an open-source Python library that has tracked every signing change since 2023.

**Our maintenance commitment:**

- When `xhs` releases a signing fix, we bump our pinned version and publish a new Actor build within **48 hours**
- If you hit auth errors, check [our GitHub issues](https://github.com/actorzlab/rednote-scraper/issues) — a fix is likely already in progress
- Subscribe to `xhs` releases at https://github.com/ReaJason/xhs/releases for early warning

See [ATTRIBUTION.md](./ATTRIBUTION.md) for full upstream credit.

***

### Legal notice

RedNote (Xiaohongshu) data includes personal information. Users are responsible for complying with Xiaohongshu's Terms of Service, applicable privacy law (GDPR, PIPL, CCPA), and copyright law. This Actor is intended for legitimate business intelligence, market research, and brand monitoring purposes. Do not use it for harassment, mass-collection of private data, or any purpose that violates applicable law.

# Actor input Schema

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

What to scrape. search — find notes by keyword. userPosts — all notes published by a user. note — details of a specific note. profile — a user's profile information.

## `query` (type: `string`):

Keyword or phrase to search for. Used in mode=search.

## `userUrl` (type: `string`):

Xiaohongshu profile URL. Used in mode=userPosts and mode=profile. Example: https://www.xiaohongshu.com/user/profile/60a1234abc

## `noteUrl` (type: `string`):

Xiaohongshu note URL. Used in mode=note. Copy the full URL including the xsec\_token query parameter if present.

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

Maximum number of records to extract. For search and userPosts, the actor paginates until this limit is reached. For note and profile, this is ignored (always returns 1).

## `cookie` (type: `string`):

Your Xiaohongshu web session cookie. Strongly recommended — without it, most API calls will return auth errors. To get it: open xiaohongshu.com, log in, open DevTools → Network → any XHR request → copy the full Cookie header value.

## `includeImages` (type: `boolean`):

If enabled, the images\[] field contains CDN URLs for all images in each note.

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

Residential proxies recommended. Xiaohongshu blocks many datacenter IPs.

## Actor input object example

```json
{
  "mode": "search",
  "query": "skincare routine",
  "userUrl": "https://www.xiaohongshu.com/user/profile/60a1234abc",
  "noteUrl": "https://www.xiaohongshu.com/explore/67a1234abc?xsec_token=ABCxyz&xsec_source=pc_feed",
  "maxResults": 50,
  "includeImages": true,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

No description

# 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",
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("actorzlab/rednote-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",
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("actorzlab/rednote-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 '{
  "mode": "search",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call actorzlab/rednote-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "RedNote (Xiaohongshu) Scraper — Reliable & Pay-Per-Result",
        "description": "Scrape RedNote (Xiaohongshu / 小红书): search notes by keyword, get user posts, fetch note details, and retrieve user profiles. Powered by the proven open-source xhs Python library. Brand monitoring, influencer discovery, competitor analysis, China-market research.",
        "version": "0.0",
        "x-build-id": "I5sWePtVuiHw6MWk3"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/actorzlab~rednote-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-actorzlab-rednote-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/actorzlab~rednote-scraper/runs": {
            "post": {
                "operationId": "runs-sync-actorzlab-rednote-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/actorzlab~rednote-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-actorzlab-rednote-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": "Mode",
                        "enum": [
                            "search",
                            "userPosts",
                            "note",
                            "profile"
                        ],
                        "type": "string",
                        "description": "What to scrape. search — find notes by keyword. userPosts — all notes published by a user. note — details of a specific note. profile — a user's profile information."
                    },
                    "query": {
                        "title": "Search query",
                        "type": "string",
                        "description": "Keyword or phrase to search for. Used in mode=search."
                    },
                    "userUrl": {
                        "title": "User profile URL",
                        "type": "string",
                        "description": "Xiaohongshu profile URL. Used in mode=userPosts and mode=profile. Example: https://www.xiaohongshu.com/user/profile/60a1234abc"
                    },
                    "noteUrl": {
                        "title": "Note URL",
                        "type": "string",
                        "description": "Xiaohongshu note URL. Used in mode=note. Copy the full URL including the xsec_token query parameter if present."
                    },
                    "maxResults": {
                        "title": "Max results",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Maximum number of records to extract. For search and userPosts, the actor paginates until this limit is reached. For note and profile, this is ignored (always returns 1).",
                        "default": 50
                    },
                    "cookie": {
                        "title": "Xiaohongshu cookie",
                        "type": "string",
                        "description": "Your Xiaohongshu web session cookie. Strongly recommended — without it, most API calls will return auth errors. To get it: open xiaohongshu.com, log in, open DevTools → Network → any XHR request → copy the full Cookie header value."
                    },
                    "includeImages": {
                        "title": "Include image URLs",
                        "type": "boolean",
                        "description": "If enabled, the images[] field contains CDN URLs for all images in each note.",
                        "default": true
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Residential proxies recommended. Xiaohongshu blocks many datacenter IPs."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
