Skip to content

Releases: serpapi/serpapi-cli

v0.4.0

Choose a tag to compare

@github-actions github-actions released this 14 Oct 15:34
Immutable release. Only release title and notes can be modified.
e0e0c70

Changelog

  • 77ce1b4 Add --debug option
  • 906d968 Add server timeline and local address to debug output
  • 3c60b35 Change wording to direct users to focus on checking VPN, proxy, and connectivity
  • 0caec01 Emit --debug trace as JSON lines off a terminal
  • 433aa35 Merge pull request #14 from serpapi/image-api
  • 82bc6d0 Merge pull request #16 from serpapi/debug-option
  • 993b281 Merge pull request #19 from serpapi/ilyazub-serpapi-cli-refinement
  • e0e0c70 Merge pull request #20 from serpapi/ilyazub-cli-open-pr-reviews
  • 778b66c Refuse --image flag for non-supported engines
  • 2b8a540 Support /image API
  • 8e98b0c [Debug] Keep main's timeout advice and point to --debug when it's off
  • b606c29 [Debug] Redact the API key from every trace line
  • e80918f [Debug] Say the timeline's verdicts assume the clocks agree
  • 75048b1 [Docs] Say release tags and releases can't change once published
  • e0a949d [Image] Refuse an empty image or one over 500 KB before uploading
  • dfa8de9 [Image] Say only how to retry when an upload times out
  • d9544cb [Image] Stop at once on Ctrl-C while reading the image from stdin
  • 5a768a1 [Image] Stop suggesting image_id for engines that drop it
  • be7762d [Image] Test that uploads are traced as POST /image
  • 0b1ac1e [Image] Upload with the client and stdin every command uses

v0.3.0

Choose a tag to compare

@github-actions github-actions released this 13 Oct 10:22
4aa0a9d

serpapi is now predictable for scripts and AI agents, and safe on a terminal.

  • One error contract. Errors and warnings are JSON lines on stderr with the HTTP status. Exit 2 means fix the command; it fails before a billed search, except when a --jq filter fails on the response itself; 1 is an API or network error; 130 means Ctrl-C or SIGTERM stopped it before it finished, after printing what had arrived.
  • Markdown and other formats. output=md, html, plain and csv, in any case, work for search and archive (#10).
  • Timeouts. --timeout takes seconds, such as 120, or a duration, such as 2m; SERPAPI_TIMEOUT sets it for a shell; 0 waits indefinitely. The default is 60 s (#15, @strzibny).
  • --all-pages. --fields no longer stops paging after page 1 (#9, @adarshdigievo). no_cache, zero_trace and output apply to every page. Paging stops at a repeated page or at a page a mistyped --fields matches nothing on. Pages already fetched are printed, through --jq too, when a later page fails or on Ctrl-C. Output streams, so 100 pages of 1 MiB peak at 187–188 MiB instead of 720–735 MiB (3 runs each against v0.2.3 on macOS arm64, from a local fake API).
  • Warnings that name the fix. A large result lists its top-level keys by size and the free serpapi archive ID --jq next step, or says when no_cache or zero_trace makes a repeat a new, counted search. A --jq that prints only null lists the keys the response has. A parameter given twice says which value was sent.
  • Safer. Terminal output escapes control characters from results and from the account email that login prints, so a page title can't set the clipboard or clear the screen. serpapi account masks the API key (#7, @ilyazub), and the key is never echoed from a stray argument or a broken config file. login saves the key only under an absolute HOME, through a new private temp file, so a file left at the old temp name can't widen its permissions or receive the key. Ctrl-C or SIGTERM at its prompts stops it at once with echo on.
  • Also: serpapi version; login --api-key; login asks before replacing a saved key (#7); SERPAPI_API_KEY as a fallback for SERPAPI_KEY; --help documents exit codes, errors and costs.
  • Patched Go. Binaries are built with the latest patched Go at release time; go version -m "$(command -v serpapi)" shows which. v0.2.3's binaries were built with go1.25.0, in which govulncheck -mode=binary finds 57 (darwin/arm64) and 58 (linux/amd64) known vulnerabilities; a release rehearsal with go1.27.2 found none.

Changes scripts may notice

  • These now exit 2 before any request: q= with bare words, no parameters, the API key passed as key, apikey, serp_api_key or serpapi_key (api_key already did), --fields outside search, --max-pages 0, --all-pages with async=true, --jq or --all-pages with output=md, an unknown output=, and locations without a query.
  • A --jq filter that can't run, such as a syntax error, input or debug, fails before the search; one that fails on the response, such as tonumber on a title, still exits 2 after it. halt now works.
  • Bare words are joined into one q: serpapi search engine=google coffee shops sends q=coffee shops, not q=shops.
  • --fields adds error to json_restrictor, so an API error still arrives. --fields ,, sends no json_restrictor; it used to send ,, and print {}.
  • A SERPAPI_KEY padded with spaces or a newline is trimmed before it's sent.
  • serpapi account prints api_key masked, as abcd…wxyz (#7).
  • --all-pages: when a later page fails, or serpapi_pagination.next isn't a valid URL, the pages so far are printed before the error, exit 1; that invalid URL is now api_error, not network_error. A 200 response with an error on a later page is a warning after the pages so far, exit 0, not exit 1.
  • A JSON array body is exit 1 api_error, not exit 0.
  • serpapi with no command prints nothing on stdout, where its usage used to go; stderr has the JSON error, and the usage too on a terminal. It still exits 2.
  • serpapi help TOPIC with an unknown topic exits 2 with a JSON usage_error naming the closest command; it exited 0 with the usage on stderr.
  • serpapi login exits 2 when HOME (%AppData% on Windows) isn't an absolute path, and no command reads a config file then; v0.2.3 used .config/serpapi under the current directory.
  • At the hidden key prompt, Ctrl-D exits 2 with "No API key given" (v0.2.3 kept waiting), and SIGTERM exits 130 with echo on (v0.2.3: 143, echo off).
  • The default timeout is 60 s, not 30 s.

Thanks to @adarshdigievo (#4, #9), @jvmvik (#6), @strzibny (#15) and @ilyazub (#7).

v0.2.3

Choose a tag to compare

@github-actions github-actions released this 31 Mar 19:12

Changelog

  • 7c66aeb fix: set up SSH deploy key inline without third-party action

v0.2.2

Choose a tag to compare

@github-actions github-actions released this 31 Mar 19:10

Changelog

  • c1a272d fix: use deploy key for homebrew-tap instead of PAT

v0.2.1

Choose a tag to compare

@github-actions github-actions released this 31 Mar 19:05

Changelog

  • 24237d9 fix: use directory instead of folder in goreleaser brews config

v0.1.1

Choose a tag to compare

@github-actions github-actions released this 27 Mar 22:18

Full Changelog: v0.1.0...v0.1.1

v0.1.0

Choose a tag to compare

@github-actions github-actions released this 26 Mar 14:08

What's Changed

  • Initial version of SerpApi CLI by @ilyazub in #1

New Contributors

Full Changelog: https://github.com/serpapi/serpapi-cli/commits/v0.1.0