This Duck helps you bykeywordpull a batch of Xiaohongshu viral data (low-follower viral / likes TOP500 / daily engagement / seven-day growth), and from notes with real traffic extractcover formulas, and set cover topic directions.
Data goes through doubaoya.com as one line, authentication uses your own key (environment variable
DOUBAOYA_API_KEY, in the formdyh_…). Tip: if data is temporarily unavailable, it's 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, and 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_cover_data.py" --keyword 露营
🔴 Don't add --start-date。 This upstream viral ranking isarchived by batch, not sliced by day—
tested (2026-08-13) any starting date for "last N days" will filter the entire ranking to empty (all four rankings have 0 entries),
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,
for daily use, just don't pass it.
| Parameter | Description | Default |
|---|---|---|
--keyword |
Keyword (required) | — |
--start-date |
Start date YYYY-MM-DD,Don't pass for daily use(passing it will most likely return the entire ranking as empty) |
Not passing = latest batch |
The script outputs the data from the success envelope as JSON to stdout.Run the script only once each time, and read the complete stdout.
Workflow (3 steps)
- Set the keyword: give one core word around the track you want to work on,don't add a start date(see above).
- Call the script to get data: the data is in
data.items, which is a set of{ rank, item }。rankis the ranking name (such aslikeTheTop500, low-follower viral, daily engagement, seven-day growth), the actual notes are initem(item.title、item.likedCount, etc.). - Extract cover formulas + give directions: summarize cover patterns from high-like notes (large main image / text hook / comparison / checklist feel, etc.), and in this Duck's tone give 3 cover directions that can be directly applied.
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,don't pass for daily use—— Passing any recent start date will filter all four leaderboards to empty) - Return envelope:
{ "success": true, "requestId": "...", "data": { "items": [ { "rank": "likeTheTop500", "item": { "title": "...", "likedCount": 12000 } } ] }, "error": null } - First check
success: if it istrue, then readdata; otherwise readerror.code/error.message。
Error codes
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 (already automatically refunded) | Safe to retry |
Directory structure
xiaohongshu-cover/
├── SKILL.md # 本文件
└── scripts/
└── fetch_cover_data.py # 零依赖脚本(urllib),调用 doubaoya.com
FAQ
Q: How do I use the returned data to decide on a cover? A: Look at the commonalities in titles and formats of highly liked notes, infer what their covers most likely look like, and summarize them into reusable cover formulas.
Q: Can't get data for now? 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 there is no need to retry or change behavior.