# RedNote（小红书）Multi-Keyword Search – Pay result, 100 free, Fast (`tomato_cart/xiaohongshu-search-scraper`) Actor

🎁 First 100 notes free every month. ✅ Pay only for successful results. ⚡ 2-5s per keyword – no heavy browser. Batch multiple keywords (camping,makeup). Auto cookie persistence (once, reuse forever). Error skip – single failure never crashes task. ｜ 小红书多关键词搜索：每月前100条免费，按成功结果收费，2-5秒极速。

- **URL**: https://apify.com/tomato\_cart/xiaohongshu-search-scraper.md
- **Developed by:** [Richard](https://apify.com/tomato_cart) (community)
- **Categories:** Social media
- **Stats:** 3 total users, 1 monthly users, 90.9% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.003 / result

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## 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) Search Scraper – Multi-Keyword & Batch

**English | [中文帮助](#-常见问题)**

### ✨ Why This Actor?

- **Multi-keyword batch** — Search `露营, 美妆, 宠物` in one run (同时搜索多个词)
- **Super fast** — 2-5 seconds per keyword, no browser needed
- **Cookie auto-save** — Provide once, we reuse it (一次提供，自动保存)
- **Error tolerance** — Skipped failures don't break the task
- **Full detail** — Note body, images, tags, comments (正文/图片/评论)

---

### 📥 Quick Start (3 Steps)

#### Step 1: Get Cookie 🔑 (only once)

> **Why do I need a cookie?** The cookie tells Xiaohongshu that you're a real logged-in user. We only use it for search, nothing else. Your cookie is never shared or stored outside this Actor.
> 为什么需要 Cookie？Cookie 用于验证你的登录身份，让 Actor 能够正常搜索小红书数据。不会被用于其他用途。

##### 🖥️ Detailed Walkthrough (with screenshots)

Follow these steps exactly — it takes less than 30 seconds:

1️⃣ **Open your browser** (Chrome, Edge, or Firefox) and go to **[www.xiaohongshu.com](https://www.xiaohongshu.com)**

2️⃣ **Log in** with your Xiaohongshu account (手机号/微信/小红书账号均可)

3️⃣ **Press F12** to open Developer Tools
   - Mac users: **Cmd+Option+I**
   - You should see a panel open on the right or bottom of your browser

4️⃣ **Click the "Application" tab** (应用程序) at the top of the Developer Tools panel
   - If you don't see "Application", click the **»** (More tabs) button first

5️⃣ **Find Cookies** in the left sidebar:
   - Expand **Cookies** (or Storage → Cookies)
   - Click **https://www.xiaohongshu.com**
   - You should now see a table of cookies

6️⃣ **Select and copy**:
   - Click anywhere in the cookie table
   - Press **Ctrl+A** (or **Cmd+A** on Mac) to select all
   - Press **Ctrl+C** (or **Cmd+C** on Mac) to copy
   - ✅ The entire cookie string is now on your clipboard

````

📋 Cookie table example:
┌──────────────────────┬──────────────────────────────────┐
│ Name                 │ Value                            │
├──────────────────────┼──────────────────────────────────┤
│ a1                   │ 189082...                        │
│ web\_session          │ 0400...                          │
│ webId                │ 2b8e...                          │
│ ...                  │ ...                              │
└──────────────────────┴──────────────────────────────────┘
→ Ctrl+A → Ctrl+C to copy all

```

7️⃣ **Paste into the Actor**:
   - In the Actor's input form, find the **Cookies** field
   - **Ctrl+V** (or **Cmd+V** on Mac) to paste
   - The field will show a long string like `a1=189082...; web_session=0400...; webId=2b8e...`

> 💡 **Tip:** You only need to do this once. The Actor saves your cookie automatically and reuses it for future runs. If your cookie expires (weeks later), just repeat these steps.

##### 📹 Visual Reference

```

┌─ Browser Window ──────────────────────────────────────┐
│                                                       │
│  \[F12]  \[Elements] \[Console] \[Application] \[»]        │
│                        ┌────────────────────────────┐ │
│  ◉ Storage             │  Filter                    │ │
│    ├─ Local Stora◉e    ├────────────────────────────┤ │
│    └─ Cookies          │  Name        │ Value       │ │
│       ├─ xiaohongshu   │──────────────┼─────────────┤ │
│       └─ baidu.com     │  a1          │ 189082...   │ │
│                        │  web\_session │ 0400...     │ │
│                        │  webId       │ 2b8e...     │ │
│                        │     ...                    │ │
│                        │  ← Ctrl+A → Ctrl+C →      │ │
│                        └───────┬────────────────────┘ │
│                                │                      │
│                    Paste here ▼ (Cookies field)        │
└────────────────────────────────────────────────────────┘

````

---

#### Step 2: Enter Keywords 🔤

Comma-separated in `keywords` field:

| You type | Result |
|----------|--------|
| `露营` | Single keyword |
| `露营, 美妆` | Two keywords |
| `露营, 美妆, 宠物` | Three keywords |

> ✅ 支持中文关键词，用英文逗号隔开

#### Step 3: Run ▶️

Set **maxItems** (per keyword), click **Run**. Results in ~10 seconds!

---

### 📤 Output Example

```json
{
  "keyword": "露营",
  "note_id": "68bd2ad...",
  "title": "绝美露营地推荐",
  "likes": 1269
}
````

***

### ⚙️ Config Reference

| Field | Req | Default | Description |
|-------|:---:|:-------:|-------------|
| `cookies` | ✅ | — | Login cookies. [How to get?](#-quick-start-3-steps) |
| `keywords` | ✅ | — | Comma-separated. E.g. `露营, 美妆` |
| `maxItems` | | 30 | Notes per keyword |
| `enableDetail` | | true | Full note details |
| `maxDetailNotes` | | 3 | Notes with full details |
| `maxComments` | | 10 | Comments per note |
| `sortBy` | | general | Sort order |
| `proxyConfiguration` | | Residential | Proxy for stability |

***

### ❓ FAQ — 常见问题

**Q: Why do I need a cookie?**
A: The cookie proves you're a real logged-in user on Xiaohongshu. Without it, the search API refuses access. We never store or share your cookie beyond this Actor.

**Q: 为什么需要 Cookie？**
A: Cookie 用于验证你的小红书登录身份。没有 Cookie，搜索接口会拒绝访问。我们不会将你的 Cookie 存储用于其他用途。

**Q: Do cookies expire?**
A: Yes, typically after 1-2 weeks or when you log out. Just repeat [Step 1](#-quick-start-3-steps) to get a fresh one.

**Q: Cookie 会过期吗？**
A: 会的，通常 1-2 周后过期，或退出登录后立即失效。重新按上方步骤复制新的 Cookie 即可。

**Q: I get 0 results? / 搜索不到结果？**
A: Most likely your cookie expired. Get a fresh one from your browser.

**Q: Error "code=-100" or "code=-101"?**
A: Cookie expired. Refresh from browser. / Cookie过期，重新获取。

**Q: Can I search Chinese keywords?**
A: Yes! Use English commas between them. / 支持中文，用英文逗号隔开。

**Q: How fast is it?**
A: 2-5 seconds per keyword. 3 keywords ≈ 10-15s total.

***

### 💡 Pro Tips

- **More keywords = more results** (total = maxItems × keywords)
- **Keep cookie fresh** — lasts 1-2 weeks
- **Use Residential proxy** to avoid blocks
- For research: try `推荐`, `好用`, `平替`, `种草`

***

### 🔧 Tech

Uses [xhshow](https://pypi.org/project/xhshow/) for API signature signing. Direct HTTP — no browser needed. MIT License.

*Built with ❤️ for the Apify community.*

# Actor input Schema

## `cookies` (type: `string`):

**Required.** Paste ALL cookies from www.xiaohongshu.com
To get cookies: Login → F12 → Application → Cookies → Select All → Copy
中文：登录小红书网页版 → F12 → Application → Cookies → 全选复制 → 粘贴
Example format: a1=xxx; web\_session=xxx; webId=xxx

## `keywords` (type: `string`):

One or more keywords separated by commas.
中文：输入一个或多个关键词，用英文逗号隔开。例如：露营, 美妆, 宠物
✅ Supports Chinese keywords.

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

Notes per keyword. Total = keywords × maxItems.
中文：每个关键词返回多少条笔记。总条数 = 关键词个数 × 本值

## `enableContent` (type: `boolean`):

Fetch note body, comments, like/collect counts. | 提取笔记详情：正文、评论、点赞等。

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

Only shows when “Extract Detailed Content” is ON.
Max comments to extract per note (5-50).
中文：仅当启用内容提取时生效。每篇笔记最多提取多少条评论

## `enableImages` (type: `boolean`):

Fetch image URLs from the note. Disabled by default to save time. | 提取图片链接，默认关闭。

## `sortBy` (type: `string`):

General / Latest / Most popular
中文：综合 / 最新 / 最热

## Actor input object example

```json
{
  "keywords": "露营, 美妆",
  "maxItems": 30,
  "enableContent": true,
  "maxComments": 10,
  "enableImages": false,
  "sortBy": "general"
}
```

# 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 = {
    "keywords": "露营, 美妆"
};

// Run the Actor and wait for it to finish
const run = await client.actor("tomato_cart/xiaohongshu-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 = { "keywords": "露营, 美妆" }

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

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "RedNote（小红书）Multi-Keyword Search – Pay result, 100 free, Fast",
        "description": "🎁 First 100 notes free every month. ✅ Pay only for successful results. ⚡ 2-5s per keyword – no heavy browser. Batch multiple keywords (camping,makeup). Auto cookie persistence (once, reuse forever). Error skip – single failure never crashes task. ｜ 小红书多关键词搜索：每月前100条免费，按成功结果收费，2-5秒极速。",
        "version": "0.1",
        "x-build-id": "qtXqwGKX0KYvQemE1"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/tomato_cart~xiaohongshu-search-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-tomato_cart-xiaohongshu-search-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/tomato_cart~xiaohongshu-search-scraper/runs": {
            "post": {
                "operationId": "runs-sync-tomato_cart-xiaohongshu-search-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/tomato_cart~xiaohongshu-search-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-tomato_cart-xiaohongshu-search-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": [
                    "cookies",
                    "keywords"
                ],
                "properties": {
                    "cookies": {
                        "title": "🍪 Cookies",
                        "type": "string",
                        "description": "**Required.** Paste ALL cookies from www.xiaohongshu.com\nTo get cookies: Login → F12 → Application → Cookies → Select All → Copy\n中文：登录小红书网页版 → F12 → Application → Cookies → 全选复制 → 粘贴\nExample format: a1=xxx; web_session=xxx; webId=xxx"
                    },
                    "keywords": {
                        "title": "🔤 Keywords (关键词，逗号分隔)",
                        "type": "string",
                        "description": "One or more keywords separated by commas.\n中文：输入一个或多个关键词，用英文逗号隔开。例如：露营, 美妆, 宠物\n✅ Supports Chinese keywords."
                    },
                    "maxItems": {
                        "title": "Notes Per Keyword (每关键词笔记数)",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Notes per keyword. Total = keywords × maxItems.\n中文：每个关键词返回多少条笔记。总条数 = 关键词个数 × 本值",
                        "default": 30
                    },
                    "enableContent": {
                        "title": "Extract Detailed Content (text, comments, likes)",
                        "type": "boolean",
                        "description": "Fetch note body, comments, like/collect counts. | 提取笔记详情：正文、评论、点赞等。",
                        "default": true
                    },
                    "maxComments": {
                        "title": "💬 Max Comments Per Note (每篇最多评论)",
                        "minimum": 5,
                        "maximum": 50,
                        "type": "integer",
                        "description": "Only shows when “Extract Detailed Content” is ON.\nMax comments to extract per note (5-50).\n中文：仅当启用内容提取时生效。每篇笔记最多提取多少条评论",
                        "default": 10
                    },
                    "enableImages": {
                        "title": "Extract Images",
                        "type": "boolean",
                        "description": "Fetch image URLs from the note. Disabled by default to save time. | 提取图片链接，默认关闭。",
                        "default": false
                    },
                    "sortBy": {
                        "title": "📌 Sort Order (排序方式)",
                        "enum": [
                            "general",
                            "time_descending",
                            "popularity_descending"
                        ],
                        "type": "string",
                        "description": "General / Latest / Most popular\n中文：综合 / 最新 / 最热",
                        "default": "general"
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
