Quack! This duck helps you search Bilibili video works by keyword—track niche hot topics, dig into competitors' viral hits, and build up topic material. With one keyword, the terminal directly lays out a clickable video table, plus a topic insight. You can also choose the sorting method and limit the publish time,what you get is all fresh data just updated by the platform, not old cache.
Data goes through doubaoya.com one line, authentication uses your own token (environment variable
DOUBAOYA_API_KEY, in the formdyh_…)。
Use cases
| Scenario | How to use | What you get |
|---|---|---|
| Niche hot topic tracking | Search AI 工具 to see what UP hosts in this field have been posting recently |
Grasp current hot topic angles at a glance |
| Competitor content analysis | Search 数码评测 to see how the same niche chooses topics and titles |
Understand opponents' content strategy |
| Viral topic inspiration | Search 职场 to find high-like angles and entry points |
Find direction for your next video |
| Material collection | Search Python 教程 to collect reference works in bulk |
Build up first-hand creative material |
| Trend research | Search 2026 显卡 to see public opinion trends |
Lay the groundwork for research/reports |
Workflow (4 steps)
1. Understand intent, extract keywords and filter conditions
Extract from the user's description thecore keyword, 2~6 characters is best (such as AI 工具、数码评测、职场). The shorter the word, the broader it is and the more hits; too long and too specific makes it easy to get no results. Search only one keyword at a time.
At the same time, identify filtering intent (use defaults if the user does not mention it):
- Sorting method
--sort-type: default"1"(comprehensive / hottest). Common value"1"= comprehensive/hottest. - Publish time
--publish-time: default"0"(unlimited). Such as"30"= last 30 days. - Page number
--page: default1。
2. Call the search script
python3 "$SKILL_PATH/scripts/search_bilibili.py" "AI 工具"
With filters / pagination (both optional):
python3 "$SKILL_PATH/scripts/search_bilibili.py" "数码评测" --sort-type 1 --publish-time 30 --page 2
The script prints the data from the success envelope to stdout as JSON.Run the script only once per query, read the complete stdout directly, do not use head/tail preview, and do not repeatedly call for the same keyword.
3. Render the works table
From data.items(video array), take the fields and lay them out as a Markdown table in the format below. Read fieldsdefensively——title(title) / author(UP host) / likeCount(likes) / publishTime(publish time) may be missing or named slightly differently; if missing, leave blank or write "—", and do not let one piece of data crash the whole table. Render the title as aclickable link(pointing to the original video URL, e.g. work_url). Total page count can be read data.pages。
| Title | Uploader | Likes | Publish time |
|---|---|---|---|
| Sample video title | Some UP主 | 10.2w | 2026-06-20 |
Number formatting:
< 10000use the raw number,≥ 10000usex.xw. If you want a more granular "three-dimensional scoring" sort (keyword relevance + like popularity + recency), you can add a total score column and sort in descending order — this is presentation-layer processing and does not affect API calls.
4. Add a one-line topic insight
After the table, add one line in this duck's voice as atopic insight: what angles these works are competing for, which niche no one has fully covered yet, and whether it's worth following. Keep it short and useful, don't pile on clichés, and don't ask the user "what is your real purpose".
Get the key (passcode)
- Open doubaoya.com
- Log in
- go to Passcode Center
- Generate passcode(in the form
dyh_…)
Configure it in an environment variable (the script only recognizes this one):
export DOUBAOYA_API_KEY="dyh_你的口令"
Iron rule: never print the passcode, never write it to a file, never echo it back to the user. The script itself also never outputs the passcode. All requests are sent only to doubaoya.com, do not take the passcode to any other domain.
API and envelope
POST https://doubaoya.com/api/apis/bilibili/search-work/call- Auth header:
Authorization: Bearer $DOUBAOYA_API_KEY - Request body:
{ "keyword": "AI 工具", "sortType": "1", "publishTime": "0", "page": 1 }keyword: string, requiredsortType: string, optional (default"1"= comprehensive/hottest)publishTime: string, optional (default"0"= unrestricted; e.g."30"= last 30 days)page: integer, optional (default 1)- All the above fields have default values, and the script includes them every time
- Return envelope:
{ "success": true, "requestId": "...", "data": { "items": [ { "title": "...", "author": "...", "likeCount": 0, "publishTime": "..." } ], "pages": 1 }, "error": null } - First check
success: only readtrueif it isdata; otherwise readerror.code/error.message。
Error handling
When the script fails, it prints to stderr [error] CODE: message and exits with code 1. Common cases:
| HTTP | code | Meaning | Handling |
|---|---|---|---|
| 401 | MISSING_API_KEY / UNAUTHORIZED |
No passcode provided or invalid passcode | Check DOUBAOYA_API_KEY, go to the Passcode Center to regenerate |
| 400 | VALIDATION_ERROR |
Invalid parameter (e.g. keyword is empty) | Fix the keyword and retry |
| 402 | INSUFFICIENT_CREDITS |
Insufficient quota | Go to doubaoya.com to top up/renew quota |
| 404 | ENDPOINT_NOT_FOUND |
Incorrect API path | Restore the default endpoint path |
| 502 | PROVIDER_FAILED |
Temporary upstream failure (auto-refunded) | safe to retry |
| — | NETWORK_ERROR |
Cannot connect to doubaoya.com | Check the network and retry |
502 PROVIDER_FAILEDwill automatically refund, so retrying is safe and will not double-charge.
Directory structure
bilibili-keyword-search/
├── SKILL.md # 本文件
└── scripts/
└── search_bilibili.py # 零依赖搜索脚本(urllib),调用 doubaoya.com