This duck helps you bykeywordpull a batch of Xiaohongshu viral data (low-follower viral / likes TOP500 / daily engagement / seven-day growth), and break down from real high-performing note titleshook patterns, producing title directions that can scale.
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 must never be 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_title_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 data. This parameter is only meaningful when you know the target batch date for sure;
daily usage is simply not to 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 batch returns empty) |
not passing = latest batch |
The script prints the data from the success envelope as JSON to stdout.Run the script only once each time, and read the full stdout.
Workflow (3 steps)
- Set the keyword: give one core term around the niche you want to work on,do not 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.). - Break down title patterns + produce titles: summarize hooks from high-like titles (numbers / pain points / contrast / identity代入 / lists, etc.), and in this duck's tone give 5 ready-to-use viral title candidates.
Defensive field reading (leave blank if missing).
Interface 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—— 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-title/
├── SKILL.md # 本文件
└── scripts/
└── fetch_title_data.py # 零依赖脚本(urllib),调用 doubaoya.com
FAQ
Q: What is the difference from xiaohongshu-cover? A: The same viral content data; this skill focuses on extracting hooks from titles to produce titles, while cover focuses on cover formulas.
Q: Data temporarily unavailable? 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 returned JSON has a top-level notice field, 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.