web-search-duckduckgo

star 1

Search the web using DuckDuckGo and return clean Markdown results. No API keys or external dependencies required (stdlib Python only). Use when you need to look something up online, find current information, research a topic, or verify facts. Supports web search, instant answers, and JSON output.

yfyang86 By yfyang86 schedule Updated 2/23/2026

name: web-search-duckduckgo description: Search the web using DuckDuckGo and return clean Markdown results. No API keys or external dependencies required (stdlib Python only). Use when you need to look something up online, find current information, research a topic, or verify facts. Supports web search, instant answers, and JSON output. metadata: { "openclaw": { "emoji": "๐Ÿ”", "requires": { "bins": ["python3", "curl"] } } }

Web Search (DuckDuckGo)

Two methods, no API keys or pip installs needed.

Web search via script (primary)

Full search results as Markdown โ€” uses only Python stdlib:

python scripts/ddg_search.py "search query"
# Output: Markdown with titles, URLs, and snippets

More results:

./scripts/ddg_search.py "search query" -n 10

JSON output for programmatic use:

./scripts/ddg_search.py "search query" --json

Instant answers via curl (quick facts)

DuckDuckGo Instant Answer API โ€” great for definitions, quick facts:

curl -s "https://api.duckduckgo.com/?q=python+programming&format=json&no_html=1" | python3 -c "
import sys,json; d=json.load(sys.stdin)
for k in ('Answer','AbstractText','Definition'):
    if d.get(k): print(f'{k}: {d[k]}'); break
else:
    print('No instant answer. Use ddg_search.py for web results.')
"

Or just grab the raw JSON:

curl -s "https://api.duckduckgo.com/?q=query&format=json&no_html=1"

Key JSON fields: AbstractText, Answer, Definition, RelatedTopics[]

Docs: https://api.duckduckgo.com/api

Tips

  • Keep queries short (1โ€“6 words) for best results.
  • URL-encode spaces as + in curl commands.
  • Use the script for full web results; use the curl API for quick lookups.
  • If first search is insufficient, refine the query โ€” don't repeat it.
Install via CLI
npx skills add https://github.com/yfyang86/memst --skill web-search-duckduckgo
Repository Details
star Stars 1
call_split Forks 0
navigation Branch main
article Path SKILL.md
More from Creator