# RedNote API (`sovanza.inc/rednote-api`) Actor

RedNote API scrapes Xiaohongshu / RedNote keyword search results and extracts posts, authors, engagement metrics, images, video URLs, and optional detail data with proxy, cookies, storage state, and dataset export support.

- **URL**: https://apify.com/sovanza.inc/rednote-api.md
- **Developed by:** [Sovanza](https://apify.com/sovanza.inc) (community)
- **Categories:** Social media, Lead generation, Automation
- **Stats:** 6 total users, 4 monthly users, 53.1% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $6.00 / 1,000 rednote posts

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 API – Xiaohongshu Keyword Scraper & Search Data Extractor

<p>
<strong>RedNote API</strong> is an Apify Actor that scrapes <strong>Xiaohongshu (小红书)</strong> / <strong>RedNote</strong>
keyword search results with <strong>Playwright</strong>. Extract posts, authors, engagement metrics, and media URLs per keyword.
Export structured rows to the default <strong>dataset</strong> as <strong>JSON, CSV, or Excel</strong>.
</p>

<h2>Overview</h2>

<p>Each run processes your <code>keywords</code> (with optional concurrency), pushes <strong>one dataset item per post</strong> (or per keyword error), and never stops the whole run when a single keyword fails.</p>

<ul>
  <li><strong>Browser automation</strong> — handles dynamic JavaScript search pages</li>
  <li><strong>Fast or rich mode</strong> — search cards only, or optional detail-page enrichment</li>
  <li><strong>Secret session inputs</strong> — <code>storageStateJson</code>, <code>cookiesJson</code>, and KV/file paths are encrypted in Apify storage</li>
  <li><strong>Residential proxy</strong> — recommended via <code>proxyConfiguration</code></li>
  <li><strong>Automation-ready</strong> — API, schedules, and webhooks</li>
</ul>

<h2>Quick start</h2>

<ol>
  <li>Open <strong>RedNote API</strong> on Apify and add one or more <strong>keywords</strong> (e.g. <code>skincare</code>).</li>
  <li>Set <strong>maxItems</strong> per keyword and enable <strong>residential proxy</strong> in <code>proxyConfiguration</code>.</li>
  <li><strong>For production:</strong> paste a logged-in session into <code>storageStateJson</code> (recommended) or <code>cookiesJson</code>.</li>
  <li>Click <strong>Run</strong> — inspect the <strong>Dataset</strong> tab (overview view) for post rows.</li>
  <li>Export via Console or the dataset API link in the actor <strong>Output</strong> schema.</li>
</ol>

<h3>Minimal input example (health check / Try actor)</h3>

<p>Default prefills are tuned to finish in <strong>under 5 minutes</strong> without a session. An auth error row is expected when no session is provided.</p>

<pre><code class="language-json">{
  "keywords": ["coffee"],
  "maxItems": 2,
  "includeDetails": false,
  "exportStorageState": false,
  "proxyCountry": "AUTO_SELECT_PROXY_COUNTRY",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"],
    "apifyProxyCountry": "US"
  },
  "headless": true,
  "maxConcurrency": 1
}</code></pre>

<h2>Input configuration</h2>

<table>
  <thead>
    <tr>
      <th>Field</th>
      <th>Required</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><code>keywords</code></td>
      <td>Yes</td>
      <td>One or more search keywords (string list). Prefill: <code>["coffee"]</code>.</td>
    </tr>
    <tr>
      <td><code>maxItems</code></td>
      <td>No</td>
      <td>Max posts per keyword (default <code>20</code>, max <code>200</code>). Prefill: <code>2</code>.</td>
    </tr>
    <tr>
      <td><code>proxyConfiguration</code></td>
      <td>No</td>
      <td>Apify proxy settings. Default/prefill: residential <code>US</code>.</td>
    </tr>
    <tr>
      <td><code>proxyCountry</code></td>
      <td>No</td>
      <td><code>AUTO_SELECT_PROXY_COUNTRY</code>, country code, or <code>DISABLED</code>.</td>
    </tr>
    <tr>
      <td><code>baseDomain</code></td>
      <td>No</td>
      <td><code>www.xiaohongshu.com</code> or <code>www.rednote.com</code> (alternate auto-retried on failure).</td>
    </tr>
    <tr>
      <td><code>storageStateJson</code></td>
      <td>No</td>
      <td><strong>Secret.</strong> Full Playwright <code>storage_state</code> JSON string — recommended for logged-in search.</td>
    </tr>
    <tr>
      <td><code>storageStatePath</code></td>
      <td>No</td>
      <td><strong>Secret.</strong> Local file path or Apify KV store key containing storage state JSON.</td>
    </tr>
    <tr>
      <td><code>cookiesJson</code></td>
      <td>No</td>
      <td><strong>Secret.</strong> Playwright cookie array JSON for <code>.xiaohongshu.com</code> / <code>.rednote.com</code>.</td>
    </tr>
    <tr>
      <td><code>cookiesFile</code></td>
      <td>No</td>
      <td><strong>Secret.</strong> Local file path or KV key containing cookies JSON.</td>
    </tr>
    <tr>
      <td><code>includeDetails</code></td>
      <td>No</td>
      <td>Open each post detail page for richer fields (default <code>false</code>; slower).</td>
    </tr>
    <tr>
      <td><code>includeAuthor</code></td>
      <td>No</td>
      <td>Extract author nickname, id, avatar (default <code>true</code>).</td>
    </tr>
    <tr>
      <td><code>includeMedia</code></td>
      <td>No</td>
      <td>Extract images and video URLs (default <code>true</code>).</td>
    </tr>
    <tr>
      <td><code>maxConcurrency</code></td>
      <td>No</td>
      <td>Keywords processed in parallel (default <code>1</code>, max <code>5</code>).</td>
    </tr>
    <tr>
      <td><code>headless</code></td>
      <td>No</td>
      <td>Headless browser (default <code>true</code>).</td>
    </tr>
    <tr>
      <td><code>sortBy</code></td>
      <td>No</td>
      <td><code>general</code> or <code>latest</code> (ignored safely if unsupported).</td>
    </tr>
    <tr>
      <td><code>exportStorageState</code></td>
      <td>No</td>
      <td><strong>Local only.</strong> Headed browser to save <code>storage_state.json</code> after manual login.</td>
    </tr>
    <tr>
      <td><code>storageState</code> / <code>cookies</code></td>
      <td>No</td>
      <td>Legacy JSON editors. Prefer secret string fields above in Apify Console.</td>
    </tr>
  </tbody>
</table>

<h3>Production input example (with session &amp; proxy)</h3>

<pre><code class="language-json">{
  "keywords": ["skincare", "travel outfit"],
  "maxItems": 20,
  "baseDomain": "www.xiaohongshu.com",
  "proxyCountry": "AUTO_SELECT_PROXY_COUNTRY",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"],
    "apifyProxyCountry": "US"
  },
  "storageStateJson": "{\"cookies\":[...],\"origins\":[...]}",
  "includeDetails": false,
  "includeAuthor": true,
  "includeMedia": true,
  "sortBy": "general",
  "headless": true,
  "maxConcurrency": 1
}</code></pre>

<p><em>Alternative:</em> store session JSON in a KV record and pass the key name in <code>storageStatePath</code> or <code>cookiesFile</code> instead of pasting secrets inline.</p>

<h2>Output</h2>

<p>Results are stored in the <strong>default dataset</strong>. Use the actor <strong>Output</strong> schema in Console for the dataset API link (<code>?view=overview</code>).</p>

<h3>Dataset fields (success rows)</h3>

<table>
  <thead>
    <tr>
      <th>Field</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr><td><code>keyword</code></td><td>Search keyword for this row</td></tr>
    <tr><td><code>post_id</code> / <code>post_url</code></td><td>Note identifier and detail URL</td></tr>
    <tr><td><code>title</code> / <code>description</code></td><td>Post caption and description</td></tr>
    <tr><td><code>author_name</code> / <code>author_id</code></td><td>Author profile fields</td></tr>
    <tr><td><code>liked_count</code> / <code>comment_count</code> / <code>share_count</code> / <code>collected_count</code></td><td>Engagement metrics</td></tr>
    <tr><td><code>images</code> / <code>image_count</code> / <code>video_url</code> / <code>cover_image</code></td><td>Media URLs</td></tr>
    <tr><td><code>search_url</code> / <code>scraped_at</code> / <code>source</code></td><td>Provenance metadata</td></tr>
    <tr><td><code>item</code></td><td>Nested <code>note_card</code>, <code>interact_info</code>, tags, timestamps</td></tr>
  </tbody>
</table>

<h3>Example success row</h3>

<pre><code class="language-json">{
  "keyword": "skincare",
  "search_url": "https://www.xiaohongshu.com/search_result?keyword=skincare&source=web_search_result_notes&type=51",
  "post_id": "64f1a2b3c4d5e6f7890",
  "post_url": "https://www.xiaohongshu.com/explore/64f1a2b3c4d5e6f7890",
  "title": "My daily skincare routine",
  "author_name": "Alice",
  "liked_count": 1234,
  "images": ["https://example.com/image1.jpg"],
  "image_count": 1,
  "scraped_at": "2026-06-06T12:00:00.000Z",
  "source": "xiaohongshu",
  "item": {
    "id": "64f1a2b3c4d5e6f7890",
    "note_card": { "display_title": "My daily skincare routine" }
  }
}</code></pre>

<h3>Error rows</h3>

<p>Failed keywords produce a row with <code>error</code> (and often <code>requiresAuth: true</code> when no session was provided). Other keywords still run.</p>

<pre><code class="language-json">{
  "keyword": "coffee",
  "url": "https://www.xiaohongshu.com/search_result?keyword=coffee&source=web_search_result_notes&type=51",
  "error": "Xiaohongshu / RedNote search usually requires a logged-in session...",
  "requiresAuth": true,
  "scraped_at": "2026-06-06T12:00:00.000Z"
}</code></pre>

<p>Empty values are omitted from each row for cleaner dataset tables.</p>

<h2>How it works</h2>

<ol>
  <li><strong>Playwright</strong> launches Chromium with optional Apify residential proxy.</li>
  <li>Session cookies/localStorage are loaded from <code>storageStateJson</code>, <code>storageStatePath</code>, or <code>cookiesJson</code> / <code>cookiesFile</code>.</li>
  <li>For each keyword, the Actor opens search results, scrolls the feed, and parses post cards from the DOM.</li>
  <li>When <code>includeDetails</code> is <code>true</code>, each note detail page is visited for richer fields.</li>
  <li>Each post (or keyword error) is sanitized and pushed to the <strong>default dataset</strong>.</li>
  <li>On failure, the Actor retries per keyword and may try the alternate domain (<code>rednote.com</code> ↔ <code>xiaohongshu.com</code>).</li>
</ol>

<h2>Authentication &amp; sensitive input</h2>

<p>Fields that can hold session credentials use Apify <strong>secret input</strong> (<code>isSecret: true</code>):</p>

<ul>
  <li><code>storageStateJson</code> — full Playwright storage state (recommended)</li>
  <li><code>storageStatePath</code> — file path or KV key for storage state</li>
  <li><code>cookiesJson</code> — Playwright cookie array JSON</li>
  <li><code>cookiesFile</code> — file path or KV key for cookies</li>
</ul>

<p>Secret values are encrypted in storage and are <strong>not</strong> copied into dataset rows or logs.</p>

<p><strong>Keyword search usually requires a logged-in session.</strong> Export a session locally with <code>exportStorageState: true</code>, then paste the JSON into <code>storageStateJson</code> or upload it to a KV store and set <code>storageStatePath</code>.</p>

<h2>Apify Console health check</h2>

<p>After deploying build <strong>0.3+</strong>, use <strong>Try actor</strong> with default prefilled input:</p>

<ul>
  <li><code>keywords: ["coffee"]</code>, <code>maxItems: 2</code>, <code>includeDetails: false</code></li>
  <li>Residential proxy via <code>proxyConfiguration</code> (US prefill)</li>
  <li>No session — validates startup, proxy, and browser flow in <strong>under 5 minutes</strong></li>
  <li>Expected: exit code <code>0</code> with an auth error row or demo fallback row (not live post rows)</li>
</ul>

<p>Log marker: <code>SCRAPER_BUILD_MARKER=v3-health-fast-fail</code></p>

<h2>Best practices</h2>

<ul>
  <li>Provide <strong>storageStateJson</strong> from a browser where you are already logged in before production keyword runs.</li>
  <li>Use <strong>residential proxy</strong> in a region consistent with the account that created the session.</li>
  <li>Keep <code>maxConcurrency</code> at <code>1</code> unless you accept higher block risk.</li>
  <li>Start with <code>includeDetails: false</code>; enable detail enrichment only when you need full post pages.</li>
  <li>Try <code>www.rednote.com</code> if <code>xiaohongshu.com</code> is blocked in your region.</li>
  <li>Respect platform terms, applicable laws, and reasonable scrape volume.</li>
</ul>

<h2>Use cases</h2>

<ul>
  <li>Social media research and keyword trend monitoring</li>
  <li>Brand and product mention tracking on Xiaohongshu / RedNote</li>
  <li>Influencer and engagement benchmarking</li>
  <li>Data pipelines (warehouse, BI, ML) via Apify API or scheduled runs</li>
</ul>

<h2>Limitations</h2>

<ul>
  <li><strong>Login walls</strong> — keyword search typically fails without <code>storageStateJson</code> or cookies.</li>
  <li><strong>Anti-bot</strong> — success depends on proxy quality, session freshness, and site changes.</li>
  <li><strong>No official API</strong> — DOM changes may require Actor updates.</li>
  <li><strong>Detail mode cost</strong> — <code>includeDetails: true</code> opens one page per post (much slower).</li>
  <li><strong>Concurrency risk</strong> — values above <code>1</code> increase blocking probability.</li>
</ul>

<h2>FAQ</h2>

<h3>What is RedNote API used for?</h3>
<p>Scraping Xiaohongshu / RedNote keyword search results — posts, authors, engagement, and media — for research and analytics on Apify.</p>

<h3>Can I scrape without an official API?</h3>
<p>Yes. The Actor uses Playwright against the public web interface.</p>

<h3>Why am I getting empty results or auth errors?</h3>
<p>Login walls and blocking are common. Add <code>storageStateJson</code> or <code>cookiesJson</code>, use residential proxy, and keep concurrency low.</p>

<h3>Can I scrape multiple keywords in one run?</h3>
<p>Yes. Each keyword is processed independently; one failure does not stop others.</p>

<h3>What is detail enrichment?</h3>
<p>When <code>includeDetails</code> is <code>true</code>, the Actor visits each post URL for fuller title, description, and media fields.</p>

<h3>How do I save a logged-in session?</h3>
<p>Locally: set <code>exportStorageState: true</code>, log in when the browser opens, then use the saved JSON in <code>storageStateJson</code> or upload to KV and set <code>storageStatePath</code>.</p>

<h3>Does the health check need post rows?</h3>
<p>No. Prefilled runs validate Actor startup and browser flow. An auth error row with exit code <code>0</code> is a successful health check.</p>

<h3>Where do I export results?</h3>
<p>Apify dataset tab (JSON, CSV, Excel) or the dataset API link from the actor Output schema.</p>

<h2>Run locally</h2>

<ol>
  <li><code>cd rednote-api</code></li>
  <li><code>pip install -r requirements.txt</code></li>
  <li><code>playwright install chromium</code></li>
  <li>Create <code>INPUT.json</code> in this folder (see examples above).</li>
  <li><code>apify run</code> or run <code>main.py</code> in an Apify-compatible environment.</li>
</ol>

<p>Use <code>exportStorageState: true</code> locally to capture a session, then re-run with <code>storageStatePath</code>.</p>

<h2>Deploy</h2>

<p>Push with Apify CLI or connect the Git repository (<code>rednote-api/</code> directory). Schema files: <code>INPUT_SCHEMA.json</code>, <code>.actor/dataset_schema.json</code>, <code>.actor/output_schema.json</code>, <code>Dockerfile</code>.</p>

<h2>Get started</h2>

<p>Add your keywords, enable residential proxy, paste a logged-in <code>storageStateJson</code> for production runs, and export Xiaohongshu / RedNote search data on Apify.</p>

# Actor input Schema

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

Enter one or more Xiaohongshu / RedNote search keywords (one per line).
## `maxItems` (type: `integer`):

Maximum number of posts to collect per keyword (1–200).
## `proxyCountry` (type: `string`):

Residential proxy country (uses Apify Proxy). AUTO uses any country. Prefer proxyConfiguration for full Apify proxy settings.
## `proxyConfiguration` (type: `object`):

Apify proxy settings. Residential proxy is recommended for Xiaohongshu / RedNote.
## `baseDomain` (type: `string`):

Which web domain to use for navigation and search. If one domain is blocked, try the other.
## `locale` (type: `string`):

Browser locale (advanced).
## `acceptLanguage` (type: `string`):

Extra header Accept-Language (advanced).
## `storageStateJson` (type: `string`):

Playwright storage_state JSON (cookies + localStorage) from a logged-in Xiaohongshu / RedNote browser session. Paste the full JSON object here in Apify Console. Stored as a secret input.
## `storageState` (type: `object,string`):

Legacy Playwright storage_state object. Prefer storageStateJson in the Apify console (secret field). Keyword search usually fails without a session.
## `storageStatePath` (type: `string`):

Optional storage state source: local file path inside the actor OR an Apify key-value store key whose value is storage_state JSON. Stored as a secret input.
## `exportStorageState` (type: `boolean`):

Local-only helper: opens a headed browser, lets you log in, then saves storage_state.json and exits.
## `exportStorageStateWaitSec` (type: `integer`):

How long to wait for you to log in during export mode.
## `cookiesJson` (type: `string`):

Optional Playwright cookie array JSON for .xiaohongshu.com / .rednote.com. Stored as a secret input and never written to the dataset.
## `cookiesFile` (type: `string`):

Optional cookies source: local file path inside the actor OR an Apify key-value store key whose value is cookies JSON. Stored as a secret input.
## `cookies` (type: `array`):

Legacy Playwright cookie array. Prefer cookiesJson in the Apify console. Keyword search usually fails without cookies or storageState.
## `sortBy` (type: `string`):

Optional sort mode, e.g. "general" or "latest". If not supported by the current DOM, it is ignored safely.
## `searchType` (type: `string`):

Future-safe input. Default is "note".
## `includeDetails` (type: `boolean`):

If true, opens each note detail page for richer fields (slower). If false, uses search-card data only (faster).
## `includeAuthor` (type: `boolean`):

If true, attempts to extract author info (nickname, avatar, id when available).
## `includeMedia` (type: `boolean`):

If true, attempts to extract images/video fields.
## `headless` (type: `boolean`):

Run browser in headless mode.
## `maxConcurrency` (type: `integer`):

Maximum number of keywords processed concurrently. Higher values may increase blocking risk.

## Actor input object example

```json
{
  "keywords": [
    "coffee"
  ],
  "maxItems": 2,
  "proxyCountry": "AUTO_SELECT_PROXY_COUNTRY",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  },
  "baseDomain": "www.xiaohongshu.com",
  "locale": "en-US",
  "acceptLanguage": "en-US,en;q=0.9",
  "exportStorageState": false,
  "exportStorageStateWaitSec": 120,
  "cookies": [],
  "sortBy": "general",
  "searchType": "note",
  "includeDetails": false,
  "includeAuthor": true,
  "includeMedia": true,
  "headless": true,
  "maxConcurrency": 1
}
````

# Actor output Schema

## `posts` (type: `string`):

Keyword search results with flattened fields and optional nested item object.

# 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": [
        "coffee"
    ],
    "maxItems": 2,
    "proxyCountry": "AUTO_SELECT_PROXY_COUNTRY",
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "US"
    },
    "storageStateJson": "",
    "storageStatePath": "",
    "exportStorageState": false,
    "cookiesJson": "",
    "cookiesFile": "",
    "cookies": [],
    "includeDetails": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("sovanza.inc/rednote-api").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": ["coffee"],
    "maxItems": 2,
    "proxyCountry": "AUTO_SELECT_PROXY_COUNTRY",
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "US",
    },
    "storageStateJson": "",
    "storageStatePath": "",
    "exportStorageState": False,
    "cookiesJson": "",
    "cookiesFile": "",
    "cookies": [],
    "includeDetails": False,
}

# Run the Actor and wait for it to finish
run = client.actor("sovanza.inc/rednote-api").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": [
    "coffee"
  ],
  "maxItems": 2,
  "proxyCountry": "AUTO_SELECT_PROXY_COUNTRY",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  },
  "storageStateJson": "",
  "storageStatePath": "",
  "exportStorageState": false,
  "cookiesJson": "",
  "cookiesFile": "",
  "cookies": [],
  "includeDetails": false
}' |
apify call sovanza.inc/rednote-api --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "RedNote API",
        "description": "RedNote API scrapes Xiaohongshu / RedNote keyword search results and extracts posts, authors, engagement metrics, images, video URLs, and optional detail data with proxy, cookies, storage state, and dataset export support.",
        "version": "0.0",
        "x-build-id": "rytuqFNg99KEtmYoH"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/sovanza.inc~rednote-api/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-sovanza.inc-rednote-api",
                "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/sovanza.inc~rednote-api/runs": {
            "post": {
                "operationId": "runs-sync-sovanza.inc-rednote-api",
                "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/sovanza.inc~rednote-api/run-sync": {
            "post": {
                "operationId": "run-sync-sovanza.inc-rednote-api",
                "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",
                "properties": {
                    "keywords": {
                        "title": "Single/Multiple Keywords",
                        "type": "array",
                        "description": "Enter one or more Xiaohongshu / RedNote search keywords (one per line).",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxItems": {
                        "title": "Max items per keyword",
                        "minimum": 1,
                        "maximum": 200,
                        "type": "integer",
                        "description": "Maximum number of posts to collect per keyword (1–200).",
                        "default": 20
                    },
                    "proxyCountry": {
                        "title": "Proxy Country",
                        "enum": [
                            "DISABLED",
                            "AUTO_SELECT_PROXY_COUNTRY",
                            "US",
                            "GB",
                            "DE",
                            "FR",
                            "JP",
                            "CA",
                            "IT",
                            "AU",
                            "SG"
                        ],
                        "type": "string",
                        "description": "Residential proxy country (uses Apify Proxy). AUTO uses any country. Prefer proxyConfiguration for full Apify proxy settings.",
                        "default": "AUTO_SELECT_PROXY_COUNTRY"
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Apify proxy settings. Residential proxy is recommended for Xiaohongshu / RedNote.",
                        "default": {
                            "useApifyProxy": true,
                            "apifyProxyGroups": [
                                "RESIDENTIAL"
                            ],
                            "apifyProxyCountry": "US"
                        }
                    },
                    "baseDomain": {
                        "title": "Base domain",
                        "enum": [
                            "www.xiaohongshu.com",
                            "www.rednote.com"
                        ],
                        "type": "string",
                        "description": "Which web domain to use for navigation and search. If one domain is blocked, try the other.",
                        "default": "www.xiaohongshu.com"
                    },
                    "locale": {
                        "title": "Locale (optional)",
                        "type": "string",
                        "description": "Browser locale (advanced).",
                        "default": "en-US"
                    },
                    "acceptLanguage": {
                        "title": "Accept-Language (optional)",
                        "type": "string",
                        "description": "Extra header Accept-Language (advanced).",
                        "default": "en-US,en;q=0.9"
                    },
                    "storageStateJson": {
                        "title": "Storage state JSON (recommended)",
                        "type": "string",
                        "description": "Playwright storage_state JSON (cookies + localStorage) from a logged-in Xiaohongshu / RedNote browser session. Paste the full JSON object here in Apify Console. Stored as a secret input."
                    },
                    "storageState": {
                        "title": "Playwright storage state (legacy)",
                        "description": "Legacy Playwright storage_state object. Prefer storageStateJson in the Apify console (secret field). Keyword search usually fails without a session."
                    },
                    "storageStatePath": {
                        "title": "Storage state file / KV key (optional)",
                        "type": "string",
                        "description": "Optional storage state source: local file path inside the actor OR an Apify key-value store key whose value is storage_state JSON. Stored as a secret input."
                    },
                    "exportStorageState": {
                        "title": "Export storage state (local only)",
                        "type": "boolean",
                        "description": "Local-only helper: opens a headed browser, lets you log in, then saves storage_state.json and exits.",
                        "default": false
                    },
                    "exportStorageStateWaitSec": {
                        "title": "Export wait time (seconds)",
                        "minimum": 10,
                        "maximum": 900,
                        "type": "integer",
                        "description": "How long to wait for you to log in during export mode.",
                        "default": 120
                    },
                    "cookiesJson": {
                        "title": "Cookies JSON (optional)",
                        "type": "string",
                        "description": "Optional Playwright cookie array JSON for .xiaohongshu.com / .rednote.com. Stored as a secret input and never written to the dataset."
                    },
                    "cookiesFile": {
                        "title": "Cookies file / KV key (optional)",
                        "type": "string",
                        "description": "Optional cookies source: local file path inside the actor OR an Apify key-value store key whose value is cookies JSON. Stored as a secret input."
                    },
                    "cookies": {
                        "title": "Session cookies (legacy)",
                        "type": "array",
                        "description": "Legacy Playwright cookie array. Prefer cookiesJson in the Apify console. Keyword search usually fails without cookies or storageState."
                    },
                    "sortBy": {
                        "title": "Sort (optional)",
                        "enum": [
                            "general",
                            "latest"
                        ],
                        "type": "string",
                        "description": "Optional sort mode, e.g. \"general\" or \"latest\". If not supported by the current DOM, it is ignored safely.",
                        "default": "general"
                    },
                    "searchType": {
                        "title": "Search type (future-safe)",
                        "type": "string",
                        "description": "Future-safe input. Default is \"note\".",
                        "default": "note"
                    },
                    "includeDetails": {
                        "title": "Include detail pages",
                        "type": "boolean",
                        "description": "If true, opens each note detail page for richer fields (slower). If false, uses search-card data only (faster).",
                        "default": false
                    },
                    "includeAuthor": {
                        "title": "Include author fields",
                        "type": "boolean",
                        "description": "If true, attempts to extract author info (nickname, avatar, id when available).",
                        "default": true
                    },
                    "includeMedia": {
                        "title": "Include media fields",
                        "type": "boolean",
                        "description": "If true, attempts to extract images/video fields.",
                        "default": true
                    },
                    "headless": {
                        "title": "Headless",
                        "type": "boolean",
                        "description": "Run browser in headless mode.",
                        "default": true
                    },
                    "maxConcurrency": {
                        "title": "Max concurrency",
                        "minimum": 1,
                        "maximum": 5,
                        "type": "integer",
                        "description": "Maximum number of keywords processed concurrently. Higher values may increase blocking risk.",
                        "default": 1
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
