# Xiaohongshu (RedNote/小红书) Notes & Video Scraper (`fetchfinch/xiaohongshu-scraper`) Actor

Collect public Xiaohongshu (RedNote/小红书) notes from URLs, feeds, and sitemaps. Export post details, creator profiles, and optional MP4/image downloads. Experimental search and comments require your own session cookie.

- **URL**: https://apify.com/fetchfinch/xiaohongshu-scraper.md
- **Developed by:** [Fetch Finch](https://apify.com/fetchfinch) (community)
- **Features:** Limited permissions
- **Stats:** 10 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.99 / 1,000 note 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

### Scrape Xiaohongshu (RedNote/小红书) notes and videos

![Public access](https://img.shields.io/badge/Public%20access-Anonymous%20mode-43A047)
![Pricing](https://img.shields.io/badge/Pricing-Pay%20per%20event-5C6BC0)
![Runtime](https://img.shields.io/badge/Runtime-HTTP%20only-3178C6)
![Output](https://img.shields.io/badge/Output-Structured%20JSON-F39C12)
![Media](https://img.shields.io/badge/Media-MP4%20%2B%20images-8E44AD)
![Examples](https://img.shields.io/badge/Examples-5%20workflows-00A98F)

Collect public Xiaohongshu notes from a post link, Explore feed, or sitemap. Get text, authors, engagement, images, video streams, and optional media files in structured Apify outputs. Creator profiles are also available. Search, comments, and extended profile pagination need your own Xiaohongshu session cookie; those session-based paths have not yet been verified with a live account.

You can start with a URL and a result limit. The Actor uses HTTP requests throughout the run, including video downloads.

### Start in one minute

1. Paste a Xiaohongshu note, profile, Explore, or sitemap URL into **Start URLs**. You can also use **Sitemap URLs** for `.xml.gz` files.
2. Set **Maximum notes or users** to control the run size. Turn on **Download videos** or **Download note images** if you want files saved.
3. Run the Actor. Open the **Output** tab for notes, users, comments, errors, and downloaded media.

For a quick public feed run, use:

```json
{
  "startUrls": [{ "url": "https://www.xiaohongshu.com/explore" }],
  "maxItems": 25,
  "includeNoteDetails": true
}
```

If you leave URLs and search queries empty, the Actor starts from the public Explore feed.

### What you can collect

| Source | Data returned | Session needed? |
| --- | --- | --- |
| Note or video URL | Full text, author, publication time, tags, engagement, images, video streams, subtitles when available | Usually no; keep the `xsec_token` in shared links |
| Explore feed | Note cards, with optional full note details | Usually no |
| Public `.xml` or `.xml.gz` sitemap | Note URLs followed up to your `maxItems` limit | Usually no |
| Creator profile | Public profile and visible note previews | Usually no |
| Keyword search | Paginated notes or users; sort and note type filters | Yes; experimental |
| Note comments | Top-level comments and optional replies | Yes; experimental |
| Creator's full posted-note list | Additional pages beyond public previews | Yes; experimental |

Public access depends on the note, its share token, the IP address, and Xiaohongshu's current controls. An Explore category is a discovery hint; the public feed may include posts outside that category.

### Outputs

The **Output** tab separates records by type, so you can review or export each dataset without filtering mixed rows.

| Output | What it contains | Useful fields |
| --- | --- | --- |
| **Notes and videos** | One record per collected note, including video notes | `noteId`, `url`, `title`, `description`, `author`, `counts`, `tags`, `images`, `video` |
| **User profiles** | Creator details and any visible note previews | `userId`, `nickname`, `redId`, `followers`, `following`, `notePreviews` |
| **Comments** | Top-level comments and replies collected with a session | `commentId`, `noteId`, `parentCommentId`, `content`, `author`, `likes` |
| **Downloaded videos** | MP4 files saved when `downloadVideos` is enabled | Key shown in the note's `video.storageKey` |
| **Downloaded images** | Image files saved when `downloadImages` is enabled | Keys shown in `images[].storageKey` |
| **Errors** | URLs or queries that could not be collected | `sourceUrl`, `errorType`, `message` |

Notes and profiles include a `fetchedAt` timestamp. If a profile page shows cards without usable note IDs, the profile record keeps them as `notePreviews` and marks `profileNotesStatus` as `previews_only`.

### Pricing

Pay per event charges for saved results and downloaded files. The note price applies to posts found through URLs, feeds, sitemaps, or session-based search.

| Event | Price | When it is charged |
| --- | ---: | --- |
| Actor start | $0.00005 per run at the default 1 GB memory | When a run starts |
| Note result | $0.00599 per note ($5.99 per 1,000) | A note is saved to **Notes** |
| Creator profile | $0.00990 per profile | A profile is saved to **User profiles** |
| Comment or reply | $0.00299 per row | A comment or reply is saved with a valid session |
| Downloaded media | $0.00008 per MiB | A video or image is saved; each file is rounded up to the next MiB |

For example, one note with a 22 MiB video costs about **$0.00780** in Actor events, including the start event. Failed page requests do not create result charges, though the start event still applies. Set a maximum run cost in Apify to control your budget; the minimum configurable budget is $0.01. The actual charge can be lower.

### Example workflows

These inputs are templates. Replace the URLs and limits with your own project data.

| Goal | Suggested input | Result |
| --- | --- | --- |
| Monitor the public feed | Explore URL, `maxItems`, `includeNoteDetails` | Feed note details for research or tracking |
| Discover notes in bulk | `sitemapUrls` with a `.xml.gz` URL | Public notes without compiling individual links |
| Archive a video | Note URL, `downloadVideos`, `videoQuality` | Note metadata plus an MP4 in the key-value store |
| Review a creator | Profile URL, `includeProfileNotes` | Profile metrics and visible note previews |
| Search a topic and read discussion | `searchQueries`, `maxComments`, `maxReplies`, `cookie` | Experimental session-based notes and comments in separate datasets |

#### Discover notes from a compressed sitemap

```json
{
  "sitemapUrls": ["https://www.xiaohongshu.com/sitemap-notes-0.xml.gz"],
  "maxItems": 50,
  "includeNoteDetails": true
}
```

#### Download a public video

```json
{
  "startUrls": [
    { "url": "https://www.xiaohongshu.com/explore/6a985c8200000000260151fe?xsec_token=ABYtezdGaenJz0DsjVYuLtMUk9nCt2KwtNS887ZxDRO2w%3D&xsec_source=pc_feed" }
  ],
  "maxItems": 1,
  "downloadVideos": true,
  "videoQuality": "compatible",
  "maxMediaMegabytes": 100
}
```

The share token and media links can expire. If this example stops working, replace its URL with a fresh Xiaohongshu share link. Choose `best` for the highest available resolution, `smallest` for a smaller file, or `compatible` to prefer H.264 when available.

#### Review a creator's public profile

```json
{
  "startUrls": [{ "url": "https://www.xiaohongshu.com/user/profile/637f9a1d000000001f019734" }],
  "maxItems": 1,
  "includeProfileNotes": true
}
```

#### Search Chinese notes and collect comments

```json
{
  "searchQueries": ["旅行"],
  "searchSort": "latest",
  "maxItems": 50,
  "maxComments": 20,
  "maxReplies": 5,
  "cookie": "a1=...; web_session=..."
}
```

Use the `a1` and `web_session` values from the same signed-in browser session. The **Session cookie** input is a secret field. Search and comments require a valid session and are experimental until tested with a live account; the example values above are placeholders.

### Input options

| Input | Default | What it controls |
| --- | --- | --- |
| `startUrls` | Explore feed if no seeds are given | Note, profile, Explore, search, or sitemap URLs |
| `sitemapUrls` | Empty | Public XML or compressed XML sitemap URLs |
| `searchQueries` | Empty | Keywords for note or user search; requires a session |
| `searchType` | `notes` | Search notes or users |
| `searchSort` / `searchNoteType` | `general` / `all` | Note search order and video/image filter |
| `feedCategory` | `recommend` | Explore category to request |
| `maxItems` | `100` | Maximum note and user records combined |
| `includeNoteDetails` / `includeProfileNotes` | `true` / `true` | Fetch full note pages and available profile notes |
| `maxComments` / `maxReplies` | `0` / `0` | Top-level comments per note and replies per comment |
| `downloadVideos` / `downloadImages` | `false` / `false` | Save media files to the run's key-value store |
| `videoQuality` / `maxMediaMegabytes` | `best` / `100` | Video stream preference and per-file size cap |
| `cookie` | Empty | Your Xiaohongshu session for search, comments, and extended profile notes |
| `proxyConfiguration` | No proxy | Optional Apify proxy settings |
| `requestDelayMillis` / `maxRetries` | `800` / `3` | Request pacing and retries for temporary failures |

`maxItems` counts notes and users. Comments have separate per-note limits. Media files use the per-file size cap, so a note can still be collected when a download cannot be saved.

### Access and troubleshooting

| Situation | What to do |
| --- | --- |
| A note opens a login prompt in a browser | Try its full share URL, including `xsec_token`. The Actor reads the public note data directly when available. |
| A URL redirects to login or has no public note data | Check the **Errors** output and try a fresh share URL or a sitemap seed. Some content is unavailable without a session. |
| Search or comments report `login_required` | Supply a valid `a1` and `web_session` cookie pair from your own account. |
| A video has stream details but no saved MP4 | Check `video.downloadError`, increase `maxMediaMegabytes` if appropriate, or retry with a fresh share URL. |
| A profile has previews but no full note list | Public profile pages may omit note IDs; a valid session is needed for extended pagination. |

The Actor reads public pages and data accessible to the supplied session. It does not create accounts, solve captchas, or interact with posts.

# Actor input Schema

## `startUrls` (type: `array`):

Xiaohongshu note, profile, explore, search, or sitemap URLs. Preserve xsec_token query parameters.

## `sitemapUrls` (type: `array`):

Optional public Xiaohongshu XML or XML.GZ sitemap URLs. The actor stops at maxItems.

## `searchQueries` (type: `array`):

Experimental keyword search. Requires a valid logged-in cookie; not yet verified with a live session.

## `searchType` (type: `string`):

Search notes or creator accounts.

## `searchSort` (type: `string`):

Sort note search results by relevance, popularity, or newest.

## `searchNoteType` (type: `string`):

Filter note search results to all, videos, or image posts.

## `feedCategory` (type: `string`):

Category to use for explore feed discovery.

## `maxItems` (type: `integer`):

Maximum number of note and user records. Comments are capped separately.

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

Maximum top-level comments to collect per note. Zero disables comments.

## `maxReplies` (type: `integer`):

Maximum replies to collect per top-level comment.

## `includeNoteDetails` (type: `boolean`):

Fetch each discovered note page for full text and media metadata.

## `includeProfileNotes` (type: `boolean`):

Include publicly visible profile note previews and, with a session, full posted notes.

## `downloadVideos` (type: `boolean`):

Store the best available MP4 in the Actor key-value store and include its key in the note record.

## `videoQuality` (type: `string`):

Best resolution, smallest file, or H.264-compatible stream when available.

## `downloadImages` (type: `boolean`):

Save note images to the Actor key-value store.

## `maxMediaMegabytes` (type: `integer`):

Maximum size of each downloaded video or image.

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

Optional browser Cookie header containing a1 and web_session. Required for search and comments.

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

Apify proxy configuration for access and rotation.

## `requestDelayMillis` (type: `integer`):

Minimum spacing between HTTP requests.

## `maxRetries` (type: `integer`):

Retries for transient network, rate-limit, or server errors.

## Actor input object example

```json
{
  "startUrls": [],
  "sitemapUrls": [],
  "searchQueries": [],
  "searchType": "notes",
  "searchSort": "general",
  "searchNoteType": "all",
  "feedCategory": "recommend",
  "maxItems": 100,
  "maxComments": 0,
  "maxReplies": 0,
  "includeNoteDetails": true,
  "includeProfileNotes": true,
  "downloadVideos": false,
  "videoQuality": "best",
  "downloadImages": false,
  "maxMediaMegabytes": 100,
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "requestDelayMillis": 800,
  "maxRetries": 3
}
```

# Actor output Schema

## `notes` (type: `string`):

Public note records with text, engagement, images, video streams, and subtitle links.

## `users` (type: `string`):

Public creator profiles and visible note previews.

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

Top-level comments and replies when a valid session cookie is supplied.

## `videos` (type: `string`):

MP4 files saved when downloadVideos is enabled.

## `images` (type: `string`):

Images saved when downloadImages is enabled.

## `errors` (type: `string`):

Failed or login-gated requests that did not produce a note or profile.

# 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 = {};

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

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

```

## MCP server setup

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