This Ya helps you byindustry category + time rangefish out viral articles from WeChat Official Accounts that recently reached 100k+ reads—see clearly which field is exploding right now and what angle is exploding, so you can find direction for your next topic. With one category, the terminal directly lays out a clickable table of viral articles, followed by a one-line trend insight.
Data goes through doubaoya.com as one line, authentication uses your own key (environment variable
DOUBAOYA_API_KEY, in the formdyh_…)。
Applicable scenarios
| Scenario | How to use | What you get |
|---|---|---|
| Industry viral trends | Pull 科技数码 100k+ from the past week, see what is exploding in this field |
Grasp current viral angles at a glance |
| Hot topic chasing | Pull 人文资讯 see which recent social topic viral articles are chasing |
Leverage the hot topic to decide your next one |
| Viral pattern research | Sweep 情感心理/教育考试 's 100k+ titles and angles |
Extract reusable title formulas |
| Competitor track review | Lock onto 健康养生 see whose content in the same track is running up numbers |
Understand opponents' content playbook |
| Weekly content review | Pull once at a fixed range, compare this week's viral article density | Lay the groundwork for the operations weekly report |
Workflow (4 steps)
1. Confirm category and time range
🔴 The category is an official closed set; only full track names are recognized. The easiest pitfall here is not "which track has no content" but
the name is not in the closed set: write 科技、财经、职场、教育 will always return three empty rankings, not because these tracks have no data,
but because these four words are not legal track names at all—the official wording is 科技数码、财富理财、职场发展、
教育考试, swap them in and the same time range immediately fills all three rankings. The upstream handles values outside the closed set bynot erroring, and not correcting, only quietly
returning empty, so "writing the wrong name" and "this track has no content" look exactly the same in the response.Match the name first, then talk about data.
The 22 officially supported tracks (copy exactly, no abbreviations, no inventing):
人文资讯知识百科健康养生时尚潮流美食餐饮乐活生活旅游出行搞笑幽默情感心理体育娱乐美容美体文摘精选民生资讯财富理财科技数码创投商业汽车交通房产楼市职场发展教育考试学术研究企业品牌
Map the short name the user says to the full name before querying: Tech/Digital → 科技数码, Finance/Wealth Management/Investment → 财富理财, Workplace → 职场发展, Education → 教育考试, Entertainment/Sports → 体育娱乐, Beauty → 美容美体, Real Estate → 房产楼市, Startup/Business → 创投商业, Life → 乐活生活. Default 科技数码, pull only one category at a time.
民生资讯is on the official list, butcurrently no data can be obtained in actual testing(multiple time windows, multiple reruns all empty). It should not be removed from the list—whenever the upstream fills it in it can be used—just do not choose it for now.
Three hard rules for the time range(measured on the same batch):
startDateandendDatemust both be provided, missing one gets it rejected outright. When the script doesn't specify, the default is end date = today, start date = 6 days before today(the past week), this default is safe.- Don't query dates that are too old. The official line is 30 days of lookback, but in practice it's relaxed to about 60 days;
startDateearlier than "60 days before today", the API will reply with "date format error" — this message is misleading, the format is fine, it's that the date is beyond the retention period. When you see it, move the start date later, don't go changing the date format. To be safe, use 30 days. - Data lags by about two days. Querying only today or yesterday will definitely be empty; to see the latest, it's recommended to set the range end date to 2 days before today. The default past-week range already includes the days when data is produced, so there will still be data as usual.
2. Call the script
python3 "$SKILL_PATH/scripts/fetch_10w_hot.py" --type 科技数码
When specifying a rangecalculate the dates from today, don't copy any hardcoded dates(hardcoded dates will sooner or later slide out of the 60-day window):
python3 "$SKILL_PATH/scripts/fetch_10w_hot.py" --type 人文资讯 \
--start "$(date -d '-9 days' +%F 2>/dev/null || date -v-9d +%F)" \
--end "$(date -d '-2 days' +%F 2>/dev/null || date -v-2d +%F)"
The script prints the data from the success envelope to stdout as JSON.Run the script only once per query, read the full stdout directly, don't use head/tail to preview, and don't call it repeatedly with the same parameters.
3. Render the viral article table
Take fields from data.items(the article array) and lay them out as a Markdown table. Read fields defensively —title / accountName(account) / readCount(read count) may be missing; if missing, leave blank, don't error out. Render the title as aclickable link(pointing to the article's original URL), sorted by read count descending.
| Title | Account | Read count |
|---|---|---|
| Example viral article title | Some WeChat official account | 100,000+ |
4. Give a one-line trend insight
After the table, add a line in this duck's voice ontopic trends: what angle these 100k+ articles are fighting over, which niche still has room, whether it's worth following. Keep it short and useful, don't pile on platitudes, don't ask the user back "what's your real purpose".
Get the key (secret key)
- Open doubaoya.com
- Log in
- Go to Key Center
- Generate key(in the form
dyh_…)
Configure it into an environment variable (the script only recognizes this one):
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。
API and envelope
POST https://doubaoya.com/api/apis/gongzhonghao/category-time-hot/call- Auth header:
Authorization: Bearer $DOUBAOYA_API_KEY - Request body:
{ "type": "科技数码", "startDate": "YYYY-MM-DD", "endDate": "YYYY-MM-DD" }type: string, industry category,must be one of the 22 official track full names above(default科技数码)startDate/endDate:YYYY-MM-DD,Both are required; the start date must not be earlier than 60 days before today (official line is 30 days); data lags by about two days
- Return envelope:
{ "success": true, "requestId": "...", "data": { "items": [ { "title": "...", "accountName": "...", "readCount": 123456 } ] }, "error": null } - First check
success: if it'struethen readdata; otherwise readerror.code/error.message。
Error handling
When the script fails, print to stderr [error] CODE: message and exit with code 1. Common cases:
| HTTP | code | Meaning | Handling |
|---|---|---|---|
| 401 | MISSING_API_KEY / UNAUTHORIZED |
No key or invalid key | Check DOUBAOYA_API_KEY, and regenerate it at the key center |
| 400 | VALIDATION_ERROR |
Invalid parameter (e.g. wrong date format) | Correct the category/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.Most likely the start date exceeds the 60-day retention period—even if it says "date format error" | Move the start date forward to within 60 days and retry; don't change the date format |
| 502 | PROVIDER_FAILED |
Temporary upstream failure (has been automatically refunded) | safe to retry |
502 PROVIDER_FAILEDwill automatically refund, retrying is safe and will not double-charge.
All three leaderboards have 0 entries(success: true but no data): this is not a failure, andwon't deduct your points—the response will include
a noResult flag, and the points are refunded on the spot. Troubleshoot in this order:
- Whether the category name is not among those 22(most common, e.g. writing
科技instead of科技数码); - Whether the range only covers the last two days (data not out yet);
- If all are fine, thenwait a while and retry once with the same input—upstream occasionally has transient empty values; with the same set of parameters, one time empty and\nthe next time full leaderboards—this duck has actually encountered this in testing.Don't conclude "this track has no data" based on just one empty result.
Directory structure
wechat-10w-hot/
├── SKILL.md # 本文件
└── scripts/
└── fetch_10w_hot.py # 零依赖脚本(urllib),调用 doubaoya.com
About the notice field in the response
After calling the doubaoya API corresponding to this skill, if the returned JSON has at the top level a 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.