This duck will toss a question to Doubao web retrieval—the server searches the web in real time to gather, read through, and integrate the materials, then returns acomprehensive answer, along withcited sourcesand a fewfollow-up suggestions. No need to build your own retrieval pipeline; pay per use.
Data goes through doubaoya.com in one line; authentication uses your own key (environment variable
DOUBAOYA_API_KEY, in the formdyh_…)。
⏳ This is an asynchronous slow operation: retrieval runs on the server, and the whole processtakes about 5 minutes, returning all at once within a single request—no client-side polling needed, just send one POST and wait for the result.
Use cases
| Scenario | How to use | What you get |
|---|---|---|
| Search online for the latest information | Submit the question as a query | Comprehensive answer + real-time sources |
| Fact-checking with sources | Ask a question that needs supporting evidence | Answer + traceable citation links |
| Quick research | Throw out an open-ended question | Integrated conclusions + follow-up directions |
| Find source material | Ask around the topic | A batch of relevant source links |
Workflow (3 steps)
1. Write the query
Distill a clear search query from the user's needs (one sentence is enough; the more specific, the more accurate).
2. Call the script (be patient for a few minutes)
python3 "$SKILL_PATH/scripts/doubao_search.py" "2025 年 AI Agent 落地有哪些代表案例"
The script will first show on stderr "submitted, generating on the server", thenwait about 5 minutesuntil the result returns, then output the data from the success envelope to stdout as JSON.Run the script only once per query, do not interrupt it midway, do not call it repeatedly, and just read the full stdout.
3. Render the comprehensive answer + sources
From data , take the fields and dodefensive reads:
result.content: comprehensive answer body → present directly to the userresult.references[]: cited sources → lay out as asource list(clickable links)result.suggestions[]: follow-up suggestions → list at the end for the user to continue asking
If any field is missing, skip that block; don't throw an error. Suggested layout: first the answer, then the "Sources" list, and finally the "You can also ask" follow-up suggestions.
Get the key (API key)
- Open doubaoya.com
- Log in
- Go to the Key Center
- Generate a key(in the form
dyh_…)
Configure it as an environment variable (the script only recognizes this one):
export DOUBAOYA_API_KEY="dyh_你的密钥"
Iron rule: never print the key, never write it to a file, never echo it to the user. The script itself never outputs the key either. All requests are sent only to doubaoya.com。
Endpoint and envelope
POST https://doubaoya.com/api/skills/doubao-web-search/invoke- Auth header:
Authorization: Bearer $DOUBAOYA_API_KEY - Request body:
{ "query": "<查询>" }query: string, required
- Asynchronous slow operation: The server completes retrieval within about 5 minutes and returns it in this request; no polling needed.
- Return envelope:
{ "success": true, "requestId": "...", "data": { "result": { "content": "综合答案…", "references": [ { "title": "...", "url": "https://..." } ], "suggestions": [ "延伸问题…" ] } }, "error": null } - First check
success: if it istrue, then 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 |
Missing key or invalid key | Check DOUBAOYA_API_KEY, go to the key center to regenerate |
| 400 | VALIDATION_ERROR |
Invalid parameter (e.g. query is empty) | Fix the query 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 |
502 PROVIDER_FAILEDwill automatically refund; retrying is safe and will not result in duplicate charges.
Directory structure
doubao-websearch/
├── SKILL.md # 本文件
└── scripts/
└── doubao_search.py # 零依赖脚本(urllib),调用 doubaoya.com
About the notice field in the response
After calling the doubaoya API corresponding to this skill, if the top level of the returned JSON contains the 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.