| name | duckduckgo |
| description | Searches DuckDuckGo using the HTML endpoint (default, html→markdown via scrapling) and JSON API (--format json), returning clean markdown results, quick answers, abstracts, result links, and related topics. Use when performing web searches from the terminal, fetching Wikipedia-style summaries for a topic, or gathering search results into clean LLM context. |
| license | MIT |
| author | Tangled <noreply@tangledgroup.com> |
| version | 0.1.0 |
| tags | ["web-search","web search","duckduckgo"] |
| category | web |
| external_references | ["http://api.duckduckgo.com/","https://duckduckgo.com/"] |
DuckDuckGo Public APIs
Overview
DuckDuckGo provides two public, undocumented endpoints for programmatic search:
- HTML Endpoint (
/html/, default) — Returns full HTML search results page, automatically converted to clean markdown. Default format is html with scrapling backend for anti-bot evasion and native .md output.
- JSON API (
api.duckduckgo.com) — Returns structured data including Wikipedia-style abstracts, infoboxes, definitions, answer results, and related topics. Access via --format json. Reliable for automated use with no authentication required.
Both endpoints accept a q parameter for the search query. Always URL-encode the query string.
When to Use
- Performing quick web searches from the terminal or scripts
- Fetching Wikipedia-style summaries and infoboxes for a topic
- Extracting structured search data (abstracts, related topics, result links) into LLM context
- Building search pipelines with pipe chaining
- When you need privacy-respecting search without API keys
Format × Backend Matrix
| Format | scrapling (default) | curl | wget |
|---|
| html / markdown (default) | Native .md via --ai-targeted + --css-selector '.web-result' | Raw HTML → extract .web-result → pandoc → markdown | Raw HTML → extract .web-result → pandoc → markdown |
| json | Falls back to curl/wget (scrapling breaks JSON) | Raw JSON as-is | Raw JSON as-is |
- html / markdown (default): Scrapling provides native
.md output with anti-bot evasion and --css-selector '.web-result' for targeted extraction. curl/wget fetch raw HTML, extract only .web-result elements via python3 html.parser, then convert to markdown via pandoc.
- json: Always uses curl or wget. Scrapling transforms content and breaks JSON parsing.
--pretty flag prettifies JSON output through jq ..