# Xiaohongshu (RedNote) Scraper — Notes, Profiles & Search (`crawloop/xiaohongshu-scraper`) Actor

Scrape Xiaohongshu (RedNote) notes, creator profiles, comments, and keyword search. Get likes, collects, images, video URLs, and hashtags — explore and note pages work with no login. Export JSON via API, Python, Node.js, or MCP.

- **URL**: https://apify.com/crawloop/xiaohongshu-scraper.md
- **Developed by:** [Andrej Kiva](https://apify.com/crawloop) (community)
- **Categories:** Social media, E-commerce, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 1,000 scraped items

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## Xiaohongshu (RedNote) Scraper — Notes, Profiles & Search

> Unofficial tool for publicly accessible Xiaohongshu / RedNote (小红书) data. Xiaohongshu, RedNote, Little Red Book, and related trademarks belong to their respective owners. Not affiliated with, sponsored by, or endorsed by Xingyin Information Technology. Provided for informational use only; users must comply with applicable terms and laws.

| Social discovery | Product launches |
| :--- | :--- |
| **Xiaohongshu (RedNote) Scraper** ◄── you are here | [Product Hunt Scraper](https://apify.com/crawloop/producthunt-scraper) |
| [TikTok Trending Hashtags Scraper](https://apify.com/crawloop/tiktok-trending-hashtags-scraper) | Launches, reviews, comments, leaderboards |
| [Bluesky Scraper](https://apify.com/crawloop/bluesky-scraper) | |
| [YouTube Comments Scraper](https://apify.com/crawloop/youtube-comments-scraper) | |

**Xiaohongshu scraper** and **RedNote API alternative** — extract notes (image and video), creator profiles, comments, and keyword search from Xiaohongshu (小红书 / XHS / Little Red Book) as structured JSON. Each note includes engagement counts (likes, collects, comments, shares), image galleries, playable **video URLs**, hashtags, IP region, and an `xsec_token` you can pipe into the next run.

Scrape Xiaohongshu / RedNote with **Python**, **Node.js**, **cURL**, or **MCP** / AI assistants. Export JSON, CSV, or Excel from the dataset. The public **explore feed, note detail, and profiles do not need a login**. Xiaohongshu gates keyword search and comment threads behind a logged-in `web_session` cookie — paste yours only when you need those modes.

### When to use

- China consumer research, brand listening, and 种草 / haul monitoring before Tmall or JD rankings move
- Influencer / KOL discovery from the recommend feed or a creator profile (Red ID, fans, bio, region)
- Pull a note's body, images, video stream, subtitles, and numeric engagement without the app
- Build an AI training corpus of first-person product reviews from RedNote
- Chain explore → note\_detail: every explore row already carries `xsecToken`

### When not to use

- You need **keyword search or comments without a cookie** — Xiaohongshu login-gates those APIs. This Actor fails the run with a clear message and does not bill empty gated lookups.
- You paste a **bare note ID or an app share link without `xsec_token`** — the site often serves a 404. Copy the address-bar URL, or run **explore** first and reuse the URLs it emits.
- You want **蒲公英 (PGY) rate cards** or mall checkout SKUs — not in this version. Use note + profile fields for creator sizing instead.

### Key features

- **Seven modes** — explore, note detail, user profile, user notes, search notes, search users, comments
- **No login for public surfaces** — recommend explore (~30 notes per reload), note HTML, and profiles
- **Numeric twins for Chinese counts** — `"1.5万"` → `15000`, `"1千+"` → `1000`
- **Video notes** — `h264` master URL, duration, quality, backup CDNs, subtitle URLs when Xiaohongshu publishes them
- **Share links** — `xhslink.com` redirects resolved to a note or profile
- **Cookie is optional and secret** — only search / comments / extra user-note pages need `web_session`
- **Residential proxy recommended** — datacenter IPs hit Xiaohongshu's 安全限制 / 300011 wall

### Input

| Parameter | Description |
|-----------|-------------|
| `mode` | `explore` (default), `note_detail`, `user_profile`, `user_notes`, `search_notes`, `search_users`, `comments` |
| `startUrls` | Note URLs (keep `?xsec_token=`), xhslink shares, or note IDs |
| `userUrls` | Profile URLs or 24-character user IDs |
| `keyword` / `keywords` | Search terms (Chinese or English) |
| `channel` | Explore channel; public SSR is recommend. Other channels need a cookie |
| `fullDetail` | Hydrate each explore/search card to full note HTML |
| `includeNotes` | Profile mode: also emit that creator's note cards |
| `includeComments` | Note detail: also scrape comments (cookie) |
| `maxItems` | Dataset cap (default 50) |
| `maxPages` | How many times to reload explore (feed rotates) |
| `cookie` | Logged-in `web_session` cookie string (secret) |
| `proxyConfiguration` | Apify RESIDENTIAL recommended |

Public recommend feed (first run, no cookie):

```json
{
  "mode": "explore",
  "channel": "recommend",
  "maxItems": 30,
  "maxPages": 1,
  "fullDetail": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  }
}
```

Full note from a token-bearing URL:

```json
{
  "mode": "note_detail",
  "startUrls": [
    {
      "url": "https://www.xiaohongshu.com/explore/69e20e1f000000002200c993?xsec_source=pc_search&xsec_token=ABS0VjfVaGyra8KDJ-TwJ-EwR_lhbirY-atpyynmL16UA="
    }
  ]
}
```

Keyword search (cookie required):

```json
{
  "mode": "search_notes",
  "keyword": "护肤",
  "searchSort": "popular",
  "noteType": "all",
  "maxItems": 40,
  "cookie": "web_session=…; a1=…; webId=…"
}
```

### Output

One dataset row per note, profile, search user, or comment. Filter on `type`.

| Field | Description |
|-------|-------------|
| `type` | `note`, `profile`, `user`, or `comment` |
| `noteId` / `userId` / `commentId` | Xiaohongshu identifiers |
| `title` / `desc` | Note title and body |
| `likedCountNum` / `collectedCountNum` / `commentCountNum` / `shareCountNum` | Parsed engagement |
| `imageUrls` / `coverUrl` / `videoUrl` | HTTPS media |
| `hashtags` | Topic names from `tagList` |
| `xsecToken` | Token to reuse in `note_detail` / `comments` |
| `url` | Shareable note or profile URL |
| `redId` / `fansCount` / `bio` / `ipLocation` | Profile fields |
| `content` / `parentCommentId` / `isReply` | Comment fields |
| `scrapedAt` | UTC timestamp |

Note row (abridged):

```json
{
  "type": "note",
  "source": "note_detail",
  "noteId": "69e20e1f000000002200c993",
  "noteType": "normal",
  "title": "被陌生人问用的什么香水",
  "likedCount": "5301",
  "likedCountNum": 5301,
  "collectedCountNum": 2199,
  "commentCountNum": 269,
  "shareCountNum": 277,
  "hashtags": ["被陌生人问", "香水", "咖啡店", "日本生活记录"],
  "userId": "6302a7dc000000001200ec31",
  "userNickname": "yaya",
  "url": "https://www.xiaohongshu.com/explore/69e20e1f000000002200c993?xsec_token=…",
  "xsecToken": "ABS0VjfVaGyra8KDJ-TwJ-EwR_lhbirY-atpyynmL16UA="
}
```

### Use cases

- Track which beauty / fashion / food notes are surfacing on the public recommend feed
- Export a creator's profile (Red ID, region, fans, bio) plus their latest cards
- Collect image URLs and video streams for a specific viral note
- Search `口红` / `camping gear` once you have a session cookie, then hydrate full detail
- Sentiment on a campaign note via comments (cookie)
- Feed RedNote JSON into an MCP / agent workflow instead of screenshotting the app

### Integration examples

Replace `YOUR_TOKEN` with your Apify API token. Actor name: `crawloop/xiaohongshu-scraper`.

#### Node.js

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('crawloop/xiaohongshu-scraper').call({
  mode: 'explore',
  maxItems: 20,
  proxyConfiguration: { useApifyProxy: true, apifyProxyGroups: ['RESIDENTIAL'] },
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0]);
```

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")
run = client.actor("crawloop/xiaohongshu-scraper").call(
    run_input={
        "mode": "note_detail",
        "startUrls": [
            {
                "url": "https://www.xiaohongshu.com/explore/69e20e1f000000002200c993?xsec_token=ABS0VjfVaGyra8KDJ-TwJ-EwR_lhbirY-atpyynmL16UA="
            }
        ],
    }
)
items = client.dataset(run["defaultDatasetId"]).list_items().items
print(items[0]["title"], items[0]["likedCountNum"])
```

#### cURL

```bash
curl "https://api.apify.com/v2/acts/crawloop~xiaohongshu-scraper/runs?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"mode":"explore","maxItems":10}'
```

### MCP and AI assistants

Use this Actor from AI tools via [Apify MCP](https://docs.apify.com/platform/integrations/mcp).
Connect your Apify account, then call this Actor by its Store ID / name.

Example prompts:

- "Run Xiaohongshu (RedNote) Scraper in explore mode for 20 notes and return title, likes, hashtags, and author as JSON"
- "Scrape this Xiaohongshu note URL with crawloop/xiaohongshu-scraper and summarize engagement, images, and video URL"
- "Chain Xiaohongshu (RedNote) Scraper explore into note\_detail using each row's url, then compare with TikTok Trending Hashtags Scraper for the same campaign week"

### Suite next step

After you have note URLs and `xsecToken` values, run **note\_detail** (or **user\_profile** on `userUrl`) in a second run. For Western trend context on the same brief, use [TikTok Trending Hashtags Scraper](https://apify.com/crawloop/tiktok-trending-hashtags-scraper).

### FAQ

**Is this a Little Red Book / XHS / 小红书 scraper?**\
Yes. Xiaohongshu, RedNote, Little Red Book, XHS, and 小红书 are the same platform. This Actor reads the public web app.

**Do I need a Xiaohongshu account?**\
Not for explore, note pages that already have `xsec_token`, or public profiles. Search and comments yes — paste your own `web_session`.

**Where does `xsec_token` come from?**\
Explore and search output include it on every note URL. You can also copy it from the browser address bar after opening a note, or from Share → Copy link.

**Why are profile note IDs empty?**\
Anonymous HTML often strips `noteId` on a creator's grid and keeps title, likes, cover, and `xsecToken`. Add a cookie or run **explore** (those cards include IDs).

**Is this an official Xiaohongshu API?**\
No. It is a **Xiaohongshu API alternative**: it reads the same public web pages a browser does (`window.__INITIAL_STATE__`) plus optional signed endpoints when you provide a cookie. No Xiaohongshu developer key.

**Can I scrape Xiaohongshu with Python or Node.js?**\
Yes. Use the Apify client examples above, or call the Actor from MCP / an AI assistant and export the dataset as JSON.

### Related Actors

- [TikTok Trending Hashtags Scraper](https://apify.com/crawloop/tiktok-trending-hashtags-scraper)
- [Bluesky Scraper](https://apify.com/crawloop/bluesky-scraper)
- [YouTube Comments Scraper](https://apify.com/crawloop/youtube-comments-scraper)

# Actor input Schema

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

What to scrape. Explore, note detail, and profiles work without a login cookie. Keyword search, user search, and comments need a logged-in web\_session cookie.

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

Note pages for note\_detail and comments. Prefer the full URL with ?xsec\_token=… (copy from the address bar or from explore/search output). Also accepts xhslink.com share links and bare 24-character note IDs.

## `userUrls` (type: `array`):

Creator profiles for user\_profile and user\_notes (https://www.xiaohongshu.com/user/profile/… or a 24-character user ID).

## `keyword` (type: `string`):

Single search term (Chinese or English) for search\_notes / search\_users. Merged with Keywords.

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

Extra search terms. Each keyword is scraped independently up to Max items.

## `channel` (type: `string`):

Public SSR explore feed is Xiaohongshu's recommend homefeed. Other channels need a cookie (signed homefeed); without one this Actor falls back to recommend.

## `xsecToken` (type: `string`):

Used when a note URL has no token. Explore/search output already includes xsecToken on every note — pipe those URLs instead of typing this.

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

Ranking for search\_notes: comprehensive, most popular, or newest.

## `noteType` (type: `string`):

Filter search\_notes by image notes, video notes, or both.

## `fullDetail` (type: `boolean`):

Explore / search / user\_notes: open each discovered note and replace the card with full title, body, images, video URL, tags, and all engagement counts. Slower (one HTML request per note).

## `includeNotes` (type: `boolean`):

user\_profile: also emit that creator's public note cards (anonymous access often strips per-note IDs; add a cookie for IDs you can pipe into note\_detail).

## `includeComments` (type: `boolean`):

note\_detail: also scrape comments. Needs a cookie for a non-empty thread.

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

When scraping comments, emit nested replies as separate rows with parentCommentId set.

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

Hard cap on dataset rows for the whole run. 0 = no cap (Actor still stops at a safety limit). Default 50.

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

How many times to reload the public explore feed. The recommend feed rotates, so extra pages usually add new unique notes (deduped by note ID).

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

Cap on comment rows per note (including replies when Include comment replies is on).

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

Optional. Logged-in www.xiaohongshu.com cookies as `name=value; name2=value2`. Must include web\_session and a1 for search, user search, comments, and extra user-notes pages. DevTools → Application → Cookies → copy. Never stored outside this run.

## `requestDelaySecs` (type: `number`):

Throttle HTML/API calls. Raise if you see captchas (461/471) or empty SSR.

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

Apify RESIDENTIAL is recommended. Datacenter IPs often hit Xiaohongshu's 安全限制 / 300011 wall.

## Actor input object example

```json
{
  "mode": "explore",
  "startUrls": [
    {
      "url": "https://www.xiaohongshu.com/explore/69e20e1f000000002200c993?xsec_source=pc_search&xsec_token=ABS0VjfVaGyra8KDJ-TwJ-EwR_lhbirY-atpyynmL16UA="
    }
  ],
  "userUrls": [
    "https://www.xiaohongshu.com/user/profile/6302a7dc000000001200ec31"
  ],
  "keyword": "",
  "keywords": [],
  "channel": "recommend",
  "xsecToken": "",
  "searchSort": "general",
  "noteType": "all",
  "fullDetail": false,
  "includeNotes": false,
  "includeComments": false,
  "includeReplies": true,
  "maxItems": 50,
  "maxPages": 1,
  "maxComments": 50,
  "requestDelaySecs": 0.45,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

Default dataset items (one row per note, profile, user, or comment).

# 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 = {
    "startUrls": [
        {
            "url": "https://www.xiaohongshu.com/explore/69e20e1f000000002200c993?xsec_source=pc_search&xsec_token=ABS0VjfVaGyra8KDJ-TwJ-EwR_lhbirY-atpyynmL16UA="
        }
    ],
    "userUrls": [
        "https://www.xiaohongshu.com/user/profile/6302a7dc000000001200ec31"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawloop/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 = {
    "startUrls": [{ "url": "https://www.xiaohongshu.com/explore/69e20e1f000000002200c993?xsec_source=pc_search&xsec_token=ABS0VjfVaGyra8KDJ-TwJ-EwR_lhbirY-atpyynmL16UA=" }],
    "userUrls": ["https://www.xiaohongshu.com/user/profile/6302a7dc000000001200ec31"],
}

# Run the Actor and wait for it to finish
run = client.actor("crawloop/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 '{
  "startUrls": [
    {
      "url": "https://www.xiaohongshu.com/explore/69e20e1f000000002200c993?xsec_source=pc_search&xsec_token=ABS0VjfVaGyra8KDJ-TwJ-EwR_lhbirY-atpyynmL16UA="
    }
  ],
  "userUrls": [
    "https://www.xiaohongshu.com/user/profile/6302a7dc000000001200ec31"
  ]
}' |
apify call crawloop/xiaohongshu-scraper --silent --output-dataset

```

## MCP server setup

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