# Xiaohongshu (RED) Note Tracker - Likes, Comments, Changes (`magenta_courser/xiaohongshu-note-tracker`) Actor

Paste Xiaohongshu note links and get likes, collects, comments and shares per note, with the change since your last run. One flat row per link, no login, no browser.

- **URL**: https://apify.com/magenta_courser/xiaohongshu-note-tracker.md
- **Developed by:** [SUNGHWAN CHO](https://apify.com/magenta_courser) (community)
- **Categories:** Social media, Marketing
- **Features:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 89.5% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.20 / 1,000 notes

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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

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

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Xiaohongshu (RED / rednote) Note Metrics Tracker

Paste Xiaohongshu note links and get likes, collects, comments and shares per note, with the change since your last run. Xiaohongshu (小红书, also called RED or rednote) is China's largest lifestyle and shopping-discovery platform, where most influencer campaigns are measured by exactly these four numbers. This Actor is for the marketing or agency team that has a list of campaign posts and needs the numbers again every day: one flat row per link, every run, with `likeChange`, `collectChange`, `commentChange` and `shareChange` already computed. No login, no cookies, no browser: each note is one plain HTTP request to the public note page. Only one input is required: `noteUrls`.

### What you get

One row per link you pasted, in a flat JSON structure (numbers are numbers, missing values are `null`):

- `noteId`, `status` (`ok`, `needs_token`, `not_found`, `blocked`, `error`) and a plain-English `statusMessage` that says what to do next
- `title`, `description`, `noteType` (`normal` = images, `video`), `tags`, `imageCount`, `hasVideo`, `videoDurationSec`, `ipLocation`
- `authorId`, `authorName`, `authorUrl`
- `publishedAt`, `lastUpdatedAt` (ISO 8601)
- `likeCount`, `collectCount`, `commentCount`, `shareCount` as integers, each with `...Raw` (the text Xiaohongshu shows, e.g. `"2.6万"`) and `...IsApprox` (see below)
- `viewCount`: always `null` (see below)
- **Change since your last run:** `previousScrapedAt`, `previousLikeCount` / `likeChange`, `previousCollectCount` / `collectChange`, `previousCommentCount` / `commentChange`, `previousShareCount` / `shareChange`, `isFirstSeen`, plus `likeChangeIsApprox` etc.
- `inputUrl` (what you pasted), `resolvedUrl` (where a short link led), `url` (canonical note link with its token), `scrapedAt`

Only `status: ok` rows are charged. Rows with any other status are free and still saved, so you always get one row per link you pasted.

The key-value store record `RUN_SUMMARY` has the counts per status, requests sent, blocks seen, which proxy was used and why the run stopped.

### Honest about the numbers

- **Values of 10,000 and above are approximate.** Xiaohongshu shows them abbreviated (`2.6万` = 26,000, `10万+` = 100,000+). The Actor converts them to integers and sets `likeCountIsApprox: true` (same for collects, comments, shares) and keeps the original text in `likeCountRaw`. Below 10,000 the value is exact and `IsApprox` is `false`. A change computed from an approximate value is flagged with `likeChangeIsApprox: true`; a note at 25,900 likes can show `0` change for days and then jump by 1,000, and that is the platform's rounding, not a bug. Some competing scrapers return `26000` with no flag; we think you should know which numbers you can trust.
- **Views are not available.** Xiaohongshu shows the view count only to the note's author in the creator tools. No public scraper can provide it without logging in as that author, so `viewCount` is always `null` instead of a made-up number.
- **One row per link, even on failure.** A deleted note, an expired token, a block or an unreachable short link produces a row with the matching `status` and a message. You never have to guess which link went missing.
- **One source, documented.** All numbers come from the public note page (the `interactInfo` block). `commentCount` is the number the page shows, which includes replies. The Actor does not mix numbers from several endpoints.

### Which links work (the xsec_token)

Xiaohongshu only serves a note page to a link that carries an `xsec_token`. Every link the app or website produces with **Share -> Copy link** has one. Accepted forms:

- `https://www.xiaohongshu.com/explore/<noteId>?xsec_token=...` (website)
- `https://www.xiaohongshu.com/discovery/item/<noteId>?...&xsec_token=...` (app share)
- `https://www.xiaohongshu.com/user/profile/<userId>/<noteId>?xsec_token=...` (from a profile page)
- The whole share text the app copies (`... 发布了一篇小红书笔记 ... http://xhslink.com/a/... 复制本条信息 ...`): the link is extracted
- `xhslink.com` / `xhslink.cn` short links: followed once (that hop counts as one request); the destination is saved in `resolvedUrl`

A **bare 24-character note ID** or a link **without** `xsec_token` is accepted but returns a `needs_token` row without any request, because the platform would only answer with its "page not found" screen. Copy the link again from the app (Share -> Copy link) and paste that one.

In our tests a token stayed valid for at least several hours of repeated runs. If a link starts returning `not_found` after working before, its token has expired or the note was removed; copy a fresh share link.

### Daily tracking

1. Paste your campaign links into `noteUrls` and run once. Every note is `isFirstSeen: true` with empty change fields.
2. Save the run as a Task and add a Schedule (for example every day at 09:00). Each run compares with the last successful read of the same note, stored under the note ID in the key-value store named in `historyStoreName` (default `xiaohongshu-note-history`), so scheduled runs line up without merging datasets.
3. Use a different `historyStoreName` per campaign if you want independent baselines.
4. `compareWithLastRun: false` turns the comparison off (no store is read or written).

#### Changes only (cheaper monitoring)

Set `outputMode` to `changesOnly` and the run saves (and charges) only notes that are new or whose like, collect, comment or share count changed since the last run. Problem rows (`needs_token`, `not_found`, `blocked`, `error`) are always saved and never charged. The baseline of unchanged notes is still refreshed, so `previousScrapedAt` always points at the previous run.

### Drop-in replacement for socialdatax get_note_detail

If your sheets or pipelines were built on `socialdatax/socialdatax-xhs-data-api` (operation `get_note_detail`), set the input `columnFormat` to `socialdatax` and keep your sheet as it is. Each row then has exactly their keys, in their order, with the same types and the same values as their output for the same note (verified field by field against `get_note_detail` rows of two image notes and one video note, 2026-11-06), and our own columns are appended after them. Rows that could not be read keep the same key set, with `null` values and `status` / `status_message` filled, and are still free. Change tracking and the history store work the same in both formats, so you can switch formats without losing your baseline.

| socialdatax column | Value | Tracker column |
|---|---|---|
| `operation` | always `"get_note_detail"` | - |
| `item_index` | 1-based position of the link in `noteUrls` | - |
| `query_note_url` | the link exactly as you pasted it | `inputUrl` |
| `note_id` | 24-character note ID | `noteId` |
| `note_url` | `https://www.xiaohongshu.com/explore/<id>?xsec_token=<URL-encoded token>` | `url` |
| `note_type` | `"image"` or `"video"` | `noteType` (`normal` / `video`) |
| `title`, `content` | title and note text (`""` when empty) | `title`, `description` |
| `cover_image_url`, `image_items[]` | `sns-img-qc.xhscdn.com` webp URLs with `width`, `height`, `live_photo` (for a video note: the single cover frame, as in their output; `live_photo` is `null` on every verified image, the live-photo shape is unverified) | `imageCount` |
| `video` (image notes) / `video_video_url`, `video_duration_ms`, `video_width`, `video_height` (video notes) | `video: null` for image notes. For video notes socialdatax replaces that key with four flat keys in the same position: the h264 stream URL, the length in **milliseconds** (e.g. `36800`), width and height (e.g. `720`, `1280`); verified against their row of a video note. `video_video_url` is the same stream file (`/stream/1/110/258/<file>_258.mp4`) but served from the page's `rednotecdn.com` host without the `?sign=` query that only their API issues | `hasVideo`, `videoDurationSec` |
| `like_count`, `collect_count`, `comment_count`, `share_count` | integers, `"2.6万"` becomes `26000` | `likeCount` ... |
| `publish_time` | unix seconds | `publishedAt` (ISO 8601) |
| `update_time` | unix seconds of the last edit, `null` when the note was never edited (verified: a note stamped 1 s after publishing gives `null` in their output, notes edited 100 s and 45,052 s after publishing give the timestamp) | `lastUpdatedAt` |
| `ip_location` | region label, `""` when the page has none (`""` on all three verified notes; the non-empty shape is unverified) | `ipLocation` |
| `topic_tags[]` | `{name, id}` | `tags[]` (names) |
| `mentioned_users[]` | `{user_id, name}` of @-mentions (`[]` on all three verified notes; the non-empty shape is unverified) | - |
| `author_user_id`, `author_name`, `author_avatar_url`, `author_profile_url` | author fields, avatar as `sns-avatar-qc.xhscdn.com/...?imageView2/2/w/120/format/jpg` | `authorId`, `authorName`, `authorUrl` |
| appended: `status`, `status_message` | same meaning as in the tracker format | `status`, `statusMessage` |
| appended: `like_count_raw`, `like_count_is_approx` (and `collect_`, `comment_`, `share_`) | the text Xiaohongshu shows and whether the integer is a rounded value | `likeCountRaw`, `likeCountIsApprox` ... |
| appended: `scraped_at`, `previous_scraped_at`, `like_change`, `collect_change`, `comment_change`, `share_change`, `is_first_seen` | change since your last run | `scrapedAt`, `previousScrapedAt`, `likeChange` ... |

Not included: their `points.*` billing object and the `page_*` paging keys (this Actor returns one note per row and bills per row instead). `update_time` is `null` when the page's last-update time is within one second of publishing (Xiaohongshu stamps every unedited note that way and socialdatax reports `null` for it); any later value is reported as is. Verified field by field against three `get_note_detail` rows (two image notes, one video note, 2026-11-06); only `video_video_url` differs by host and signature as described above.

### Pricing and cost

You pay per note row with `status: ok`. Everything else is free: problem rows, the run summary, retries. One note is one HTTP request of about 65 KB, so a daily run over 200 campaign posts is 200 requests and takes a few minutes at 256 MB of memory.

### Limits (by design)

- **No keyword search, no comments, no profile pages.** Those parts of Xiaohongshu need signed API calls or a login, which this Actor does not do.
- Requests are sent two at a time with a pause between them. A blocked note is retried once through an Apify residential proxy; after 5 blocked responses in a row the run stops and the remaining links get an error row, so you are not charged for guesses.
- `maxRequests` (0 = unlimited) and `maxRunMinutes` cap a run. When a cap or your "Maximum cost per run" is reached, the run stops cleanly and the status message says what was left.
- Video notes: `hasVideo` and `videoDurationSec` (whole seconds, from the same stream length socialdatax reports in milliseconds) have been verified on one video note; the counts on more.

### Disclaimer

This is an unofficial tool and is not affiliated with Xiaohongshu. It reads only the public note page that any visitor without an account can open, sends no login, keeps no cookies and does not try to bypass the platform's risk control. Use it for notes you have the right to monitor (your own campaigns, your creators' posts) and respect Xiaohongshu's terms of service and applicable law. Data accuracy depends on what the platform shows at the moment of the request.

### Changelog

- **0.2.2 (2026-11-06)** - `columnFormat: socialdatax` checked against a real video note: video notes now carry their four flat keys `video_video_url`, `video_duration_ms`, `video_width`, `video_height` in place of `video` (before: a nested `video` object with seconds). `update_time` now matches their rule exactly (`null` only when the stamp is within 1 s of publishing; before: within 60 s). `videoDurationSec` is derived from the stream length (ms) instead of the rounded `capa` value.

- **0.2.0 (2026-11-06)** - New input `columnFormat` (`tracker` default, `socialdatax`): rows in the socialdatax `get_note_detail` column layout, our columns appended, so existing sheets keep working. Fix: Xiaohongshu now redirects note pages to `rednote.com`, where the embedded page data contains `new Set(...)`; the parser handles it (before this fix every note came back as `error: unexpected page format`). `rednote.com` redirect targets of short links are accepted. Dataset view "socialdatax columns" added.

- **0.1.3 (2026-10-30)** - First release: likes, collects, comments, shares per note link with change tracking, approximate-value flags, free status rows, short-link resolution.

# Actor input Schema

## `noteUrls` (type: `array`):

Required. Xiaohongshu note links, one per line, copied from the app or website with Share -> Copy link. Accepted: full links with xsec_token (xiaohongshu.com/explore/..., /discovery/item/..., /user/profile/<userId>/<noteId>...), the whole share text the app copies (the link is extracted), and xhslink.com / xhslink.cn short links (followed once). A bare 24-character note ID or a link without xsec_token is accepted but returns a needs_token row without a request, because Xiaohongshu only serves a note page to a link that carries the xsec_token from a share link.

## `compareWithLastRun` (type: `boolean`):

Add previousLikeCount / likeChange, previousCollectCount / collectChange, previousCommentCount / commentChange, previousShareCount / shareChange, previousScrapedAt and isFirstSeen to every note, compared with the last run that read the same note successfully. The previous values are kept in a named key-value store in your account, so scheduled daily runs line up automatically.

## `outputMode` (type: `string`):

"changesOnly" saves (and charges) only notes seen for the first time or whose like, collect, comment or share count changed since the last run; rows with a problem (needs_token, not_found, blocked, error) are always saved and never charged. Needs "Compare with last run".

## `columnFormat` (type: `string`):

Shape of each output row. Use socialdatax if your sheets already use socialdatax/socialdatax-xhs-data-api get_note_detail column names: the row then has exactly their keys (operation, item_index, query_note_url, note_id, note_url, note_type, title, content, cover_image_url, image_items, video, like_count, collect_count, comment_count, share_count, publish_time, update_time, ip_location, topic_tags, mentioned_users, author_user_id, author_name, author_avatar_url, author_profile_url) followed by our status, raw-count and change columns (status, status_message, like_count_raw, ..., scraped_at, previous_scraped_at, like_change, ..., is_first_seen). Change tracking and the history store work the same in both formats.

## `historyStoreName` (type: `string`):

Named key-value store that keeps the last counts per note. Use a different name for each separate campaign if you want independent baselines.

## `proxyConfiguration` (type: `object`):

Keep the default (Apify datacenter proxy): in our tests every note page loaded through it. When a request comes back blocked, that note is retried once through an Apify RESIDENTIAL proxy (more expensive, used only for that retry). Choose RESIDENTIAL here only if a whole run was blocked.

## `maxRequests` (type: `integer`):

Optional. Upper limit on HTTP requests for the whole run, retries and short-link hops included. 0 = unlimited (default). Each note needs at least one request; a blocked note takes one more, a short link one more. When the limit is used up the run stops and the remaining links get an error row.

## `maxRunMinutes` (type: `integer`):

Optional. The run stops sending new requests after this many minutes, default 60, and the remaining links get an error row. Independent of this, the run also stops after 5 blocked requests in a row.

## Actor input object example

```json
{
  "noteUrls": [
    "https://www.xiaohongshu.com/explore/6a6feaab000000003302fad8?xsec_token=ABf3DsGp_ZzmryWzx2yfsgqgO8o4ZNhFJ2IxmNI-AHqfM=&xsec_source=pc_feed",
    "https://www.xiaohongshu.com/explore/6a77e9330000000022031953?xsec_token=ABz6eqgPea4GipiUrQ9FA4zdHWcB9z-pMB4LVcoBtBA3c=&xsec_source=pc_feed"
  ],
  "compareWithLastRun": true,
  "outputMode": "all",
  "columnFormat": "tracker",
  "historyStoreName": "xiaohongshu-note-history",
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "maxRequests": 0,
  "maxRunMinutes": 60
}
```

# Actor output Schema

## `notes` (type: `string`):

One row per input link: status, likes, collects, comments, shares and the change since the last run.

## `runSummary` (type: `string`):

Row counts per status, requests sent, blocks, proxy used and stop reason. Not billed.

# 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 = {
    "noteUrls": [
        "https://www.xiaohongshu.com/explore/6a6feaab000000003302fad8?xsec_token=ABf3DsGp_ZzmryWzx2yfsgqgO8o4ZNhFJ2IxmNI-AHqfM=&xsec_source=pc_feed",
        "https://www.xiaohongshu.com/explore/6a77e9330000000022031953?xsec_token=ABz6eqgPea4GipiUrQ9FA4zdHWcB9z-pMB4LVcoBtBA3c=&xsec_source=pc_feed"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("magenta_courser/xiaohongshu-note-tracker").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 = {
    "noteUrls": [
        "https://www.xiaohongshu.com/explore/6a6feaab000000003302fad8?xsec_token=ABf3DsGp_ZzmryWzx2yfsgqgO8o4ZNhFJ2IxmNI-AHqfM=&xsec_source=pc_feed",
        "https://www.xiaohongshu.com/explore/6a77e9330000000022031953?xsec_token=ABz6eqgPea4GipiUrQ9FA4zdHWcB9z-pMB4LVcoBtBA3c=&xsec_source=pc_feed",
    ],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("magenta_courser/xiaohongshu-note-tracker").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "noteUrls": [
    "https://www.xiaohongshu.com/explore/6a6feaab000000003302fad8?xsec_token=ABf3DsGp_ZzmryWzx2yfsgqgO8o4ZNhFJ2IxmNI-AHqfM=&xsec_source=pc_feed",
    "https://www.xiaohongshu.com/explore/6a77e9330000000022031953?xsec_token=ABz6eqgPea4GipiUrQ9FA4zdHWcB9z-pMB4LVcoBtBA3c=&xsec_source=pc_feed"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call magenta_courser/xiaohongshu-note-tracker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,magenta_courser/xiaohongshu-note-tracker"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

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