This duck helps you pull by categoryDouyin Likes Surging Weekly Ranking— focused on weeklyRank (weekly ranking), looking specifically at works that kept rising over the week rather than one-day wonders, letting you judge medium- to long-term trends and capture the breakout tracks that are steadily taking off.
The same API also carries the daily ranking; this skillfocuses only on the weekly rankingperspective; if you want both daily + weekly rankings, use
douyin-content-surge. Data goes through doubaoya.com one line; authentication uses your own token (environment variableDOUBAOYA_API_KEY, in the formdyh_…)。
get a key (token)
- open doubaoya.com
- log in
- go to Token Center
- generate a token(in the form
dyh_…)
export DOUBAOYA_API_KEY="dyh_你的口令"
Iron rule: the token is never printed, never written to a file, and never echoed back to the user. The script itself also never outputs the token. All requests are sent only to doubaoya.com。
run the script
Zero dependencies, standard library is enough (Python 3).
# 默认:美食分类,昨天
python3 "$SKILL_PATH/scripts/fetch_weekly_surge.py"
# 指定分类 + 日期
python3 "$SKILL_PATH/scripts/fetch_weekly_surge.py" --type 美食 --start-time 2026-06-23
| Parameter | Description | Default |
|---|---|---|
--type |
Content category | 美食 |
--start-time |
Ranking date YYYY-MM-DD |
Yesterday |
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 category + date: defaults to Food, yesterday.
- Call the script to get data: the ranking is in
data.items— it is an array, each entry in the form{ "rank": "weeklyRank", "item": { ... } },rankisgroup name string. This skill only takesrank == "weeklyRank"entries (the same response also containsrank == "dailyRank"daily-ranking entries; this skill ignores them); each weekly-ranking entry'sitemcontainstitle、category、share_url。 - Lay out the weekly ranking + give medium-term insights: from
itemsfilter outrank == "weeklyRank"entries, take each one'sitem.title/item.category/item.share_urlto lay out the table, and after the table add a line in this duck's voice—which topics kept rising this week, whether they are stable trends or short-term hot spots, and whether they are worth betting on.
| Rank | Title | Category | Link |
|---|---|---|---|
| 1 | … | … | … |
Read fields defensively (leave blank if missing).
API contract
POST https://doubaoya.com/api/apis/douyin/douyin-content-surge/call- Auth header:
Authorization: Bearer $DOUBAOYA_API_KEY - Request body:
{ "type": "美食", "startTime": "2026-06-23" }startTimeplease passa real, relatively recent date(the most recent date in the local region); do not make one up or fill in a future date.
- Response envelope:
{ "success": true, "requestId": "...", "data": { "items": [ { "rank": "dailyRank", "item": { "title": "...", "category": "...", "share_url": "..." } }, { "rank": "weeklyRank", "item": { "title": "...", "category": "...", "share_url": "..." } } ] }, "error": null }data.itemsis a flat array;rankis a group name string.This skill only readsrank == "weeklyRank"entries, and the content is in itsitem(useitem.share_url, not workUrl).
- First check
success: fortrueonly then readdata; otherwise readerror.code/error.message。 - An empty result usually means there is no settlement data for that date window yet—just move
--start-timeback one day and run again.
Error Code
When the script fails, it prints to stderr [error] CODE: message and exits with exit code 1.
| HTTP | code | Meaning | Handling |
|---|---|---|---|
| 401 | MISSING_API_KEY / UNAUTHORIZED |
No token provided or the token is invalid | Check DOUBAOYA_API_KEY, go to the token center to regenerate it |
| 400 | VALIDATION_ERROR |
Invalid parameter | Fix --type / --start-time and retry |
| 402 | INSUFFICIENT_CREDITS |
Insufficient quota | Go to doubaoya.com to top up/renew quota |
| 502 | PROVIDER_FAILED |
Temporary upstream failure (already automatically refunded) | safe to retry |
Directory Structure
douyin-weekly-surge/
├── SKILL.md # 本文件
└── scripts/
└── fetch_weekly_surge.py # 零依赖脚本(urllib),调用 doubaoya.com
FAQ
Q: What is the difference from douyin-content-surge? A: Same interface, same data; this skillfocuses on the weekly ranking perspective, while content-surge looks at the daily + weekly dual rankings together.
Q: Error 502 PROVIDER_FAILED?
A: Temporary upstream jitter; the system has automatically refunded, so you can just rerun it.