DDGS search
Web search and content extraction using the DDGS library. No browser required.
Usage
Run from any directory:
uv run {baseDir}/search.py "python programming" # Basic search (5 results)
uv run {baseDir}/search.py "python programming" --proxy http://proxy.example.com:8080 # Use proxy
uv run {baseDir}/search.py "russia filetype:pdf" # Search with advanced query
uv run {baseDir}/search.py "python programming" -n 20 # More results
uv run {baseDir}/search.py "python programming" -r uk-en # UK English results
uv run {baseDir}/search.py "python programming" -s off # Disable safesearch
uv run {baseDir}/search.py "python programming" -t w2 # Results from the last two weeks
uv run {baseDir}/search.py "python programming" -p 2 # Page 2 of results
uv run {baseDir}/search.py "python programming" -b "bing,google" # Use specific backends
uv run {baseDir}/search.py "python programming" --brief # Show only snippets (no full text extraction)
Options
-n, --max-results <num> - Maximum number of results (default: 5)
-r, --region <code> - Region/language code: us-en, uk-en, ru-ru, etc. (default: us-en)
-s, --safesearch <level> - Safesearch level: on, moderate, off (default: off)
-t, --timelimit <period> - Time limit: d, w, m, y. (default: None)
-p, --page <num> - Page number of results (default: 1)
-b, --backend <backends> - Single or comma-delimited backends (default: auto)
- available backends: bing, brave, duckduckgo, google, grokipedia, mojeek, yandex, yahoo, wikipedia
--proxy <url> - Proxy URL (default: None)
--brief - Suppress full text extraction from webpages (show only snippets)
Output Format
By default, the tool fetches and displays full text from each webpage:
--- Result 1 ---
Title: Python (programming language)
Href: https://grokipedia.com/page/Python_(programming_language)
Body: Python is an interpreted, high-level, general-purpose programming language designed for code readability and simplicity, featuring a dynamic type system and support for...
Full Text:
----------------------------------------
# Python (programming language)
Python is an interpreted, high-level, general-purpose programming language...
[... truncated ...]
----------------------------------------
--- Result 2 ---
...
Use --brief to show only the search result snippets without full text extraction.
When to Use
- Searching for documentation or API references
- Looking up facts or current information
- Any task requiring web search without interactive browsing
Next Steps
Useful commands
- Use
curl to fetch webpage or download files
- Use
uvx html2text to convert webpages into readable text
- Use
pdftotext or uvx pdfplumber to extract text from PDF documents
1---2name: ddgs-search3description: Web search via the DDGS metasearch library. Use for searching for unknown documentation, facts, or any web content. Lightweight, no browser required.4---5
6# DDGS search
7
8Web search and content extraction using the DDGS library. No browser required.
9
10## Usage
11
12Run from any directory:
13
14```bash
15uv run {baseDir}/search.py "python programming" # Basic search (5 results)
16uv run {baseDir}/search.py "python programming" --proxy http://proxy.example.com:8080 # Use proxy
17uv run {baseDir}/search.py "russia filetype:pdf" # Search with advanced query
18uv run {baseDir}/search.py "python programming" -n 20 # More results
19uv run {baseDir}/search.py "python programming" -r uk-en # UK English results
20uv run {baseDir}/search.py "python programming" -s off # Disable safesearch
21uv run {baseDir}/search.py "python programming" -t w2 # Results from the last two weeks
22uv run {baseDir}/search.py "python programming" -p 2 # Page 2 of results
23uv run {baseDir}/search.py "python programming" -b "bing,google" # Use specific backends
24uv run {baseDir}/search.py "python programming" --brief # Show only snippets (no full text extraction)
25```
26
27### Options
28
29- `-n, --max-results <num>` - Maximum number of results (default: 5)
30- `-r, --region <code>` - Region/language code: us-en, uk-en, ru-ru, etc. (default: us-en)
31- `-s, --safesearch <level>` - Safesearch level: on, moderate, off (default: off)
32- `-t, --timelimit <period>` - Time limit: d, w, m, y. (default: None)
33- `-p, --page <num>` - Page number of results (default: 1)
34- `-b, --backend <backends>` - Single or comma-delimited backends (default: auto)
35 - available backends: bing, brave, duckduckgo, google, grokipedia, mojeek, yandex, yahoo, wikipedia
36- `--proxy <url>` - Proxy URL (default: None)
37- `--brief` - Suppress full text extraction from webpages (show only snippets)
38
39### Output Format
40
41By default, the tool fetches and displays full text from each webpage:
42
43```plaintext
44--- Result 1 ---
45Title: Python (programming language)
46Href: https://grokipedia.com/page/Python_(programming_language)
47Body: Python is an interpreted, high-level, general-purpose programming language designed for code readability and simplicity, featuring a dynamic type system and support for...
48
49Full Text:
50----------------------------------------
51# Python (programming language)
52
53Python is an interpreted, high-level, general-purpose programming language...
54
55[... truncated ...]
56----------------------------------------
57
58--- Result 2 ---
59...
60```
61
62Use `--brief` to show only the search result snippets without full text extraction.
63
64## When to Use
65
66- Searching for documentation or API references
67- Looking up facts or current information
68- Any task requiring web search without interactive browsing
69
70## Next Steps
71
72### Useful commands
73
74- Use `curl` to fetch webpage or download files
75- Use `uvx html2text` to convert webpages into readable text
76- Use `pdftotext` or `uvx pdfplumber` to extract text from PDF documents