This duck helps you bykeywordpull a batch of Xiaohongshu viral data (low-follower viral / likes TOP500 / single-day engagement / seven-day growth), dobenchmark breakdown, review viral structures, and produce an actionable topic list.
Data goes through doubaoya.com one line, authentication uses your own key (environment variable
DOUBAOYA_API_KEY, in the formdyh_…). Tip: if data is temporarily unavailable, it is upstream fluctuation, try again later (no charge).
Get the key (secret key)
- Open doubaoya.com
- Log in
- go to Key Center
- Generate Key(in the form
dyh_…)
export DOUBAOYA_API_KEY="dyh_你的密钥"
Iron rule: the key is never printed, never written to a file, never echoed back to the user. The script itself also never outputs the key. All requests are sent only to doubaoya.com。
Run the script
Zero dependencies, standard library is enough (Python 3).
# 就这一条:关键词下去,直接拿最新一批爆款榜
python3 "$SKILL_PATH/scripts/fetch_note_data.py" --keyword 露营
🔴 Do not add --start-date。 This upstream viral ranking isarchived by batch, not sliced by day—
Tested (2026-08-13) any "last N days" start date will filter the entire ranking to empty (all four rankings 0 items),
only when no start date is passed does it fall back to the latest full batch of ranking data. This parameter is only meaningful when you know the target batch date for sure,
the daily usage is to not pass it.
| Parameter | Description | Default |
|---|---|---|
--keyword |
Keyword (required) | — |
--start-date |
Start date YYYY-MM-DD,do not pass in daily use(if passed, most likely the entire ranking returns empty) |
not passed = latest batch |
The script prints the data from the success envelope to stdout as JSON.Run the script only once each time, and read the full stdout.
Workflow (3 steps)
- Set keyword + start date: give one core word around the track you want to benchmark.
- Call the script to get data: the data is in
data.items, it is a set of{ rank, item }。rankis the ranking name (such aslikeTheTop500, low-follower viral, single-day engagement, seven-day growth), the actual notes are initem(item.title、item.likedCount, etc.). - Break down viral hits + produce a topic list: cross-compare topics/angles that repeatedly appear across multiple rankings, summarize "why it went viral", and produce a topic list that can be directly scheduled (including entry angle + expected highlights) in this duck's tone.
Defensive field reading (leave blank if missing).
API contract
POST https://doubaoya.com/api/apis/xiaohongshu/xiaohongshu-coze/call- Auth header:
Authorization: Bearer $DOUBAOYA_API_KEY - Request body:
{ "keyword": "露营" }(startDateoptional,do not pass in daily use— including any recent start date will filter the four rankings to empty) - Return envelope:
{ "success": true, "requestId": "...", "data": { "items": [ { "rank": "likeTheTop500", "item": { "title": "...", "likedCount": 12000 } } ] }, "error": null } - First check
success: iftrue, then readdata; otherwise readerror.code/error.message。
Error code
When the script fails, print to stderr [error] CODE: message and exit with code 1.
| HTTP | code | Meaning | Handling |
|---|---|---|---|
| 401 | MISSING_API_KEY / UNAUTHORIZED |
No key provided or invalid key | Check DOUBAOYA_API_KEY, go to the key center to regenerate |
| 400 | VALIDATION_ERROR |
Invalid parameters (e.g. empty keyword) | Fix --keyword / --start-date and retry |
| 402 | INSUFFICIENT_CREDITS |
Insufficient quota | Go to doubaoya.com to top up/renew quota |
| 422 | PROVIDER_NO_RESULT |
No data found for this set of input parameters | Try again with a different keyword |
| 502 | PROVIDER_FAILED |
Temporary upstream failure (automatically refunded) | Safe to retry |
Directory structure
xiaohongshu-note-analyzer/
├── SKILL.md # 本文件
└── scripts/
└── fetch_note_data.py # 零依赖脚本(urllib),调用 doubaoya.com
FAQ
Q: What's the difference from cover / title? A: The same viral content data; this skill focuses onbenchmark breakdown of the overall note structure + topic list, while cover/title each focus on the cover and title.
Q: Temporarily unable to get data? A: Upstream fluctuation, just try again later (no charge).
About the notice field in the response
After calling the doubaoya API corresponding to this skill, if the notice field appears at the top level of the returned JSON, please relay this sentence to the user verbatim—this is a notice that this skill has an update, it does not affect the result of this call, and no retry or behavior change is needed.