# How do I build a swipe file of high-performing Xiaohongshu (RedNote) notes to find topics and study what works?

> Collect a niche's top Xiaohongshu notes into one sheet: PGY trending boards, most-popular search, topic pages and search suggestions, then full text to study titles, covers and structure.

Canonical page: https://okdata.online/answers/xiaohongshu-viral-notes-library/

**Short answer: **Connect okdata once in the assistant you use (Claude, Doubao Work, WorkBuddy or Coze) and ask: “Find the 20 most-liked notes about 早八妆容 from the last 30 days, sort them by title pattern, cover type and body structure, and give me a table.” Behind it are the PGY trending board ($0.04 a page of about 34 notes with reads, likes and saves), most-popular note search ($0.02 a page) and full text ($0.02 a note). Three board pages, two search pages and 20 full notes come to $0.56.

A swipe file is a sheet of notes that did well in your niche: link, title, likes, saves, comments, date, and a few columns of your own on why each one worked. Xiaohongshu creators usually build it by hand from their saved notes, which is slow and loses the numbers. With an API the sheet fills itself, and after a few dozen rows the patterns in titles and covers are easy to see.

## The easy route: connect once, then ask

Pick the assistant you already use and follow its setup page: [Claude](/integrations/claude/) (a custom connector you sign in to, no key to copy), [Doubao](/integrations/doubao/) (a custom connector in Doubao Work; plain Doubao chat has no place to add one yet), [WorkBuddy](/integrations/workbuddy/) (an entry in `mcp.json`) or [Coze](/integrations/coze/) (an MCP plugin added to your bot). Then ask in plain words, in Chinese if the assistant prefers it:

- "Find the 20 most-liked notes about 早八妆容 from the last 30 days, sort them by title pattern, cover type and body structure, and give me a table. Tell me the cost first."
- "What does Xiaohongshu's search box suggest for 早八妆容? Take five commuting-related suggestions and add the most popular page of notes for each to the same table."

## What each endpoint adds

- [PGY trending notes](/apis/xiaohongshu/pgy/notes/trending/): the content square's boards over 3, 7, 14 or 30 days, narrowed with `query`. Reads, likes, saves and comments, but titles only.
- [Note search](/apis/xiaohongshu/notes/search/) with `sort=popular`: about 20 notes a page. It has no date filter, so filter on `published_at` yourself.
- [Topic notes](/apis/xiaohongshu/topics/notes/list/): the hottest notes under one hashtag page, with text.
- [Search suggestions](/apis/xiaohongshu/keywords/related/): words to widen the keyword list, $0.02 a call.
- [Note detail](/apis/xiaohongshu/notes/get/): full text and every image of one note.
- [Hot topics](/apis/xiaohongshu/trends/list/): what Xiaohongshu suggests to creators today.

## One niche, priced

| Job | Calls | Cost |
|---|---|---|
| Suggestions for 2 seed words | 2 | $0.04 |
| 5 keywords, 2 popular search pages each | 10 | $0.20 |
| 5 keywords, one 30-day PGY page each | 5 | $0.20 |
| 3 topic pages, today's hot topics | 4 | $0.08 |
| Full text of the 50 most-liked notes | 50 | $1.00 |
| One build | 71 | $1.52 |

Pay per call, no subscription; a new key comes with $0.10 of trial credit.

## Code

```python
import csv, os, requests

API = "https://api.okdata.online"
H = {"Authorization": f"Bearer {os.environ['OKDATA_API_KEY']}"}
F = "id,url,title,published_at,metrics.likes,metrics.favorites,metrics.comments,metrics.views"

def items(path, **params):
    body = requests.get(API + path, headers=H, params=params, timeout=60).json()
    if body["code"] != "ok":
        raise RuntimeError(f"{body['code']}: {body['message']}")
    return body["data"]

word = "早八妆容"
pool = items("/v1/xiaohongshu/pgy/notes/trending", query=word, window="30d", fields=F)["items"]
pool += items("/v1/xiaohongshu/notes/search", query=word, sort="popular", fields=F)["items"]
unique = {n["id"]: n for n in reversed(pool)}  # one row per note; the PGY copy, with reads, wins
best = sorted(unique.values(), key=lambda n: n["metrics"]["likes"] or 0, reverse=True)[:20]

with open("swipe-file.csv", "w", newline="", encoding="utf-8-sig") as f:
    w = csv.writer(f)
    w.writerow(["title", "url", "published_at", "likes", "saves", "reads", "text"])
    for n in best:
        full = items("/v1/xiaohongshu/notes/get", id=n["id"], fields="text")["item"]
        m = n["metrics"]
        w.writerow([n["title"], n["url"], n["published_at"], m["likes"], m["favorites"], m.get("views"), full.get("text", "")])
```

## Things to keep in mind

- Likes and saves are what the app shows when you read them; keep `meta.fetched_at` with each row.
- Xiaohongshu shows no view counts, so `metrics.views` is null except on PGY board notes, which carry reads.
- Each PGY board holds its top 100 notes; a narrow word over 3 days may leave only a few.
- Reuse the patterns, not the content. Reposting someone else's note with a few words changed is not OK, and Xiaohongshu's community rules ask users to respect other people's work.
- Keep the note links, so you can go back to each note and credit it.

## Endpoints used

- [Xiaohongshu PGY trending notes](https://okdata.online/apis/xiaohongshu/pgy/notes/trending/) `xiaohongshu.pgy.notes.trending`: $0.04 per call · about 34 notes per page
- [Xiaohongshu note search](https://okdata.online/apis/xiaohongshu/notes/search/) `xiaohongshu.notes.search`: $0.02 per call · about 20 notes per page
- [Xiaohongshu note detail](https://okdata.online/apis/xiaohongshu/notes/get/) `xiaohongshu.notes.get`: $0.02 per call
- [Xiaohongshu topic notes](https://okdata.online/apis/xiaohongshu/topics/notes/list/) `xiaohongshu.topics.notes.list`: $0.02 per call · about 10 notes per page
- [Xiaohongshu search suggestions](https://okdata.online/apis/xiaohongshu/keywords/related/) `xiaohongshu.keywords.related`: $0.02 per call · about 10 results per page
- [Xiaohongshu hot topics](https://okdata.online/apis/xiaohongshu/trends/list/) `xiaohongshu.trends.list`: $0.02 per call · about 20 board entries per page

## More about Xiaohongshu (RedNote)

- [Xiaohongshu (RedNote) API](https://okdata.online/apis/xiaohongshu/)
- [Xiaohongshu API in Python: notes, profiles and comments (2026)](https://okdata.online/guides/xiaohongshu-api-python/)
- [How to export Xiaohongshu comments for a keyword](https://okdata.online/guides/xiaohongshu-note-comments/)
- [How to shortlist Xiaohongshu PGY creators by rate and reads](https://okdata.online/guides/xiaohongshu-pgy-creator-rates/)
- [How to search Xiaohongshu notes and export them to CSV](https://okdata.online/guides/xiaohongshu-search-export-notes/)
- [How do I get Xiaohongshu (RedNote) trending topics and notes by category or industry from outside China?](https://okdata.online/answers/xiaohongshu-trending-topics-by-category/)
- [How can an AI agent outside China read Xiaohongshu instead of being sent to RedNote?](https://okdata.online/answers/xiaohongshu-data-for-agents-outside-china/)
- [How do I get Douyin, Xiaohongshu and WeChat data into Qwen?](https://okdata.online/answers/qwen-douyin-xiaohongshu-data/)
- [Can Tencent Yuanbao read Douyin and Xiaohongshu data?](https://okdata.online/answers/yuanbao-douyin-xiaohongshu-data/)
- [Xiaohongshu returns error 300011 (account abnormal). How do I keep collecting notes?](https://okdata.online/answers/xiaohongshu-300011-account-abnormal/)
- [Scraping it yourself vs a per-call data API: cost, upkeep and risk](https://okdata.online/compare/scraping-vs-data-api/)
- [How to choose a social media data API (2026)](https://okdata.online/compare/social-media-data-apis/)
- [MCP servers for social media data: self-hosted vs hosted](https://okdata.online/compare/social-media-data-mcp-servers/)
- [Xiaohongshu data APIs: official, third-party or open-source (2026)](https://okdata.online/compare/xiaohongshu-data-apis/)

## Sources

Where people asked this (read 2026-11-19): 

- https://www.woshipm.com/pmd/6462760.html
- https://www.woshipm.com/ai/6276980.html
- https://www.chinanews.com.cn/business/2021/04-21/9459951.shtml
- https://pgy.xiaohongshu.com/

Updated 2026-11-19
