# RedNote (Xiaohongshu) Search Scraper (`memo23/rednote-search-scraper`) Actor

Search RedNote / Xiaohongshu (小红书) notes by keyword — relevance, hottest, or newest. Each row: note ID, title, author, like/collect/comment counts, cover image, and a ready-to-scrape URL with xsec\_token. Login cookie required (search is gated). Chinese counts parsed to numbers.

- **URL**: https://apify.com/memo23/rednote-search-scraper.md
- **Developed by:** [Muhamed Didovic](https://apify.com/memo23) (community)
- **Categories:** Social media
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.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?

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

## RedNote (Xiaohongshu) Search Scraper

**Search 小红书 notes by keyword and get structured rows: title, author, engagement counts, cover, and a ready-to-scrape note URL with its `xsec_token`.**

Xiaohongshu (RedNote / Little Red Book) gates keyword search behind login. This actor signs every request through Xiaohongshu's own web signing (x-s / x-t) using a headless page, so your searches behave like a real browser session — you just supply a `web_session` cookie from an account you control.

### What you get per note

| Field | Description |
| --- | --- |
| `noteId` | 24-hex note ID |
| `noteType` | `normal` (image post) or `video` |
| `noteTitle` | Display title |
| `likedCount` / `likedCountNum` | Likes as shown (e.g. `1.2万`) and parsed to a number (12000) |
| `collectedCount`, `commentCount` | Saves and comments |
| `userId`, `userName`, `userAvatar` | Author |
| `noteCoverUrl` | Cover image URL |
| `noteUrl` + `xsecToken` | Ready to paste into the [Note Detail](https://apify.com/memo23/rednote-note-detail-scraper) or [Comments](https://apify.com/memo23/rednote-comments-scraper) scraper |

Sort by **comprehensive** (Xiaohongshu's default ranking), **most popular**, or **newest**. Paginate up to 100 pages (~20 notes per page), cap total rows with `maxItems`.

### How to get the `web_session` cookie

1. Log in at [xiaohongshu.com](https://www.xiaohongshu.com) in your browser.
2. Open DevTools → **Application** → **Cookies** → `https://www.xiaohongshu.com`.
3. Copy the value of `web_session` and paste it into the input. Pasting your whole cookie string also works — the actor extracts what it needs.

The cookie stays yours: it is marked secret in the input schema and is never logged.

### Example input

```json
{
    "keyword": "skincare",
    "searchSort": "popularity_descending",
    "maxPages": 3,
    "webSession": "<your web_session value>"
}
```

### FAQ

**Why do I need a cookie at all?** Xiaohongshu returns a login wall for guest search API calls. Note detail, user profiles, and category feeds are open — search and comments are not. If you only need a single note's data, the [Note Detail scraper](https://apify.com/memo23/rednote-note-detail-scraper) needs no login.

**The run fails immediately with a session error.** The `web_session` value is expired or from a logged-out browser. Log in again and copy a fresh value — the actor fails fast instead of burning your budget on doomed requests.

**Are the Chinese counts usable in spreadsheets?** Yes — every count comes twice: as displayed (`1.2万`) and parsed (`12000`) in the `*Num` twin field.

### Related scrapers

- [RedNote Note Detail Scraper](https://apify.com/memo23/rednote-note-detail-scraper) — one note's full data, no login
- [RedNote Comments Scraper](https://apify.com/memo23/rednote-comments-scraper) — full comment threads
- [Xiaohongshu (RedNote) Scraper](https://apify.com/memo23/xiaohongshu-rednote-scraper) — the all-in-one actor: 8 operations including user profiles, channel feeds, and mall products

### 🤖 For AI Agents & LLM Apps

Compact reference for AI agents calling this actor via the [Apify MCP server](https://mcp.apify.com) or the Apify API (actor: `memo23/rednote-search-scraper`).

**Purpose:** Keyword-searches Xiaohongshu (RedNote / 小红书) notes and returns structured rows — title, author, engagement counts, cover image, and a ready-to-scrape note URL with its `xsec_token`.

**Minimal input:**

```json
{
  "keyword": "skincare",
  "webSession": "<your web_session cookie value>",
  "searchSort": "general",
  "maxPages": 1,
  "maxItems": 20
}
```

**Output:** one dataset row per note; key fields: noteId, noteType, noteTitle, likedCount, likedCountNum, collectedCount, commentCount, userId, userName, userAvatar, noteCoverUrl, noteUrl, xsecToken. Each engagement count also has a numeric `*Num` twin (Chinese `1.2万` → `12000`).

**Behaviors an agent should know:**

- Requires a logged-in Xiaohongshu `web_session` cookie — keyword search is login-gated. An expired/logged-out value fails the run fast. `webSession` is marked secret and never logged.
- Always set `maxItems` (and/or `maxPages`, ~20 notes per page) to cap output; uncapped runs paginate up to 100 pages.
- `searchSort` enum: `general` (comprehensive, default), `popularity_descending` (most popular), `time_descending` (newest).
- The `noteUrl` + `xsecToken` in each row paste directly into the RedNote Note Detail or Comments scraper for fan-out.
- Billing: Pay-per-event billing — see the Pricing tab on the actor page.

### ⚠️ Disclaimer

This actor collects publicly displayed data from Xiaohongshu for legitimate research, marketing, and archival purposes. You are responsible for complying with applicable laws, Xiaohongshu's terms, and for the account whose cookie you supply. Do not use collected data for spam or harassment.

# Actor input Schema

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

Chinese or English keyword, e.g. 美食 or 'skincare'.

## `webSession` (type: `string`):

A logged-in Xiaohongshu `web_session` cookie value from an account you control — Xiaohongshu gates search behind login. Log in at xiaohongshu.com, open DevTools → Application → Cookies, and copy the `web_session` value. You can paste either the bare value or your whole cookie string.

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

Result ranking.

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

Search pages to fetch (~20 notes per page). Default 1.

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

Hard cap on total dataset rows. Leave empty for no cap.

## `proxy` (type: `object`):

Proxy egress. Leave default to use built-in residential routing. Override with Apify Proxy or custom proxy URLs if needed.

## Actor input object example

```json
{
  "keyword": "skincare",
  "searchSort": "general",
  "maxPages": 1,
  "proxy": {
    "useApifyProxy": false
  }
}
```

# 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 = {
    "keyword": "skincare"
};

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

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,memo23/rednote-search-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/9m2zkp9FeSBiVaKtY/builds/HTaa8VewJnaccddrw/openapi.json
