This duck helps you scan Kuaishou's AI-direction viral videos by a set of keywords — scooping out the AI short videos currently running hottest on Kuaishou, laying them out in a viral table in the terminal, then clustering them into several topic directions to build a ready-to-use Kuaishou AI topic-selection daily report.
Data goes through the doubaoya.com line, authentication uses your own token (environment variable
DOUBAOYA_API_KEY, in the formdyh_…)。
Use cases
| Scenario | How to use | What you get |
|---|---|---|
| Daily Kuaishou AI hot topics | Use AI教程、ChatGPT to scan today's viral hits |
See at a glance what's hot in the Kuaishou AI world today |
| Kuaishou AI topic-selection daily report | Pass multiple keywords at once for a batch scan, cluster into several topics | A short-video daily report you can pick topics from directly |
| Niche direction tracking | Pass detailed keywords like AI绘画、数字人、AI变现 and other detailed terms |
Lock onto the viral hits in a specific Kuaishou AI niche |
| Viral angle breakdown | Look at the titles and angles of high-play-count videos | Extract the viral formulas for Kuaishou AI short videos |
| Material accumulation | Page through several screens to build up a library | Build a firsthand library of Kuaishou AI-direction topic material |
Workflow (4 steps)
1. Define keywords (multiple allowed)
Extract a set of AI-direction keywordsfrom the user's description (required, at least one), such as AI教程、ChatGPT、大模型、AI绘画、数字人. Multiple can be passed at once for a batch scan; broad words hit more, narrow words are more focused.
2. Call the script
python3 "$SKILL_PATH/scripts/fetch_ks_ai_feed.py" "AI教程" "ChatGPT"
Paging / adjust items per page (optional):
python3 "$SKILL_PATH/scripts/fetch_ks_ai_feed.py" "大模型" "AI绘画" --page 2 --size 30
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 repeatedly with the same parameters.
3. Render the viral table
From data.items(video array), take the fields and lay them out as a Markdown table. Read fields defensively —title(title) / authorName(author) / playCount(play count) may be missing; if missing, leave blank, don't error.Sort by play count from high to low。
| Title | Author | Play count |
|---|---|---|
| Learn to do AI voiceover in three minutes | Some AI account | 128,000 |
4. Cluster into a daily report + one insight
Take this batch of videos andclusterthem by topic direction (e.g. tool tutorials / AI painting / digital humans / monetization plays), pick representative viral hits for each direction, and assemble a short daily report. At the end, add one line in this duck's voice as atopic-selection insight: which direction is hottest in the Kuaishou AI world today, and which angle still has open slots. Don't pile on clichés, and don't ask the user their purpose.
Get the key (token)
- Open doubaoya.com
- Log in
- Go to Credential Center
- Generate credential(in the form
dyh_…)
Configure it into an environment variable (the script only recognizes this one):
export DOUBAOYA_API_KEY="dyh_你的口令"
Iron rule: the credential must never be printed, never written to a file, and never echoed back to the user. The script itself also never outputs the credential. All requests are sent only to doubaoya.com。
Interface and envelope
POST https://doubaoya.com/api/apis/kuaishou/kuaishou-ai-feed/call- Auth header:
Authorization: Bearer $DOUBAOYA_API_KEY - Request body:
{ "keywords": ["AI教程", "ChatGPT"], "pageNum": 1, "pageSize": 20 }keywords: string array, required (multiple keywords can be passed in batch)pageNum: integer, optional (default 1, controlled by--page)pageSize: integer, optional (default 20, controlled by--size)
- Return envelope:
{ "success": true, "requestId": "...", "data": { "items": [ { "title": "...", "authorName": "...", "playCount": 128000 } ] }, "error": null } - First check
success: if it istrue, then readdata; otherwise readerror.code/error.message。
Error handling
When the script fails, it prints to stderr [error] CODE: message and exits with exit code 1. Common cases:
| HTTP | code | Meaning | Handling |
|---|---|---|---|
| 401 | MISSING_API_KEY / UNAUTHORIZED |
No credential provided or the credential is invalid | Check DOUBAOYA_API_KEY, go to the Credential Center to regenerate it |
| 400 | VALIDATION_ERROR |
Invalid parameters (such as empty keywords) | Correct the keywords 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 |
502 PROVIDER_FAILEDwill automatically refund, retrying is safe and will not charge twice.
Directory structure
ks-ai-feed/
├── SKILL.md # 本文件
└── scripts/
└── fetch_ks_ai_feed.py # 零依赖脚本(urllib),调用 doubaoya.com