name: web-search description: Search the web using DuckDuckGo for current information, recent events, real-time data, and fact-checking beyond training cutoff metadata: openclaw: emoji: "๐" requires: bins: ["python3"]
Web Search Skill
This skill enables Claude to search the web using DuckDuckGo to access current information, recent events, and real-time data beyond the training cutoff.
When to Use
Use this skill when you need:
- Current events and breaking news โ Latest happenings, political updates, global events
- Recent information after training cutoff โ New releases, updates, or changes since training data
- Real-time data โ Current weather, sports scores, stock prices, cryptocurrency values
- Fact-checking verifiable claims โ Confirm accuracy of statements, dates, statistics
- Fast-changing topics โ Tech releases, API documentation updates, library versions
- Finding recent examples or tutorials โ Latest best practices, code examples, how-to guides
- Availability checks โ Is a service up? Is an event still happening?
- Contact information โ Business hours, addresses, phone numbers for services
When NOT to Use
Avoid using this skill for:
- Basic knowledge questions โ Information well within training data (historical facts, established concepts)
- Math or logic problems โ Calculations, reasoning tasks that don't require external data
- Coding help โ Writing code, debugging, or explaining programming concepts (unless searching for recent API changes)
- Creative writing or brainstorming โ Tasks requiring imagination rather than facts
- Deep analysis โ Tasks requiring understanding beyond surface-level facts from search results
- Private or local information โ User's personal files, codebase details, local configurations
- Opinion or subjective matters โ When training data provides sufficient context for reasoned opinions
Usage
The skill is invoked by running the search script with a query:
python ~/.openclaw/skills/web-search/scripts/search.py "your search query" [options]
Options
--max-results Nโ Number of results to return (default: 5, max: 10)--time-range d|w|m|yโ Filter results by time: d=day, w=week, m=month, y=year--newsโ Search news sources instead of general web--region CODEโ Region code for localized results (default: "us-en")
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)jp-jpโ Japan (Japanese)
Examples
1. Check Current Weather
python ~/.openclaw/skills/web-search/scripts/search.py "current weather Hartford CT"
2. Find Recent News
python ~/.openclaw/skills/web-search/scripts/search.py "latest AI developments" --news --max-results 3
3. Search for Recent Releases
python ~/.openclaw/skills/web-search/scripts/search.py "Python 3.13 release notes" --time-range m
4. Get Stock Information
python ~/.openclaw/skills/web-search/scripts/search.py "AAPL stock price"
5. Find API Documentation
python ~/.openclaw/skills/web-search/scripts/search.py "OpenAI API rate limits 2026"
Workflow
When using this skill, follow this workflow:
- Run the search โ Execute the script with your query
- Parse JSON output โ The script outputs structured JSON with results
- Synthesize results โ Read through results and extract relevant information
- Attribute sources โ When presenting findings, cite sources with URLs
- Refine if needed โ If results are insufficient, try:
- Different keywords (more specific or more general)
- Time range filtering (--time-range)
- News search (--news flag)
- Multiple searches for complex topics
JSON Output Structure
The script returns JSON in this format:
{
"results": [
{
"title": "Page Title",
"url": "https://example.com/page",
"snippet": "Preview text from the page..."
}
],
"query": "original search query",
"result_count": 5
}
Attribution Guidelines
When presenting search results to users:
- Always include sources โ Provide URLs in markdown format:
[Title](URL) - Cite multiple sources โ For important claims, reference 2-3 sources
- Format sources section โ End responses with a "Sources:" section listing all URLs
- Be transparent โ Make it clear when information comes from search results vs. training data
Example:
Based on recent reports, Python 3.13 was released in October 2024 with
several performance improvements and new features.
Sources:
- [Python 3.13 Release Notes](https://docs.python.org/3/whatsnew/3.13.html)
- [Python Insider: Python 3.13.0 is now available](https://blog.python.org/...)
Best Practices
Query Formulation
- Keep queries short โ 1-6 words works best (e.g., "React hooks documentation")
- Use specific keywords โ Instead of "how to make cake", use "chocolate cake recipe"
- Include year for recent info โ "TypeScript features 2026" vs. "TypeScript features"
- Use quotation marks for phrases โ Not in the script args, but in the query string itself
Time Filtering
- Use
--time-range dfor breaking news or very recent events - Use
--time-range wfor current events and weekly updates - Use
--time-range mfor recent developments and monthly changes - Use
--time-range yfor annual updates and year-over-year changes
Multiple Searches
For complex questions, break them into multiple searches:
- Bad: "What are the differences between React and Vue and which is better for large projects"
- Good:
- "React vs Vue comparison 2026"
- "React large projects scalability"
- "Vue large applications performance"
Result Verification
- Cross-reference โ Check multiple sources for important facts
- Check dates โ Ensure information is current enough for the query
- Assess authority โ Official docs, established news sites, and recognized experts are more reliable
- Be skeptical โ Search results may contain outdated, biased, or incorrect information
Error Handling
The script handles common errors gracefully:
Network Failures
If the search fails due to network issues:
- Error message will be printed to stderr
- Exit code will be non-zero
- Retry after a moment or check internet connection
Rate Limiting
DuckDuckGo may rate-limit requests:
- Wait 30-60 seconds before retrying
- Reduce search frequency if hitting limits repeatedly
- Consider alternative providers (see
references/providers.md)
No Results Found
If a query returns no results:
- JSON will contain empty results array:
{"results": [], ...} - Try rephrasing the query with different keywords
- Remove time filters if using them
- Check for typos in the query
Import Errors
If duckduckgo-search library is missing:
- Script automatically attempts to install it
- Requires
pipto be available - May require
--break-system-packagesflag in some environments - If auto-install fails, manually install:
pip install duckduckgo-search
Technical Details
Dependencies
- Python 3.x โ Required (python3 command must be available)
- duckduckgo-search โ Auto-installed if missing
- pip โ Required for dependency installation
Auto-Installation
The script automatically installs missing dependencies:
subprocess.check_call([
sys.executable, "-m", "pip", "install",
"duckduckgo-search", "--break-system-packages", "--quiet"
])
The --break-system-packages flag is needed for externally-managed Python environments (common on modern Linux distributions and macOS with Homebrew Python).
Provider Design
This skill uses a provider-agnostic architecture:
- Search provider can be swapped by replacing
scripts/search.py - CLI interface remains consistent (same arguments)
- JSON output format stays the same
- See
references/providers.mdfor alternative providers
Exit Codes
0โ Success1โ General error (network failure, invalid query, etc.)2โ Import error (dependency installation failed)
Limitations
DuckDuckGo Constraints
- Rate limiting โ Frequent searches may be throttled
- No API key โ Cannot authenticate for higher limits
- Basic search โ Less sophisticated than paid APIs (no filters for academic papers, patents, etc.)
- No search history โ Each search is independent
- Result quality โ May be less relevant than Google/Bing for niche topics
General Limitations
- Surface-level information โ Search results provide snippets, not deep analysis
- No PDF/file downloads โ Only returns web page URLs, not file contents
- No image search โ Text search only (web and news)
- English-centric โ Best results for English queries, though region codes help
- Recency bias โ Very recent events (< 1 hour) may not be indexed yet
Troubleshooting
Script Not Executable
If you get "Permission denied" error:
chmod +x ~/.openclaw/skills/web-search/scripts/search.py
Python Not Found
If python3 command doesn't exist, create an alias or use full path to Python interpreter.
Installation Fails in Virtual Environment
If auto-install fails due to venv restrictions, manually install globally:
python3 -m pip install duckduckgo-search --user
No Results for Valid Query
- Try removing time filters
- Use more general keywords
- Check if the topic is too recent (< 1 hour)
- Verify spelling and phrasing
See Also
references/providers.mdโ Alternative search providers and migration guide- DuckDuckGo Search Python Library โ Upstream library documentation
Notes
- The skill is designed to be proactive โ Claude should use it whenever current information would improve the response
- Always cite sources when using search results
- For controversial or critical information, cross-reference multiple sources
- Privacy-respecting โ DuckDuckGo doesn't track searches or build user profiles