web-search
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWeb Search Skill
网页搜索Skill
Search the web. Prefer the built-in WebSearch tool — it uses a real browser engine with high success rate. Fall back to curl only if WebSearch is unavailable.
进行网页搜索。优先使用内置的WebSearch工具——它使用真实的浏览器引擎,成功率更高。仅当WebSearch不可用时才退而使用curl。
DuckDuckGo Instant Answer API (No API key needed)
DuckDuckGo即时答案API(无需API密钥)
bash
undefinedbash
undefinedBasic search — returns instant answers
Basic search — returns instant answers
curl -s "https://api.duckduckgo.com/?q=QUERY&format=json&no_html=1" | jq '.Abstract, .RelatedTopics[:5]'
undefinedcurl -s "https://api.duckduckgo.com/?q=QUERY&format=json&no_html=1" | jq '.Abstract, .RelatedTopics[:5]'
undefinedDuckDuckGo HTML Search (Full results)
DuckDuckGo HTML搜索(完整结果)
bash
undefinedbash
undefinedGet search results page and extract links
Get search results page and extract links
curl -s "https://html.duckduckgo.com/html/?q=QUERY" | grep -o 'href="https{0,1}://[^"]*' | head -10
undefinedcurl -s "https://html.duckduckgo.com/html/?q=QUERY" | grep -o 'href="https{0,1}://[^"]*' | head -10
undefinedGoogle Search via SerpAPI (if API key available)
通过SerpAPI进行Google搜索(需API密钥)
bash
undefinedbash
undefinedCheck if SERPAPI_KEY is set
Check if SERPAPI_KEY is set
alma config get serpapi.apiKey
alma config get serpapi.apiKey
If available:
If available:
curl -s "https://serpapi.com/search.json?q=QUERY&api_key=API_KEY" | jq '.organic_results[:5] | .[] | {title, link, snippet}'
undefinedcurl -s "https://serpapi.com/search.json?q=QUERY&api_key=API_KEY" | jq '.organic_results[:5] | .[] | {title, link, snippet}'
undefinedFetching Page Content
获取页面内容
After finding URLs from search, use the WebFetch tool to get the actual page content:
WebFetch(url="https://example.com/article")Or via curl:
bash
curl -sL "https://example.com/article" | head -200从搜索结果中找到URL后,使用WebFetch工具获取实际页面内容:
WebFetch(url="https://example.com/article")或者通过curl:
bash
curl -sL "https://example.com/article" | head -200Tips
提示
- URL-encode the query: replace spaces with or
+%20 - Use to parse JSON responses
jq - For complex queries, try multiple search approaches
- Always summarize findings for the user rather than dumping raw results
- If DuckDuckGo doesn't have good results, try fetching specific known sources directly
- 对查询内容进行URL编码:将空格替换为或
+%20 - 使用解析JSON响应
jq - 对于复杂查询,尝试多种搜索方式
- 始终为用户总结搜索结果,而非直接输出原始内容
- 如果DuckDuckGo的结果不理想,尝试直接获取特定的已知来源内容
Examples
示例
"最近的 AI 新闻":
bash
curl -s "https://html.duckduckgo.com/html/?q=latest+AI+news+2026" | grep -o 'href="https\{0,1\}://[^"]*' | grep -v duckduckgo | head -5"Python 3.13 新特性":
bash
curl -s "https://api.duckduckgo.com/?q=python+3.13+new+features&format=json&no_html=1" | jq '.Abstract'"最近的 AI 新闻":
bash
curl -s "https://html.duckduckgo.com/html/?q=latest+AI+news+2026" | grep -o 'href="https\{0,1\}://[^"]*' | grep -v duckduckgo | head -5"Python 3.13 新特性":
bash
curl -s "https://api.duckduckgo.com/?q=python+3.13+new+features&format=json&no_html=1" | jq '.Abstract'