Web search using DuckDuckGo Instant Answer API (no API key required). Use when you need to search the web for information, definitions, calculations, convers...
Free web search using DuckDuckGo's Instant Answer API. No API key required.
# Basic search
cd /home/hxx/clawd/tools && ./web-search.sh "your query"
# Examples
./web-search.sh "what is artificial intelligence"
./web-search.sh "python programming"
./web-search.sh "define recursion"
./web-search.sh "2+2"
-h, --help - Display help message with usage examples--format <format> - Output format: text, markdown, plain (default: text)
text: Colored terminal output (default)markdown: Clean markdown format (no ANSI colors)plain: Plain text without colors--no-color - Disable colored output (same as --format plain)--max-related <N> - Control number of related topics to show (default: 5)--quiet - Minimal output mode (just results, no headers/footer)Use shell redirection to save results to file:
# Save to file
./web-search.sh "query" > output.txt
# With markdown format
./web-search.sh --format markdown "query" > results.md
# With no colors for logs
./web-search.sh --no-color "query" > search.log
The tool provides several result types:
--format text (colored, default)--format markdown > file.md`--format plain or --no-colorsqrt(144))# Simple query
./web-search.sh "open source AI models"
# Wikipedia-style query
./web-search.sh "what is recursion"
# Clean markdown output
./web-search.sh --format markdown "python programming"
# Save to markdown file
./web-search.sh --format markdown "AI research" > research.md
# For logs or piping
./web-search.sh --format plain "search query"
# Disable colors explicitly
./web-search.sh --no-color "search query"
# Show fewer related topics
./web-search.sh --max-related 3 "machine learning"
# Show more related topics
./web-search.sh --max-related 10 "open source"
# Minimal output (just results)
./web-search.sh --quiet "what is 42 + 7"
# Markdown, no color, saved to file
./web-search.sh --format markdown --no-color "topic" > results.md
# Quiet with custom related count
./web-search.sh --quiet --max-related 2 "definition"
Tested and verified to work:
2+2, 10% of 500100 miles to kmwhat is artificial intelligencewhat is python, how to install dockerwho is Elon Muskspeed of lightweather in TokyoSee test-outputs.md for detailed test results.
Try rephasing your query or using the provided DuckDuckGo URL for full search.
Check internet connection. Tool requires network access.
Some abstracts display garbled characters. This is a known issue with basic parsing (install jq for better results).
The tool works without jq using basic text extraction, but installing jq improves JSON parsing:
# Ubuntu/Debian
sudo apt-get install jq
# macOS
brew install jq
# Via package managers
npm install -g jq
Use --format plain or --no-color to disable colors.
Clean markdown with:
## headers for sections**bold** for emphasis- bullet lists*italics* for metadata[links]() for URLsNo ANSI codes or markdown formatting - suitable for logs and piping.
curl or wget (for HTTP requests)jq (for better JSON parsing)ZIP package — ready to use