# Xiaohongshu (RedNote) Data API (`justoneapi/xiaohongshu-rednote-data-api`) Actor

Search Xiaohongshu notes and users, retrieve profiles, notes, comments, topics, trends, and resolve share links. Users must provide their own JustOneAPI token.

- **URL**: https://apify.com/justoneapi/xiaohongshu-rednote-data-api.md
- **Developed by:** [justipa](https://apify.com/justoneapi) (community)
- **Categories:** Social media, SEO tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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

## Xiaohongshu (RedNote) Data API

Run common Xiaohongshu data operations from one Apify Actor. Search notes and users, retrieve profiles, published notes, note details, comments and replies, discover trends and topics, or resolve a share URL.

### Input

1. Select an `operation`. The default `setupGuide` operation returns setup instructions without calling JustOneAPI.
2. Provide the fields required by that operation.
3. For API operations, provide your own JustOneAPI `token`. Register at [JustOneAPI](https://justoneapi.com/) to obtain one.

Unused input fields are ignored. Pagination cursors and search session IDs should be copied from the previous API response.

API usage is billed against the token supplied for that run. This Actor does not include, share, or reuse a token.

### Output

Each run stores normalized results in:

- The default Dataset as one row per returned item whenever the API returns a list, such as notes, users, comments, or keyword suggestions.
- The Key-value store under the `OUTPUT` key with the normalized items and the complete original API response.

Dataset rows include common fields such as the operation, request metadata, item type, note/user/comment IDs, titles, author data, engagement counts, image URLs, pagination fields, and a `raw` field with the original item. The stored request metadata excludes the access token.

The default `setupGuide` operation emits one instruction row and does not call JustOneAPI. It exists so Apify Store health checks can run without consuming a JustOneAPI token.

### Supported operations

- Setup guide
- Hot search
- Search notes
- Search users
- User published notes
- Note details and video details
- Note comments and comment replies
- User profile
- Keyword suggestions
- Topic note list
- Share URL resolution

### Notes

- `noteDetails` returns engagement metrics.
- `noteVideoDetails` is intended for video download workflows and does not include engagement metrics.
- `resolveShareUrl` requires a real Xiaohongshu copied share link or short link. Canonical note URLs such as `/explore/{noteId}` are not accepted by the upstream API.
- `setupGuide` is the default operation and does not call JustOneAPI or consume a token.
- The Actor uses public or recommended API versions and does not expose deprecated or documentation-hidden versions.

# Actor input Schema

## `operation` (type: `string`):

The Xiaohongshu data operation to run.
## `token` (type: `string`):

Required for API operations. Your personal access token for api.justoneapi.com. Register at https://justoneapi.com/ to obtain a token. The Actor does not include or share a token.
## `keyword` (type: `string`):

Required for note search, user search, and keyword suggestions.
## `searchWord` (type: `string`):

Optional keyword filter for hot search.
## `page` (type: `integer`):

Page number for note and user searches.
## `pageNum` (type: `integer`):

Page number for hot search.
## `userId` (type: `string`):

Required for user profile and user published notes.
## `noteId` (type: `string`):

Required for note details, video details, comments, and replies.
## `commentId` (type: `string`):

Required for comment replies.
## `topicId` (type: `string`):

Required for topic note list.
## `shareUrl` (type: `string`):

Required to resolve a Xiaohongshu share link.
## `lastCursor` (type: `string`):

Pagination cursor returned by the previous response.
## `cursor` (type: `string`):

Pagination cursor for topic notes.
## `searchId` (type: `string`):

For search-note pagination; use data.api_info.search_id from the previous response.
## `sessionId` (type: `string`):

For search-note pagination; use data.api_info.session_id from the previous response.
## `sortType` (type: `string`):

Sort order for the note search operation.
## `noteType` (type: `string`):

Filter note search results by note type.
## `timeFilter` (type: `string`):

Filter note search results by publish time.
## `orderBy` (type: `string`):

Ranking metric used by the hot-search operation.
## `nd` (type: `string`):

Time range used by the hot-search operation.
## `sort` (type: `string`):

Use latest/normal for comments and hot/time for topics.
## `format` (type: `boolean`):

Leave disabled unless confirmed by the API administrator.

## Actor input object example

```json
{
  "operation": "setupGuide",
  "searchWord": "",
  "page": 1,
  "pageNum": 1,
  "sortType": "general",
  "noteType": "ALL",
  "timeFilter": "ALL",
  "orderBy": "premium_imp_num",
  "nd": "DAY_7",
  "format": false
}
````

# Actor output Schema

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

Normalized result rows. The default setup guide returns one instruction row. List operations return one row per note, user, comment, topic item, keyword suggestion, or hot-search item. Detail and share-link operations return one summary row.

## `output` (type: `string`):

Run metadata, normalized items, and the complete original JustOneAPI response. The supplied access token is excluded.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("justoneapi/xiaohongshu-rednote-data-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("justoneapi/xiaohongshu-rednote-data-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 '{}' |
apify call justoneapi/xiaohongshu-rednote-data-api --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Xiaohongshu (RedNote) Data API",
        "description": "Search Xiaohongshu notes and users, retrieve profiles, notes, comments, topics, trends, and resolve share links. Users must provide their own JustOneAPI token.",
        "version": "0.0",
        "x-build-id": "0YNw1GVxaFJaqWWVt"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/justoneapi~xiaohongshu-rednote-data-api/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-justoneapi-xiaohongshu-rednote-data-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/justoneapi~xiaohongshu-rednote-data-api/runs": {
            "post": {
                "operationId": "runs-sync-justoneapi-xiaohongshu-rednote-data-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/justoneapi~xiaohongshu-rednote-data-api/run-sync": {
            "post": {
                "operationId": "run-sync-justoneapi-xiaohongshu-rednote-data-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",
                "required": [
                    "operation"
                ],
                "properties": {
                    "operation": {
                        "title": "Operation",
                        "enum": [
                            "setupGuide",
                            "hotSearch",
                            "searchNotes",
                            "searchUsers",
                            "userNotes",
                            "noteDetails",
                            "noteVideoDetails",
                            "noteComments",
                            "commentReplies",
                            "userProfile",
                            "keywordSuggestions",
                            "topicNotes",
                            "resolveShareUrl"
                        ],
                        "type": "string",
                        "description": "The Xiaohongshu data operation to run.",
                        "default": "setupGuide"
                    },
                    "token": {
                        "title": "JustOneAPI token",
                        "type": "string",
                        "description": "Required for API operations. Your personal access token for api.justoneapi.com. Register at https://justoneapi.com/ to obtain a token. The Actor does not include or share a token."
                    },
                    "keyword": {
                        "title": "Keyword",
                        "type": "string",
                        "description": "Required for note search, user search, and keyword suggestions."
                    },
                    "searchWord": {
                        "title": "Hot-search keyword",
                        "type": "string",
                        "description": "Optional keyword filter for hot search.",
                        "default": ""
                    },
                    "page": {
                        "title": "Page",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Page number for note and user searches.",
                        "default": 1
                    },
                    "pageNum": {
                        "title": "Hot-search page",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Page number for hot search.",
                        "default": 1
                    },
                    "userId": {
                        "title": "User ID",
                        "type": "string",
                        "description": "Required for user profile and user published notes."
                    },
                    "noteId": {
                        "title": "Note ID",
                        "type": "string",
                        "description": "Required for note details, video details, comments, and replies."
                    },
                    "commentId": {
                        "title": "Comment ID",
                        "type": "string",
                        "description": "Required for comment replies."
                    },
                    "topicId": {
                        "title": "Topic ID",
                        "type": "string",
                        "description": "Required for topic note list."
                    },
                    "shareUrl": {
                        "title": "Share URL",
                        "type": "string",
                        "description": "Required to resolve a Xiaohongshu share link."
                    },
                    "lastCursor": {
                        "title": "Last cursor",
                        "type": "string",
                        "description": "Pagination cursor returned by the previous response."
                    },
                    "cursor": {
                        "title": "Topic cursor",
                        "type": "string",
                        "description": "Pagination cursor for topic notes."
                    },
                    "searchId": {
                        "title": "Search ID",
                        "type": "string",
                        "description": "For search-note pagination; use data.api_info.search_id from the previous response."
                    },
                    "sessionId": {
                        "title": "Session ID",
                        "type": "string",
                        "description": "For search-note pagination; use data.api_info.session_id from the previous response."
                    },
                    "sortType": {
                        "title": "Note search sort",
                        "enum": [
                            "general",
                            "popularity_descending",
                            "time_descending",
                            "comment_descending",
                            "collect_descending"
                        ],
                        "type": "string",
                        "description": "Sort order for the note search operation.",
                        "default": "general"
                    },
                    "noteType": {
                        "title": "Note type",
                        "enum": [
                            "ALL",
                            "VIDEO_NOTE",
                            "NORMAL_NOTE"
                        ],
                        "type": "string",
                        "description": "Filter note search results by note type.",
                        "default": "ALL"
                    },
                    "timeFilter": {
                        "title": "Publish time",
                        "enum": [
                            "ALL",
                            "ONE_DAY",
                            "ONE_WEEK",
                            "HALF_YEAR"
                        ],
                        "type": "string",
                        "description": "Filter note search results by publish time.",
                        "default": "ALL"
                    },
                    "orderBy": {
                        "title": "Hot-search ranking metric",
                        "enum": [
                            "premium_imp_num",
                            "premium_good_read_rate",
                            "premium_read_num",
                            "premium_engage_num",
                            "premium_engage_rate",
                            "premium_like_num",
                            "premium_fav_num",
                            "premium_cmt_num"
                        ],
                        "type": "string",
                        "description": "Ranking metric used by the hot-search operation.",
                        "default": "premium_imp_num"
                    },
                    "nd": {
                        "title": "Hot-search time range",
                        "enum": [
                            "DAY_3",
                            "DAY_7",
                            "DAY_14",
                            "DAY_30"
                        ],
                        "type": "string",
                        "description": "Time range used by the hot-search operation.",
                        "default": "DAY_7"
                    },
                    "sort": {
                        "title": "Comments or topic sort",
                        "type": "string",
                        "description": "Use latest/normal for comments and hot/time for topics."
                    },
                    "format": {
                        "title": "Alternate note detail format",
                        "type": "boolean",
                        "description": "Leave disabled unless confirmed by the API administrator.",
                        "default": false
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
