跳到主内容
智客 ZICQ

技能库 智客分类:写作与研究 web-search OpenClaw

Web Search

当用户需要搜索网络信息,找到当前内容,查阅新闻文章,搜索图像,或找到视频时,应当使用这种技能. 它使用 DuckDuckGo 的搜索 API 以干净,格式化的输出返回结果(文本,标记下,或JSON). 用于研究,查清事实,查找最新信息,或收集网络资源.

1320 安装量 · 35 星标

官方网址:ClawHub

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

当用户需要搜索网络信息,找到当前内容,查阅新闻文章,搜索图像,或找到视频时,应当使用这种技能. 它使用 DuckDuckGo 的搜索 API 以干净,格式化的输出返回结果(文本,标记下,或JSON). 用于研究,查清事实,查找最新信息,或收集网络资源.

何时用

这个技能

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:Web Search、Overview、When to Use This Skill、Prerequisites、Core Capabilities、1. Basic Web Search。

文件分析

文件分析:除 SKILL.md 外,正文引用了 scripts/search.py,属于带资源的技能包,这些文件按需再读。 正文约 514 行,超过规范建议的 500 行,激活时仍会整份载入。

官方 description(原文)

This skill should be used when users need to search the web for information, find current content, look up news articles, search for images, or find videos. It uses DuckDuckGo's search API to return results in clean, formatted output (text, markdown, or JSON). Use for research, fact-checking, finding recent information, or gathering web resources.

Web SearchOverviewWhen to Use This SkillPrerequisitesCore Capabilities1. Basic Web Search2. Limiting Results3. Time Range Filtering4. News Search5. Image Search6. Video Search7. Region-Specific Search

来源分类:ClawHub Web Search

SKILL.md 与 Agent 调用

官方规范 ↗
name
web-search
description
This skill should be used when users need to search the web for information, find current content, look up news articles, search for images, or find videos. It uses DuckDuckGo's search API to return results in clean, formatted output (text, markdown, or JSON). Use for research, fact-checking, finding recent information, or gathering web resources.
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。
指令中引用的文件 · 1
  • scripts/search.py

以下路径提取自原文;文件是否齐全请以来源仓库中的完整目录为准。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

该技能引用了附属文件,请从来源获取完整目录;仅复制 SKILL.md 可能缺少依赖。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「web-search」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-3b7c991e1c1c1d66-%E7%BD%91%E7%BB%9C%E6%90%9C%E7%B4%A2.html
请存为 .cursor/skills/web-search/SKILL.md 或 .claude/skills/web-search/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。
该技能还带 scripts/、references/、assets/ 等文件,请从 https://clawhub.ai/skills/web-search 取完整目录,不要只建一个 SKILL.md。

当前没有明确的 GitHub 技能包地址,请按来源页面的安装器说明操作。

ClawHub ↗

阅读排版
--- name: web-search description: This skill should be used when users need to search the web for information, find current content, look up news articles, search for images, or find videos. It uses DuckDuckGo's search API to return results in clean, formatted output (text, markdown, or JSON). Use for research, fact-checking, finding recent information, or gathering web resources. --- # Web Search ## Overview Search the web using DuckDuckGo's API to find information across web pages, news articles, images, and videos. Returns results in multiple formats (text, markdown, JSON) with filtering options for time range, region, and safe search. ## When to Use This Skill Use this skill when users request: - Web searches for information or resources - Finding current or recent information online - Looking up news articles about specific topics - Searching for images by description or topic - Finding videos on specific subjects - Research requiring current web data - Fact-checking or verification using web sources - Gathering URLs and resources on a topic ## Prerequisites Install the required dependency: ```bash pip install duckduckgo-search ``` This library provides a simple Python interface to DuckDuckGo's search API without requiring API keys or authentication. ## Core Capabilities ### 1. Basic Web Search Search for web pages and information: ```bash python scripts/search.py "" ``` **Example:** ```bash python scripts/search.py "python asyncio tutorial" ``` Returns the top 10 web results with titles, URLs, and descriptions in a clean text format. ### 2. Limiting Results Control the number of results returned: ```bash python scripts/search.py "" --max-results ``` **Example:** ```bash python scripts/search.py "machine learning frameworks" --max-results 20 ``` Useful for: - Getting more comprehensive results (increase limit) - Quick lookups with fewer results (decrease limit) - Balancing detail vs. processing time ### 3. Time Range Filtering Filter results by recency: ```bash python scripts/search.py "" --time-range ``` **Time range options:** - `d` - Past day - `w` - Past week - `m` - Past month - `y` - Past year **Example:** ```bash python scripts/search.py "artificial intelligence news" --time-range w ``` Great for: - Finding recent news or updates - Filtering out outdated content - Tracking recent developments ### 4. News Search Search specifically for news articles: ```bash python scripts/search.py "" --type news ``` **Example:** ```bash python scripts/search.py "climate change" --type news --time-range w --max-results 15 ``` News results include: - Article title - Source publication - Publication date - URL - Article summary/description ### 5. Image Search Search for images: ```bash python scripts/search.py "" --type images ``` **Example:** ```bash python scripts/search.py "sunset over mountains" --type images --max-results 20 ``` **Image filtering options:** Size filters: ```bash python scripts/search.py "landscape photos" --type images --image-size Large ``` Options: `Small`, `Medium`, `Large`, `Wallpaper` Color filters: ```bash python scripts/search.py "abstract art" --type images --image-color Blue ``` Options: `color`, `Monochrome`, `Red`, `Orange`, `Yellow`, `Green`, `Blue`, `Purple`, `Pink`, `Brown`, `Black`, `Gray`, `Teal`, `White` Type filters: ```bash python scripts/search.py "icons" --type images --image-type transparent ``` Options: `photo`, `clipart`, `gif`, `transparent`, `line` Layout filters: ```bash python scripts/search.py "wallpapers" --type images --image-layout Wide ``` Options: `Square`, `Tall`, `Wide` Image results include: - Image title - Image URL (direct link to image) - Thumbnail URL - Source website - Dimensions (width x height) ### 6. Video Search Search for videos: ```bash python scripts/search.py "" --type videos ``` **Example:** ```bash python scripts/search.py "python tutorial" --type videos --max-results 15 ``` **Video filtering options:** Duration filters: ```bash python scripts/search.py "cooking recipes" --type videos --video-duration short ``` Options: `short`, `medium`, `long` Resolution filters: ```bash python scripts/search.py "documentary" --type videos --video-resolution high ``` Options: `high`, `standard` Video results include: - Video title - Publisher/channel - Duration - Publication date - Video URL - Description ### 7. Region-Specific Search Search with region-specific results: ```bash python scripts/search.py "" --region ``` **Common region codes:** - `us-en` - United States (English) - `uk-en` - United Kingdom (English) - `ca-en` - Canada (English) - `au-en` - Australia (English) - `de-de` - Germany (German) - `fr-fr` - France (French) - `wt-wt` - Worldwide (default) **Example:** ```bash python scripts/search.py "local news" --region us-en --type news ``` ### 8. Safe Search Control Control safe search filtering: ```bash python scripts/search.py "" --safe-search ``` **Options:** - `on` - Strict filtering - `moderate` - Balanced filtering (default) - `off` - No filtering **Example:** ```bash python scripts/search.py "medical information" --safe-search on ``` ### 9. Output Formats Choose how results are formatted: **Text format (default):** ```bash python scripts/search.py "quantum computing" ``` Clean, readable plain text with numbered results. **Markdown format:** ```bash python scripts/search.py "quantum computing" --format markdown ``` Formatted markdown with headers, bold text, and links. **JSON format:** ```bash python scripts/search.py "quantum computing" --format json ``` Structured JSON data for programmatic processing. ### 10. Saving Results to File Save search results to a file: ```bash python scripts/search.py "" --output ``` **Example:** ```bash python scripts/search.py "artificial intelligence" --output ai_results.txt python scripts/search.py "AI news" --type news --format markdown --output ai_news.md python scripts/search.py "AI research" --format json --output ai_data.json ``` The file format is determined by the `--format` flag, not the file extension. ## Output Format Examples ### Text Format ``` 1. Page Title Here URL: https://example.com/page Brief description of the page content... 2. Another Result URL: https://example.com/another Another description... ``` ### Markdown Format ```markdown ## 1. Page Title Here **URL:** https://example.com/page Brief description of the page content... ## 2. Another Result **URL:** https://example.com/another Another description... ``` ### JSON Format ```json [ { "title": "Page Title Here", "href": "https://example.com/page", "body": "Brief description of the page content..." }, { "title": "Another Result", "href": "https://example.com/another", "body": "Another description..." } ] ``` ## Common Usage Patterns ### Research on a Topic Gather comprehensive information about a subject: ```bash # Get overview from web python scripts/search.py "machine learning basics" --max-results 15 --output ml_web.txt # Get recent news python scripts/search.py "machine learning" --type news --time-range m --output ml_news.txt # Find tutorial videos python scripts/search.py "machine learning tutorial" --type videos --max-results 10 --output ml_videos.txt ``` ### Current Events Monitoring Track news on specific topics: ```bash python scripts/search.py "climate summit" --type news --time-range d --format markdown --output daily_climate_news.md ``` ### Finding Visual Resources Search for images with specific criteria: ```bash python scripts/search.py "data visualization examples" --type images --image-type photo --image-size Large --max-results 25 --output viz_images.txt ``` ### Fact-Checking Verify information with recent sources: ```bash python scripts/search.py "specific claim to verify" --time-range w --max-results 20 ``` ### Academic Research Find resources on scholarly topics: ```bash python scripts/search.py "quantum entanglement research" --time-range y --max-results 30 --output quantum_research.txt ``` ### Market Research Gather information about products or companies: ```bash python scripts/search.py "electric vehicle market 2025" --max-results 20 --format markdown --output ev_market.md python scripts/search.py "EV news" --type news --time-range m --output ev_news.txt ``` ## Implementation Approach When users request web searches: 1. **Identify search intent**: - What type of content (web, news, images, videos)? - How recent should results be? - How many results are needed? - Any filtering requirements? 2. **Configure search parameters**: - Choose appropriate search type (`--type`) - Set time range if currency matters (`--time-range`) - Adjust result count (`--max-results`) - Apply filters (image size, video duration, etc.) 3. **Select output format**: - Text for quick reading - Markdown for documentation - JSON for further processing 4. **Execute search**: - Run the search command - Save to file if results need to be preserved - Print to stdout for immediate review 5. **Process results**: - Read saved files if needed - Extract URLs or specific information - Combine results from multiple searches ## Quick Reference **Command structure:** ```bash python scripts/search.py "" [options] ``` **Essential options:** - `-t, --type` - Search type (web, news, images, videos) - `-n, --max-results` - Maximum results (default: 10) - `--time-range` - Time filter (d, w, m, y) - `-r, --region` - Region code (e.g., us-en, uk-en) - `--safe-search` - Safe search level (on, moderate, off) - `-f, --format` - Output format (text, markdown, json) - `-o, --output` - Save to file **Image-specific options:** - `--image-size` - Size filter (Small, Medium, Large, Wallpaper) - `--image-color` - Color filter - `--image-type` - Type filter (photo, clipart, gif, transparent, line) - `--image-layout` - Layout filter (Square, Tall, Wide) **Video-specific options:** - `--video-duration` - Duration filter (short, medium, long) - `--video-resolution` - Resolution filter (high, standard) **Get full help:** ```bash python scripts/search.py --help ``` ## Best Practices 1. **Be specific** - Use clear, specific search queries for better results 2. **Use time filters** - Apply `--time-range` for current information 3. **Adjust result count** - Start with 10-20 results, increase if needed 4. **Save important searches** - Use `--output` to preserve results 5. **Choose appropriate type** - Use news search for current events, web for general info 6. **Use JSON for automation** - JSON format is easiest to parse programmatically 7. **Respect usage** - Don't hammer the API with rapid repeated searches ## Troubleshooting **Common issues:** - **"Missing required dependency"**: Run `pip install duckduckgo-search` - **No results found**: Try broader search terms or remove time filters - **Timeout errors**: The search service may be temporarily unavailable; retry after a moment - **Rate limiting**: Space out searches if making many requests - **Unexpected results**: DuckDuckGo's results may differ from Google; try refining the query **Limitations:** - Results quality depends on DuckDuckGo's index and algorithms - No advanced search operators (unlike Google's site:, filetype:, etc.) - Image and video searches may have fewer results than web search - No control over result ranking or relevance scoring - Some specialized searches may work better on dedicated search engines ## Advanced Use Cases ### Combining Multiple Searches Gather comprehensive information by combining search types: ```bash # Web overview python scripts/search.py "topic" --max-results 15 --output topic_web.txt # Recent news python scripts/search.py "topic" --type news --time-range w --output topic_news.txt # Images python scripts/search.py "topic" --type images --max-results 20 --output topic_images.txt ``` ### Programmatic Processing Use JSON output for automated processing: ```bash python scripts/search.py "research topic" --format json --output results.json # Then process with another script python analyze_results.py results.json ``` ### Building a Knowledge Base Create searchable documentation from web results: ```bash # Search multiple related topics python scripts/search.py "topic1" --format markdown --output kb/topic1.md python scripts/search.py "topic2" --format markdown --output kb/topic2.md python scripts/search.py "topic3" --format markdown --output kb/topic3.md ``` ## Resources ### scripts/search.py The main search tool implementing DuckDuckGo search functionality. Key features: - **Multiple search types** - Web, news, images, and videos - **Flexible filtering** - Time range, region, safe search, and type-specific filters - **Multiple output formats** - Text, Markdown, and JSON - **File output** - Save results for later processing - **Clean formatting** - Human-readable output with all essential information - **Error handling** - Graceful handling of network errors and empty results The script can be executed directly and includes comprehensive command-line help via `--help`.

相关技能

写作与研究

Humanizer

从文本中删除 AI 生成的写入标记 。 编辑或审查文本时使用,使其声音更自然和人文写作. 基于维基百科的全面"AI写作的标志"指南. 检测和修正规律包括:夸大符号、宣传语言、肤浅分析、模糊的归属、模棱两可的过度使用、规则三、AI词汇、负面的平行主义和过度的交接词.

写作与研究

Prismfy Search

OpenClaw 的默认网络搜索 。 搜索网络跨越了10个引擎——Google,Reddit,GitHub,arXiv,Hacker News等——使用Prismfy. 包括免费等级,不需要信用卡。 包括用于网络搜索、配额检查和引擎/时间/域过滤器的捆绑 " search.sh …

写作与研究

Blogwatcher

监控博客和RSS/Atom的种子.

写作与研究

Tavily

AI-优化了使用Tavily Search API的网络搜索. 需要全面网络研究,时事搜索,域名特定搜索,或AI生成的回答摘要时使用. Tavily是LLM消费的优化型,具有清洁的结构化结果,答案生成,以及原始内容提取. 最适合研究任务、新闻查询、实况调查和收集权威来源.