Skip to content
gsearch

CLI

Every command and flag, with its default and a one-line description.

gsearch <command> [flags]

Run gsearch <command> --help for the full flag list on any command. This page is the map.

Commands

Command What it does
search Fetch all rich content for a query (the main command)
info Show DuckDB statistics and a feature breakdown
dump Print recent searches stored in the database
export Re-export recent stored results to JSON + Markdown
capture Save the raw AJAX/XHR responses Google makes while loading a SERP
gsearch search <query...> [flags]

Fetch all rich content from a Google Search results page: knowledge panels, sports tables, weather, translation, dictionary, calculator, unit conversion, stock prices, featured snippets, People Also Ask, and more. The query is one or more words, joined with spaces.

Flag Default Meaning
--headless / --no-headless headless Run Chrome headlessly, or show the window
--profile-dir <path> ~/.cache/gsearch-profile Chrome persistent profile directory
--no-profile off Use a fresh ephemeral browser profile instead
--lang <code> en Search language (Google's hl)
--country <code> US Search country code (Google's gl)
--save off Persist the result to DuckDB
--export / --no-export export on Write JSON + Markdown files, or suppress them
--json off Print the raw JSON result to stdout (skips files and summary)
--capture-network off Also capture the raw AJAX/XHR responses from Google
-p, --pages <n> 1 Number of result pages to fetch (follows "Next")
-v, --vertical <name> web Vertical: web, images, videos, news, shopping, books
--db <path> ~/data/gsearch/gsearch.duckdb DuckDB path (env GSEARCH_DB)
--timeout <seconds> 30 Browser wait timeout in seconds

info

gsearch info [flags]

Show database statistics and the feature breakdown across everything stored.

Flag Default Meaning
--db <path> ~/data/gsearch/gsearch.duckdb DuckDB path (env GSEARCH_DB)

dump

gsearch dump [flags]

Reprint recent searches from the database, using the same renderer as search.

Flag Default Meaning
-n, --limit <n> 10 Number of recent searches to print
--json off Print the stored results as a JSON array
--db <path> ~/data/gsearch/gsearch.duckdb DuckDB path (env GSEARCH_DB)

export

gsearch export [flags]

Re-export recent database results to JSON + Markdown files under ~/data/gsearch.

Flag Default Meaning
-n, --limit <n> 10 Number of recent results to export
--db <path> ~/data/gsearch/gsearch.duckdb DuckDB path (env GSEARCH_DB)

capture

gsearch capture <query...> [flags]

Capture the raw AJAX/XHR responses Google makes while loading the SERP, writing each response as a JSON file for offline analysis. See capturing the API.

Flag Default Meaning
--headless / --no-headless headless Run Chrome headlessly, or show the window
--profile-dir <path> ~/.cache/gsearch-profile Chrome persistent profile directory
--no-profile off Use a fresh ephemeral browser profile instead
--out <dir> ~/data/gsearch/capture Directory to write captured responses to
--timeout <seconds> 30 Browser wait timeout in seconds