SuperAPI AI Directory

xiaohongshu-dailytop

Marketing & growth

View repository

Updated 10-16 04:56

About this skill

Xiaohongshu Daily Ranking (Dubaoya)

This duck helps you pull bydate + categorythe Xiaohongshu daily ranking—see at a glance who is dominating the charts in this category today, what content they are using to drive volume, and conveniently lock onto viral hits worth benchmarking.

Data goes through doubaoya.com one line, authentication uses your own key (environment variable DOUBAOYA_API_KEY, in the form dyh_…). Tip: if data is temporarily unavailable, it is upstream fluctuation, try again later (no charge).


Get the key (secret key)

  1. Open doubaoya.com
  2. Log in
  3. Go to Key Center
  4. 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).

# 默认:综合全部,今天往前 2 天
python3 "$SKILL_PATH/scripts/fetch_daily_top.py"

# 指定日期 + 分类(日期按今天现算,别照抄写死的日期)
python3 "$SKILL_PATH/scripts/fetch_daily_top.py" \
  --rank-date "$(date -d '-3 days' +%F 2>/dev/null || date -v-3d +%F)" --category 化妆美容

🔴 Two specifications to understand first(tested on 2026-08-13):

  • Generic categories must be written as 综合全部, not 综合。 综合 is not in the official closed set; if passed, it will be directly judged as "no results found"— this is not "no ranking that day", it is the wrong name. Categories are a closed set of 25 tracks, copy them exactly, do not make up your own:

    综合全部 出行代步 休闲爱好 影视娱乐 数码科技 医疗保健 综合杂项 星座情感

时尚穿搭 婚庆婚礼 拍摄记录 学习教育 化妆美容 居家装修 旅行度假 亲子育儿 个人护理 美味佳肴 职业发展 宠物天地 潮流鞋包 日常生活 科学探索 新闻资讯 体育锻炼

First map the abbreviations users say to the full names: Beauty → 化妆美容, Food → 美味佳肴, Fashion → 时尚穿搭, Travel → 旅行度假, Mother & Baby → 亲子育儿, Fitness → 体育锻炼, Digital → 数码科技。

  • The date lags by about two days, and only the most recent 30 days are retained. Yesterday's and today's rankings have not yet been settled (empty rankings), so the default is T-2; dates earlier than 30 days will be judged as no results found (not an empty ranking).
Parameter Description Default
--rank-date Ranking date YYYY-MM-DD, only the most recent 30 days are retained 2 days before today
--category Category, one of the 25 closed set; do not pass 综合 综合全部

The script prints the data from the success envelope as JSON to stdout.Run the script only once each time, read the complete stdout.


Workflow (3 steps)

  1. Set date + category: default category 综合全部, date is 2 days before today.
  2. Call the script to get data: the ranking is in data.items, each entry contains title(title),likedCount(like count).
  3. Lay out the ranking + give insights: sort by likedCount in descending order into a Markdown table, and after the table add a sentence in this duck's tone—what topics/formats this category is using to drive volume today, and whether it can be transferred to your own account.
Rank Title Likes
1 … …

Defensive field reading (leave blank if missing).


API contract

  • POST https://doubaoya.com/api/apis/xiaohongshu/xiaohongshu-daily-top/call
  • Auth header:Authorization: Bearer $DOUBAOYA_API_KEY
  • Request body:{ "rankDate": "YYYY-MM-DD", "category": "综合全部" } (category take one of the above 25,do not pass 综合—it is not in the closed set; rankDate only keep the most recent 30 days, with a lag of about two days)
  • Response envelope:
    { "success": true, "requestId": "...", "data": { "items": [ { "title": "...", "likedCount": 123 } ] }, "error": null }
    
  • first check successif it is true only then read data; otherwise read error.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 Fix --rank-date / --category 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.Most likely the category name is not in the 25-item closed set (for example, you wrote 综合), or the date is outside the most recent 30 days Replace the category with the full name from the closed set, move the date into the most recent 30 days, and retry
502 PROVIDER_FAILED Temporary upstream failure (refund has been issued automatically) safe to retry

Directory structure

xiaohongshu-dailytop/
├── SKILL.md                  # 本文件
└── scripts/
    └── fetch_daily_top.py    # 零依赖脚本(urllib),调用 doubaoya.com

FAQ

Q: It says DOUBAOYA_API_KEY? A: First export DOUBAOYA_API_KEY="dyh_…"(go to doubaoya.com → log in → key center → generate key).

Q: Temporarily unable to get data? A: First check yourself according to the two criteria above—whether the category name is not in the 25-item closed set (for example, you wrote 综合) and whether the date falls on yesterday/today (not yet settled) or outside the most recent 30 days. If all of these are ruled out, thenretry once unchanged after a while: upstream occasionally has transient empty values; the same set of parameters being empty once and full the next time has been observed in practice by this duck, so don't draw conclusions from just one empty result (empty results are not charged).

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 exactly as is—this is a notice that this skill has an update, does not affect the result of this call, and does not require retrying or changing behavior.