# RedNote (Xiaohongshu) Post Search Scraper (`toolzerhub/rednote-xiaohongshu-search-scraper`) Actor

Search public RedNote (Xiaohongshu) posts by keyword with clear content and time filters plus automatic pagination.

- **URL**: https://apify.com/toolzerhub/rednote-xiaohongshu-search-scraper.md
- **Developed by:** [ToolzerHub](https://apify.com/toolzerhub) (community)
- **Categories:** Social media, Automation, For creators
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.20 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#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) Post Search Scraper

Search public RedNote or Xiaohongshu posts by keyword and export post text, author data, content type, saves, comments, and likes.

### Search controls

Give the Actor a required **`query`**, then narrow the result set when needed.

| Field | Default | Accepted values |
|---|---:|---|
| **`content_type`** | `all` | `all`, `image`, `video`, `live` |
| **`time_range`** | `all` | `all`, `day`, `week`, `half_year` |
| **`sort`** | `relevance` | `relevance`, `recent`, `popular`, `most_commented`, `most_saved`, `english` |
| **`ai_mode`** | `false` | Set `true` to restrict results to content RedNote identifies as AI-generated. |
| **`maxItems`** | `100` | Maximum saved rows. Set `0` to remove the cap. |

```json
{
  "query": "coffee shops for remote work",
  "content_type": "image",
  "time_range": "week",
  "sort": "most_saved",
  "ai_mode": false,
  "maxItems": 50
}
```

### Output

Each search hit becomes one row.

| Field | Contents |
|---|---|
| **`id`** | Post ID |
| **`title`**, **`desc`** | Title and caption |
| **`type`** | Post type |
| **`user`** | Author data |
| **`collected_count`** | Save or collect count |
| **`comments_count`** | Comment count |
| **`nice_count`** | Like count under RedNote's literal field name |

```json
{
  "id": "67b71565000000000602b6b1",
  "title": "Best coffee shops for remote work",
  "desc": "Ranked by outlet access and noise level.",
  "type": "normal",
  "collected_count": 1875,
  "comments_count": 81,
  "nice_count": 340
}
```

### Run behavior

The Actor follows RedNote's opaque continuation cursor. It stops when it reaches **`maxItems`**, RedNote reports the end, returns an empty page, or repeats a cursor. The cap can't force additional search hits.

No login, cookie, or session token is required or accepted. Billing follows saved results rather than a monthly rental.

### Questions

**Does `ai_mode` detect AI content itself?**

No. It restricts the search only when RedNote identifies a post as AI-generated. With **`ai_mode`** at its `false` default, that restriction is off.

**Why are the like fields called `nice_count`?**

That is the field name returned for post-search hits. Other RedNote datasets use different literal names, so the Actor doesn't rename it to match unrelated endpoints.

### Pick the right search

| If you need… | Use… |
|---|---|
| Image-specific grouped results | [RedNote Image Search Scraper](https://apify.com/thenetaji/rednote-image-search-scraper) |
| Accounts rather than posts | [RedNote Profile Search Scraper](https://apify.com/thenetaji/rednote-profile-search-scraper) |
| Public interest groups | [RedNote Group Search Scraper](https://apify.com/thenetaji/rednote-group-search-scraper) |
| One known post in full | [RedNote Post Scraper](https://apify.com/thenetaji/rednote-post-scraper) |

# Actor input Schema

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

Words or phrase to search for.

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

Maximum rows to save. Set 0 to keep collecting until the source is exhausted.

## `sort` (type: `string`):

Order for post search.

## `content_type` (type: `string`):

Kind of content to return.

## `time_range` (type: `string`):

Time window for post search.

## `ai_mode` (type: `boolean`):

Limit post search to AI-generated content when the source identifies it.

## Actor input object example

```json
{
  "query": "matcha",
  "maxItems": 20,
  "sort": "relevance",
  "content_type": "all",
  "time_range": "all",
  "ai_mode": false
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing all scraped data

# 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 = {
    "query": "matcha",
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("toolzerhub/rednote-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 = {
    "query": "matcha",
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("toolzerhub/rednote-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 '{
  "query": "matcha",
  "maxItems": 20
}' |
apify call toolzerhub/rednote-xiaohongshu-search-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/kfgMzktMt3KsJfG6A/builds/YuodVWd2zWcRSM74Z/openapi.json
