🦆 DuckDuckGo
========================================
📖 Table of Contents
🚀 Installation
To install duckduckgo cli, use the following Cargo command:
To use it as a library, add it to your Cargo.toml:
[]
= "0.2.1"
✨ Features
- 🔍 Simple and advanced search: Perform DuckDuckGo searches using basic queries or advanced search operators.
- ⚙️ Search operators: Refine results using DuckDuckGo-compatible filters (e.g. site, filetype, intitle).
- 🛡️ Safe search toggle: Enable or disable family-friendly search filtering.
- 🖨️ Output formatting: Choose between list or detailed formats for displaying results.
- 🧮 Result limiting: Limit the number of results returned (default is 10).
- 🧭 Backend selection: Use
--backendto choose the search backend (Auto,HTML, orAPI). - 🌐 Custom user agent: Spoof or specify a user agent string for requests.
- 🧩 Cookie control: Enable or disable cookie handling for requests.
- 🕵️ Proxy support: Route requests through a custom HTTP or SOCKS proxy.
- 🐛 Verbose mode: Print debug information for troubleshooting.
- 🎨 ANSI-colored output: Enjoy beautiful, readable output right in your terminal.
- 🔧 Full URL parameter support: Typed enums for every DuckDuckGo URL setting (region, theme, font, colour, …).
🚗 CLI Usage
Learn how to use the duckduckgo and explore its features with the following examples:
Perform a basic search:
Use search operators:
Enable safe search:
Set the output format to detailed:
Limit the number of results to 3:
Set user agent:
Set Different Backends:
# news
# images
# lite
| Browser/Agent |
|---|
| abrowse |
| acoo browser |
| america online browser |
| amigavoyager |
| aol |
| arora |
| avant browser |
| beonex |
| bonecho |
| browzar |
| camino |
| charon |
| cheshire |
| chimera |
| chrome |
| chromeplus |
| classilla |
| cometbird |
| comodo_dragon |
| conkeror |
| crazy browser |
| cyberdog |
| deepnet explorer |
| deskbrowse |
| dillo |
| dooble |
| edge |
| element browser |
| elinks |
| enigma browser |
| enigmafox |
| epiphany |
| escape |
| firebird |
| firefox |
| fireweb navigator |
| flock |
| fluid |
| galaxy |
| galeon |
| granparadiso |
| greenbrowser |
| hana |
| hotjava |
| ibm webexplorer |
| ibrowse |
| icab |
| iceape |
| icecat |
| iceweasel |
| inet browser |
| internet explorer |
| irider |
| iron |
| k-meleon |
| k-ninja |
| kapiko |
| kazehakase |
| kindle browser |
| kkman |
| kmlite |
| konqueror |
| leechcraft |
| links |
| lobo |
| lolifox |
| lorentz |
| lunascape |
| lynx |
| madfox |
| maxthon |
| midori |
| minefield |
| mozilla |
| myibrow |
| myie2 |
| namoroka |
| navscape |
| ncsa_mosaic |
| netnewswire |
| netpositive |
| netscape |
| netsurf |
| omniweb |
| opera |
| orca |
| oregano |
| osb-browser |
| palemoon |
| phoenix |
| pogo |
| prism |
| qtweb internet browser |
| rekonq |
| retawq |
| rockmelt |
| safari |
| seamonkey |
| shiira |
| shiretoko |
| sleipnir |
| slimbrowser |
| stainless |
| sundance |
| sunrise |
| surf |
| sylera |
| tencent traveler |
| tenfourfox |
| theworld browser |
| uzbl |
| vimprobable |
| vonkeror |
| w3m |
| weltweitimnetzbrowser |
| worldwideweb |
| wyzo |
Set cookie for subsequent requests:
Set proxy:
🎨 Options
| Option | Default Value | Description |
|---|---|---|
--query, -q |
(required) | Set the search query. |
--operators, -o |
"" |
Set search operators (e.g., +site:rust-lang.org). |
--safe, -s |
false |
Enable safe search (family-friendly results). |
--format, -f |
false |
Output format: false = list, true = detailed. |
--limit, -l |
10 |
Limit the number of search results. |
--user-agent, -u |
firefox |
Set a custom user agent for HTTP requests. |
--cookie, -c |
true |
Enable cookie handling for the HTTP client. |
--proxy, -p |
"" |
Set a proxy for requests (e.g., socks5://192.168.1.1:9000). |
--backend, -b |
Auto |
Choose backend: Auto, Lite, Images, or News. |
--verbose, -v |
false |
Enable verbose (debug) mode. |
📚 Library Usage
Simple browser (zero-configuration)
use Browser;
use ResultFormat;
async
Configuring the browser with BrowserBuilder
use Browser;
use ResultFormat;
use get;
async
Image search
use Browser;
use get;
async
News search
use Browser;
use get;
async
Lite search
use Browser;
use get;
async
🔧 Search Parameters
The params module provides strongly-typed enums for every documented DuckDuckGo URL parameter. Pass a SearchParams instance to search(), advanced_search(), or search_operators().
use Browser;
use ResultFormat;
use ;
async
Available Parameter Groups
| Group | Key Methods |
|---|---|
| Result | region(Region), safe_search(SafeSearch), open_instant_answers, auto_load_images, auto_load_results, new_window, favicons, full_urls, auto_suggest |
| Privacy | redirect, https, address_bar(AddressBar), video_playback(VideoPlayback) |
| Colour | header_color, url_color, background_color, text_color, link_color, visited_link_color |
| Look & Feel | theme(Theme), size(Size), width(Width), placement(Placement), link_font(Font), text_font(Font), underline |
| Interface | header_behavior(HeaderBehavior), advertisements, page_numbers(PageNumbers), units_measure(UnitsMeasure) |
| Source | source(impl Into<String>) |
🤝 Contributing
Contributions and feedback are welcome! If you'd like to contribute, report an issue, or suggest an enhancement, please engage with the project on GitHub. Your contributions help improve this CLI for the community.
📄 License
This project is licensed under the MIT License.