# How to search and export Xiaohongshu (RedNote) notes by keyword

2 endpoints do it: Xiaohongshu note search → Xiaohongshu note detail. The worked example below is 13 calls and costs $0.26 in all; a failed call is not charged.

Search Xiaohongshu (RedNote) notes on a keyword page by page, then get each note's full text and hashtags by ID. You end up with one table of notes: title, text, author, likes, favorites, comments, shares and images.

## Step by step

### Step 1: Xiaohongshu note search

Get a page of notes for your search terms, with `sort` set to relevance, newest or most liked. For more, pass `page.next_cursor` as `cursor` and go on. The `text` here is only the excerpt on the result card, and titles lose their emoji: take each item's `id` to the next step for the whole note. ([Xiaohongshu note search](https://dataxapi.com/apis/xiaohongshu/notes/search/), $0.0200 / a call)

cURL

```bash
curl -G "https://api.dataxapi.com/v1/xiaohongshu/notes/search" \
  --data-urlencode "query=咖啡" \
  -H "Authorization: Bearer $DATAXAPI_API_KEY"
```

Python

```python
from dataxapi import DataXAPI

dx = DataXAPI()  # reads DATAXAPI_API_KEY
result = dx.xiaohongshu.notes.search(query="咖啡")
print(result["data"]["items"])
```

TypeScript

```typescript
import { DataXAPI } from "@dataxapi/sdk";

const dx = new DataXAPI(); // reads DATAXAPI_API_KEY
const result = await dx.xiaohongshu.notes.search({ query: "咖啡" });
console.log(result.data.items);
```

CLI

```bash
dataxapi call xiaohongshu.notes.search 'query=咖啡'
```

Recorded response: From a response recorded 2026-10-12 18:43 UTC. Names, text and IDs are examples, and so are the links: none is the recorded one (the page shows no one's personal data); the figures are as recorded. Long lists are cut. The request ID, cursor and balance are made up.

```jsonc
{
  "code": "ok",
  "request_id": "d2403177-e4f6-4d04-99eb-afce599b4c31",
  "data": {
    "items": [
      {
        "id": "67d5e2be00000000d803d22d",
        "url": "https://www.xiaohongshu.com/explore/67d5e2be00000000d803d22d",
        "type": "image",
        "title": "实测一个月咖啡，结论有点意外",
        "text": "把咖啡从头到尾讲清楚，看完少走弯路",
        "published_at": "2026-05-17T05:25:25.000Z",
        "author": {
          "id": "6130783200000000883b2a1e",
          "username": "coffee_lab_sh",
          "name": "山野咖啡馆",
          "avatar_url": "https://sns-avatar-qc.xhscdn.com/avatar/610f17040000000049dd4887.jpg",
          "verified": false
        },
        "metrics": {
          "likes": 48,
          "comments": 21,
          "shares": 5,
          "favorites": 10
        },
        "images": [
          "https://sns-webpic-qc.xhscdn.com/20261010/2d7c7c32da67d3c3d839!nd_dft_wlteh_webp_3"
        ]
      },
      // … 14 more
    ]
  },
  "page": {
    "next_cursor": "c1.Ip12-f4dS4HmSDpdPex7WuLPBr1zJAbdhL_Wj8K0",
    "cursor_expires_at": "2026-10-12T19:43:26.000Z",
    "has_more": true,
    "returned": 15
  },
  "warnings": [],
  "meta": {
    "capability": "xiaohongshu.notes.search",
    "result_status": "complete",
    "fetched_at": "2026-10-12T18:43:26.000Z",
    "cached": false,
    "replayed": false,
    "unavailable": {
      "lang": "capability",
      "metrics.views": "platform",
      "metrics.reposts": "platform",
      "author.followers": "capability",
      "hashtags": "capability",
      "mentions": "capability",
      "is_pinned": "capability",
      "post_id": "platform",
      "parent_id": "platform",
      "root_id": "platform"
    },
    "billing": {
      "amount": "0.02",
      "currency": "USD",
      "balance_after": "9.98"
    }
  }
}
```

### Step 2: Xiaohongshu note detail

Put the note ID into `id` (or the note's long web link into `url`) to get the whole text, its hashtags (`hashtags`), the accounts it mentions (`mentions`) and its images (`images`). ([Xiaohongshu note detail](https://dataxapi.com/apis/xiaohongshu/notes/get/), $0.0200 / a call)

cURL

```bash
curl -G "https://api.dataxapi.com/v1/xiaohongshu/notes/get" \
  --data-urlencode "id=6ac76250000000000a021233" \
  -H "Authorization: Bearer $DATAXAPI_API_KEY"
```

Python

```python
from dataxapi import DataXAPI

dx = DataXAPI()  # reads DATAXAPI_API_KEY
result = dx.xiaohongshu.notes.get(id="6ac76250000000000a021233")
print(result["data"]["item"])
```

TypeScript

```typescript
import { DataXAPI } from "@dataxapi/sdk";

const dx = new DataXAPI(); // reads DATAXAPI_API_KEY
const result = await dx.xiaohongshu.notes.get({ id: "6ac76250000000000a021233" });
console.log(result.data.item);
```

CLI

```bash
dataxapi call xiaohongshu.notes.get id=6ac76250000000000a021233
```

Recorded response: From a response recorded 2026-10-10 12:46 UTC. Names, text and IDs are examples, and so are the links: none is the recorded one (the page shows no one's personal data); the figures are as recorded. Long lists are cut. The request ID, cursor and balance are made up.

```jsonc
{
  "code": "ok",
  "request_id": "f71a940b-5096-4ae5-8062-eb8542c0840d",
  "data": {
    "item": {
      "id": "64e3473100000000d2df6d97",
      "url": "https://www.xiaohongshu.com/explore/64e3473100000000d2df6d97",
      "type": "image",
      "title": "周末露营装备清单，新手照着买就行",
      "text": "周末露营｜第一次尝试就爱上了，清单放评论区",
      "lang": "zh-Hans",
      "published_at": "2026-10-09T01:00:34.000Z",
      "author": {
        "id": "61a2711e000000007b58eefa",
        "username": "aya_living",
        "name": "认真生活的阿雅",
        "avatar_url": "https://sns-avatar-qc.xhscdn.com/avatar/61177eaf00000000f2be6e0c.jpg"
      },
      "metrics": {
        "likes": 927,
        "comments": 122,
        "shares": 256,
        "favorites": 59
      },
      "images": [
        "https://sns-webpic-qc.xhscdn.com/20261013/beb7fc7264c0ffc27302!nd_dft_wlteh_webp_3",
        "https://sns-webpic-qc.xhscdn.com/20261012/355cf1169dfdc76d1395!nd_dft_wlteh_webp_3",
        // … 7 more
      ],
      "hashtags": [
        "户外生活",
        "好物分享",
        // … 3 more
      ],
      "mentions": [],
      "is_pinned": false
    }
  },
  "warnings": [],
  "meta": {
    "capability": "xiaohongshu.notes.get",
    "result_status": "complete",
    "fetched_at": "2026-10-10T12:46:15.000Z",
    "cached": false,
    "replayed": false,
    "unavailable": {
      "metrics.views": "platform",
      "metrics.reposts": "platform",
      "author.verified": "capability",
      "author.followers": "capability",
      "mentions.username": "platform",
      "post_id": "platform",
      "parent_id": "platform",
      "root_id": "platform"
    },
    "billing": {
      "amount": "0.02",
      "currency": "USD",
      "balance_after": "9.98"
    }
  }
}
```

## What the example costs

Three pages of search results, then the whole of 10 of the notes

| Endpoint | Calls | Price | Subtotal |
| --- | --- | --- | --- |
| [Xiaohongshu note search](https://dataxapi.com/apis/xiaohongshu/notes/search/) | 3 | $0.0200 | $0.0600 |
| [Xiaohongshu note detail](https://dataxapi.com/apis/xiaohongshu/notes/get/) | 10 | $0.0200 | $0.20 |
| Total | 13 |  | $0.26 |

Prices are the prices in force when this page was built. A failed call, and an object that does not exist, cost nothing.

## In your AI (MCP)

Connect DataXAPI to your AI client once. Then say what you want; the agent finds these endpoints, checks the price and calls them on your balance.

Say: Search Xiaohongshu for 咖啡 (coffee), go through 3 pages, then get the full text and hashtags of the top 10 notes, as one table.

What the agent sends to the call tool: 

```json
{
  "capability": "xiaohongshu.notes.search",
  "query": "咖啡",
  "idempotency_key": "<a new UUID>"
}
```

[About the MCP server](https://dataxapi.com/mcp/)

## With a Skill

The Keyword search and mentions Skill does this job as a ready-made task, under a spending cap. “What is being said about this brand or keyword on each platform?” Its example run: 3 calls, at most $0.0240. [Keyword search and mentions](https://dataxapi.com/skills/mentions/)

## Good to know

- Search returns up to 20 a page. The ads the platform mixes into results are not notes and are dropped, so a page may hold fewer than 20. A `page.next_cursor` is good for an hour.
- Search results carry no author follower count and no hashtags, and neither endpoint has a view count (`metrics.views`); `meta.unavailable` lists such fields.
- The note endpoint takes a note ID or a long web link; short links and share texts are not taken. A note that does not exist is answered not found and not charged; a search with no results is charged.
- The command line is the quickest way to export: `dataxapi call` with `--pages` walks several pages (each charged on its own, with `--max-spend` as the cap), and `--out` writes the result to a JSON file.

## Endpoints

- [Xiaohongshu note search](https://dataxapi.com/apis/xiaohongshu/notes/search/)
- [Xiaohongshu note detail](https://dataxapi.com/apis/xiaohongshu/notes/get/)

## More about Xiaohongshu (RedNote)

- [Xiaohongshu (RedNote) API](https://dataxapi.com/apis/xiaohongshu/)
- [How to get Xiaohongshu (RedNote) note comments in bulk](https://dataxapi.com/guides/xiaohongshu-note-comments/)
- [How to look up Xiaohongshu (RedNote) PGY creator rates and audience](https://dataxapi.com/guides/xiaohongshu-pgy-creator-rates/)
- [How do I export Xiaohongshu (RedNote) data?](https://dataxapi.com/answers/export-xiaohongshu-data/)
- [Can ChatGPT read Xiaohongshu (RedNote)?](https://dataxapi.com/answers/can-chatgpt-read-xiaohongshu/)

---

Catalog revision c48ce454ae6c4c65. [HTML version](https://dataxapi.com/guides/xiaohongshu-search-export-notes/)
