Skip to content
gsearch

Output and export

The terminal summary, --json to stdout, the JSON object shape, the dated file export under ~/data/gsearch, and piping into jq.

search has three ways out: a readable summary on the terminal, the full structured object as JSON, and dated files on disk. By default you get the summary plus the files; --json switches to stdout.

The terminal summary

With no output flag, search prints a summary. A rule with the query, a line of counts (response time, detected features, organic and PAA totals), then each rich block it found rendered for reading, then the organic results:

──────────────── Google Search - 'epl' ────────────────
  response: 2143ms  |  features: Sports Standings, Knowledge Panel
  organic: 11  |  paa: 4  |  stories: 3

Standings:  Premier League
  #   Team            P    W   D   L   Pts
  1   Liverpool       29   21  6   2   69
  ...

Organic Results (11):
  1. Premier League: Official Site
     premierleague.com
  ...

The summary renders only the blocks present on the page. The complete data, including blocks the summary abbreviates, is in the JSON.

--json to stdout

--json prints the full result object to stdout and skips both the summary and the file export. This is the form to pipe into another program:

gsearch search "AAPL stock" --json | jq '.features.stock'
gsearch search "epl" --json | jq '.organic_results[].url'

The JSON object shape

A web result carries these top-level keys:

Key Holds
query The search query
vertical The vertical (web by default)
detected_features The list of block kinds found
features A map, one entry per block kind (stock, weather, knowledge_panel, and so on)
organic_results The ten blue links, each with position, title, url, snippet, and any sitelinks
people_also_ask The PAA questions
related_searches The related-search suggestions
top_stories The top-stories cluster
local_pack The local business results, when present
vertical_results The vertical's results, for non-web verticals
response_ms Render time in milliseconds
fetched_at When the run happened

Each entry under features has its own fields. For example features.stock carries title, price, change, and change_pct; features.weather carries location, temp_c, temp_f, description, and a forecast list.

gsearch search "weather tokyo" --json | jq '.features.weather'
{
  "location": "Tokyo, Japan",
  "temp_c": 22,
  "temp_f": 72,
  "description": "Partly cloudy",
  "forecast": [
    {"day": "Mon", "high_c": 24, "low_c": 17},
    {"day": "Tue", "high_c": 23, "low_c": 16}
  ]
}

The exported files

Unless you pass --no-export, every search run also writes two files under ~/data/gsearch, organized by date:

~/data/gsearch/json/2026/06/13/22-41-epl.json
~/data/gsearch/markdown/2026/06/13/22-41-epl.md

The JSON file is the same object --json prints. The Markdown file is a human-readable rendering of the result with front-matter, suitable for keeping in notes or a wiki. The path encodes the date and time and a slug of the query, so a directory listing reads as a history of what you searched. See output formats for the naming and front-matter details.

Turn the files off for a one-off:

gsearch search "epl" --no-export

Note that --json already suppresses the file export, so use --no-export only when you want the terminal summary but no files.

Composing with jq

Because --json is a clean object, the usual jq patterns work. List the detected blocks:

gsearch search "epl" --json | jq '.detected_features'

Pull just the organic URLs:

gsearch search "python tutorial" --json | jq -r '.organic_results[].url'

Or read a vertical's items:

gsearch search "cats" -v images --json | jq '.vertical_results.images[0]'