SuperAPI AI Directory

douyin-weekly-surge

Data & analytics

View repository

Updated 10-16 08:41

About this skill

Douyin Likes Surging Weekly Ranking (DouBaoYa)

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 variable DOUBAOYA_API_KEY, in the form dyh_…)。


get a key (token)

  1. open doubaoya.com
  2. log in
  3. go to Token Center
  4. 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)

  1. Set category + date: defaults to Food, yesterday.
  2. Call the script to get data: the ranking is in data.items — it is an array, each entry in the form { "rank": "weeklyRank", "item": { ... } },rank isgroup name string. This skill only takes rank == "weeklyRank" entries (the same response also contains rank == "dailyRank" daily-ranking entries; this skill ignores them); each weekly-ranking entry's item contains title、category、share_url。
  3. Lay out the weekly ranking + give medium-term insights: from items filter out rank == "weeklyRank" entries, take each one's item.title / item.category / item.share_url to 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" }
    • startTime please 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.items is a flat array;rank is a group name string.This skill only reads rank == "weeklyRank" entries, and the content is in its item (use item.share_url, not workUrl).
  • First check success: for true only then read data; otherwise read error.code / error.message。
  • An empty result usually means there is no settlement data for that date window yet—just move --start-time back 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.