This duck helps you pull by categoryDouyin Like Surge Rankings— giving you both at oncedaily ranking (dailyRank)andweekly ranking (weeklyRank), specifically catching those works whose likes are surging and that have just taken off, so you can lock onto replicable hit seedlings at the earliest opportunity.
Data goes through doubaoya.com in one line, and authentication uses your own token (environment variable
DOUBAOYA_API_KEY, in the formdyh_…)。
Get the key (token)
- Open doubaoya.com
- Log in
- Go to Token Center
- Generate Token(in the form
dyh_…)
export DOUBAOYA_API_KEY="dyh_你的口令"
Iron rule: the token must never be 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 Script
Zero dependencies, standard library is enough (Python 3).
# 默认:美食分类,昨天
python3 "$SKILL_PATH/scripts/fetch_content_surge.py"
# 指定分类 + 日期
python3 "$SKILL_PATH/scripts/fetch_content_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 (the current day's data is usually not yet settled).
- Call the script to get data: the rankings are in
data.items— it is an array, each item in the form{ "rank": "dailyRank", "item": { ... } }, whererankisgroup name string(dailyRankdaily ranking /weeklyRankweekly ranking),itemcontainstitle、category、share_url. In the same response,both the daily ranking and weekly ranking groups are initemsin, just group by therankfield. - Lay out two rankings + give insights: split
rank == "dailyRank"/rank == "weeklyRank"into two groups byitems, and lay out each table (itemfields: titletitle, categorycategory, linkshare_url), then after the tables add a sentence in this duck's tone—which topics are surging, what format they used to take off, and whether they can be migrated to your own account.
| Rank | Title | Category | Link |
|---|---|---|---|
| 1 | … | … | … |
Defensive field reading (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 fabricate 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; each item'srankis a group name string (dailyRank/weeklyRank), the actual content is initem.
- First look at
success: only iftrueshould you 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 it again.
Error codes
When the script fails, it prints to stderr [error] CODE: message and exits with code 1.
| HTTP | code | Meaning | Handling |
|---|---|---|---|
| 401 | MISSING_API_KEY / UNAUTHORIZED |
No password provided or the password is invalid | Check DOUBAOYA_API_KEY, go to the password 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 (automatically refunded) | safe to retry |
Directory structure
douyin-content-surge/
├── SKILL.md # 本文件
└── scripts/
└── fetch_content_surge.py # 零依赖脚本(urllib),调用 doubaoya.com
FAQ
Q: It says missing DOUBAOYA_API_KEY?
A: First export DOUBAOYA_API_KEY="dyh_…"(go to doubaoya.com → log in → Password Center → generate password).
Q: Error 502 PROVIDER_FAILED?
A: Temporary upstream jitter; the system has automatically refunded, just rerun it.