ddgr
DuckDuckGo search from the command line
TLDR
Search DuckDuckGo from the terminal
SYNOPSIS
ddgr [OPTIONS] [KEYWORD [KEYWORD...]]
DESCRIPTION
ddgr is a command-line tool for searching DuckDuckGo from the terminal. It displays search results with title, URL, and text context. Results are paginated and indexed, allowing quick navigation and opening in a browser by number.
The tool supports DuckDuckGo bangs (shortcuts like !w for Wikipedia, !yt for YouTube) and keywords like filetype: and site:. Results can be limited by time period or region. DuckDuckGo's privacy-focused approach means no tracking, and ddgr works over the Tor network.
PARAMETERS
-n, --num=N
Show N results per page (0-25, default: 10).-r, --reg=REG
Region-specific search (e.g., us-en, uk-en, in-en).-j, --ducky
Open first result in browser; implies --noprompt.-t, --time=SPAN
Limit search by time: d (day), w (week), m (month), y (year).-w, --site=SITE
Search a specific website.-x, --expand
Show complete URLs instead of just domains.-p, --proxy=URI
Route traffic through HTTP proxy.--unsafe
Disable safe search.--json
Output results as JSON; implies --noprompt.--np, --noprompt
Search and exit without interactive prompt.--colors=COLORS
Set custom output color scheme.-C, --nocolor
Disable colored output.-h, --help
Display help and exit.
CONFIGURATION
~/.config/ddgr/config
Configuration file for setting default options like number of results, region, and proxy settings.
OMNIPROMPT
n, p, f
Navigate to next, previous, or first page.index
Open result number in browser.o [index|range|a]
Open result(s) in browser.d keywords
Perform new search with same options.c index
Copy URL to clipboard.x
Toggle URL expansion.q, ^D, double Enter
Exit ddgr.
ENVIRONMENT
BROWSER
Override the default web browser.DDGR_COLORS
Custom color scheme (six-letter string like BSD LSCOLORS).HTTPS_PROXY
HTTP proxy configuration.
CAVEATS
Requires Python 3.8 or later. Results depend on DuckDuckGo's HTML interface which may change. Some features like instant answers are not available in the HTML version used by ddgr.
HISTORY
ddgr was created by Arun Prakash Jana as a privacy-focused alternative to googler (a similar tool for Google search). The project emphasizes user privacy by leveraging DuckDuckGo's no-tracking policy and support for the Tor network.
