For AI

Answers

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

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 (a custom connector you sign in to, no key to copy), Doubao (a custom connector in Doubao Work; plain Doubao chat has no place to add one yet), WorkBuddy (an entry in mcp.json) or 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: 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 with sort=popular: about 20 notes a page. It has no date filter, so filter on published_at yourself.
  • Topic notes: the hottest notes under one hashtag page, with text.
  • Search suggestions: words to widen the keyword list, $0.02 a call.
  • Note detail: full text and every image of one note.
  • Hot topics: 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

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.

Sources

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

Updated

Connect once, then just ask.

Every new key comes with $0.10 to try it. One sentence connects your agent.

Start free
Connect your AI

Paste this into your agent

Read https://okdata.online/agents.md and set up okdata for me; my key is in the OKDATA_API_KEY environment variable.

Claude Code, Cursor, Codex and other agents that can open a link set themselves up from it.

MCP serverhttps://api.okdata.online/mcp