SuperAPI AI Directory

xiaohongshu-hot-notes

Marketing & growth

View repository

Updated 10-16 05:57

About this skill

Xiaohongshu Viral Note Discovery 🦆

Produced by Dubaoya. This duck helps you fish out the notes in a niche that are currently the strongest and rank them—who has high likes, who has lively comments, see through at a glance; then conveniently break down a few topic ideas for you, so your next post also writes toward "viral."

One-sentence positioning

Give this duck atopic / niche keyword, and this duck will go search a round of notes on Xiaohongshu, rank them byengagement heat (likes + comments)from high to low into a leaderboard, push the hottest viral notes to the very front, and finally give you a set oftopic takeaways。

Suitable for content creators, brand operations, MCNs, and growth teams—any scenario that needs to "quickly figure out what content is currently going viral in a certain niche."

Small tip: our interface uses "search notes + engagement sorting" to approximate the hot-list effect, so the leaderboard reflectshigh-engagement notes found under that keyword, not the platform's official real-time hot list. The more accurate the word choice, the closer the leaderboard fits.


Workflow (required reading for Agent)

When the user says things like "check Xiaohongshu viral notes for XX," "what popular notes are there in the XX niche," or "help me find benchmark viral notes":

  1. Determine the keyword: Extract a niche / topic keyword from the user's words (such as "fat-loss breakfast," "morning vitamin C and evening vitamin A," or "camping gear"). The more specific the keyword, the more precise the leaderboard. When the user gives something vague, you may proactively narrow it down to a more focused word.
  2. Run the script to search + sort: Call scripts/fetch_hot_notes.py, passing in the keyword. When a larger sample is needed, add --pages 2 or --pages 3(default 1 page, maximum 3 pages). The script will page through and collect notes, sort them in descending order by "likes + comments," and output JSON.
  3. Present the leaderboard: Render the script output into a sorted Markdown table (see the template below), ranked from No. 1 downward by heat.
  4. Give topic takeaways: Based on the top notes on the leaderboard, extract 2-4 reusable patterns for topics / titles / presentation formats to help the user land their next post.

Iron rule of authenticity: the titles, likes, comments, and authors in the table may only come from the script return,hallucinated padding is prohibitedfor rankings or engagement numbers. For fields the script did not return, leave them blank in the table or write "—."

Leaderboard template

Rank Title Likes Comments Author Publish time
🥇 1 …… 12.3k 856 …… ……
🥈 2 …… …… …… …… ……
🥉 3 …… …… …… …… ……

Fields correspond to the script return's title / likeCount / commentCount / authorName / publishTime, some fields may be missing; if missing, leave "—."

Topic takeaways template

🦆 This duck breaks down the leaderboard:

  • Topic direction: The top notes generally do "...", which shows this angle is currently popular.
  • Title formulas: Highly liked titles often use the "..." structure (numbers / pain points / contrast / suspense).
  • Presentation format: ... (listicle / tutorial / review / first-person story).
  • Points you can copy: In your next post, you can try "...".

Get the key (configure the API key) 🔑

This skill uses onekey(API Key) to call the Doubaoya API.

How to get the key:

  1. Open doubaoya.com
  2. Log in to your account
  3. Go to Key Center
  4. Click Generate Key, copy it out (the key looks like dyh_…)

Configure it as an environment variable DOUBAOYA_API_KEY:

  • macOS / Linux:
    echo 'export DOUBAOYA_API_KEY=<你的密钥>' >> ~/.zshrc
    source ~/.zshrc
    
  • Windows(PowerShell):
    [Environment]::SetEnvironmentVariable("DOUBAOYA_API_KEY", "<你的密钥>", "User")
    

Verify:echo $DOUBAOYA_API_KEY(macOS/Linux) or echo %DOUBAOYA_API_KEY%(Windows); if it prints a string starting with dyh_… , it is in effect. After changing environment variables, remember to reopen the terminal.

🔒 Key security iron rule: The key is a private credential;neverprint it in conversations, logs, or screenshots, and do not commit it to a public repository. The script only reads it from environment variables, and this duck will not echo it back to you.


Run the script

The script has zero dependencies (pure Python 3 standard library), so you do not need to install any packages.

# 默认搜 1 页,按互动量排序
python3 scripts/fetch_hot_notes.py "减脂早餐"

# 多翻几页拿更大样本(最多 3 页)
python3 scripts/fetch_hot_notes.py "通勤穿搭" --pages 3

The script will:

  1. Read the key from DOUBAOYA_API_KEY (if not configured, it will error and prompt you to get the key, without printing the key);
  2. Page through POST https://doubaoya.com/api/apis/xiaohongshu/search-note/call, with request body {"keyword": "...", "page": N};
  3. Aggregate data.itemsfrom each page, sorted by likeCount + commentCount in descending order;
  4. Print the sorted note list as JSON to standard output.

API and response envelope

  • API:POST https://doubaoya.com/api/apis/xiaohongshu/search-note/call
  • Auth header:Authorization: Bearer $DOUBAOYA_API_KEY
  • Request body(only these two fields):
    { "keyword": "减脂早餐", "page": 1 }
    
    • keyword(string, required): topic / niche keyword
    • page(int, optional): page number
  • Response envelope:
    {
      "success": true,
      "requestId": "…",
      "data": { "items": [ { "title": "…", "authorName": "…", "likeCount": 1234, "commentCount": 56, "publishTime": "…" } ] },
      "error": null
    }
    
    First check success: only read true when it is data.items; read note fields defensively (may be missing title / authorName / likeCount / commentCount / publishTime)。

Error handling

The script has built-in handling; in the following situations it will print [error] code: message to stderr and exit with code 1:

Status code Meaning and handling
401 MISSING_API_KEY / UNAUTHORIZED No key configured or the key is invalid. Go to the doubaoya.com Key Center to regenerate it, and reconfigure DOUBAOYA_API_KEY。
400 VALIDATION_ERROR Invalid request parameters (such as an empty keyword). Try again with a different keyword.
402 INSUFFICIENT_CREDITS Insufficient balance / credits. Top up at doubaoya.com and try again.
502 PROVIDER_FAILED Temporary upstream failure;automatically refunded, safe to retry. Just rerun later.

Network exceptions (cannot connect, timeout) will report NETWORK_ERROR; check the network and retry.


Directory structure

xiaohongshu-hot-notes/
├── SKILL.md                      # 本文件:定位、工作流、拿钥匙、接口与错误处理
└── scripts/
    └── fetch_hot_notes.py        # 搜索笔记 + 按互动量排序,输出排好序的 JSON

Notes

  • Data authenticity: The ranking only recognizes what the script returns; fabricating rankings or interaction counts is prohibited.
  • The key must never be leaked: do not print it, store it in a database, or include it in screenshots.
  • Ranking criteria: Based on "keyword search + engagement ranking", this reflects high-engagement notes under that term, not the platform's official real-time trending list; the more precise the keyword, the closer the match.
  • Controlled pagination: The default 1 page is usually enough, and 3 pages at most; don't mindlessly max it out and waste quota.
  • Compliance: Jumping to the original text and secondary use must comply with Xiaohongshu platform rules and copyright requirements.

About the notice field in the response

After calling the doubaoya API corresponding to this skill, if the returned JSON has at the top level a notice field, please relay this sentence to the user verbatim - this is a notice that there is an update to this skill, does not affect the result of this call, and does not require retrying or changing behavior.