Skills ddgs-web-search
Use when needing to search the web in AI coding tools or OpenClaw. Uses DuckDuckGo API without API key.
install
source · Clone the upstream repo
git clone https://github.com/openclaw/skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/bird-frank/ddgs-search-api" ~/.claude/skills/clawdbot-skills-ddgs-web-search && rm -rf "$T"
manifest:
skills/bird-frank/ddgs-search-api/SKILL.mdsource content
DuckDuckGo Web Search Skill
An Agent Skill for searching web content via DuckDuckGo.
Overview
This Skill provides a command-line tool for web search using the
ddgs Python package. Suitable for:
- Real-time web information needs in AI coding tools
- Fetching search results in OpenClaw workflows
Core Features
- Web Search: General web search
- News Search: Dedicated news content search
- Multiple Output Formats: Text or JSON format
- Flexible Configuration: Region, time limits, and safe search level
Installation
This project uses
uv as the Python package manager.
Option 1: Run with uv (Recommended)
# Run the script directly (uv will auto-install dependencies) uv run scripts/ddgs_search.py "Python programming" # Or navigate to the directory first cd skills/ddgs-search uv run scripts/ddgs_search.py "machine learning"
Option 2: Manual Dependency Installation
# Install dependencies using uv uv pip install ddgs # Or use pip pip install ddgs
Quick Start
Basic Usage
# Run with uv (recommended) uv run scripts/ddgs_search.py "Python programming" # Limit the number of results uv run scripts/ddgs_search.py "machine learning" --max-results 5 # Search news uv run scripts/ddgs_search.py "tech news" --news # JSON output (for programmatic parsing) uv run scripts/ddgs_search.py "API documentation" --json # Time limit (today) uv run scripts/ddgs_search.py "breaking news" --timelimit d
Complete Parameter Reference
| Parameter | Short | Description | Default |
|---|---|---|---|
| - | Search keywords | Required |
| | Maximum number of results | 10 |
| | Region code | |
| | Safe search (on/moderate/off) | |
| | Time limit (d/w/m/y) | - |
| | Search backend (auto/html/lite) | |
| - | Search news | - |
| | JSON format output | - |
| | Show detailed information | - |
Region Code Examples
- Worldwide (default)wt-wt
- United States Englishus-en
- China Chinesecn-zh
- Japanjp-jp
- United Kingdomuk-en
Time Limits
- Past dayd
- Past weekw
- Past monthm
- Past yeary
Usage in OpenClaw
In OpenClaw workflows, you can invoke it via the
bash tool:
# Example workflow step - name: search_web tool: bash command: cd skills/ddgs-search && uv run scripts/ddgs_search.py "{{ query }}" --json
Or using the Python tool:
# Assuming the current directory is the project root import subprocess import json result = subprocess.run( ["uv", "run", "skills/ddgs-search/scripts/ddgs_search.py", "Python tips", "--json"], capture_output=True, text=True ) data = json.loads(result.stdout)
Return Result Format
Web Search Results
[ { "title": "Result Title", "href": "https://example.com/page", "body": "Page snippet/description..." } ]
News Search Results
[ { "title": "News Headline", "href": "https://news.example.com/article", "body": "Article summary...", "date": "2024-01-15", "source": "News Source Name" } ]
Usage Examples
Example 1: Search Technical Documentation
uv run scripts/ddgs_search.py "FastAPI documentation" -n 5
Example 2: Get Latest News
uv run scripts/ddgs_search.py "artificial intelligence" --news -t d -n 3
Example 3: Chinese Search
uv run scripts/ddgs_search.py "机器学习教程" -r cn-zh -n 8
Example 4: JSON Output Processing
uv run scripts/ddgs_search.py "python tips" --json | jq '.[0].href'
FAQ
uv Not Installed
# macOS/Linux curl -LsSf https://astral.sh/uv/install.sh | sh # Windows powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
ImportError: No module named 'ddgs'
# Install using uv uv pip install ddgs # Or run in the script directory (uv will auto-handle) cd skills/ddgs-search uv run scripts/ddgs_search.py "query"
Empty Search Results
- Check network connection
- Try changing the
parameter (auto/html/lite)--backend - Some regions may require a proxy
Rate Limiting
DuckDuckGo has implicit rate limiting. If frequent requests fail:
- Reduce request frequency
- Add delays between requests
- Use a different backend
Dependencies
- Python 3.9+
(package manager)uv
>= 8.0.0ddgs