Skip to content

Add -timeout flag to increase client timeout - #15

Merged
strzibny merged 1 commit into
mainfrom
timeout-flag
Oct 9, 2026
Merged

strzibny merged 1 commit into
mainfrom
timeout-flag

Conversation

@strzibny

@strzibny strzibny commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

I think we should let people handle their timeout considerations. This does not change the server timeout and/or if request finishes, but let people manage their expectations. I am also changing the default to 60s which is serpapi-golang's default.

@strzibny
strzibny merged commit 12abc1f into main Oct 9, 2026
3 of 4 checks passed

@hilmanski hilmanski left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Late review on the README addition

Comment thread README.md
```
Quote the expression with single quotes in bash/zsh to avoid shell interpretation of `$`, `|`, and `"`.
- `--api-key <key>` — Override API key (takes priority over environment and config file)
- `--timeout <seconds>` — HTTP request timeout (default `60`, env: `SERPAPI_TIMEOUT`). Use `0` to wait indefinitely. Slow engines such as `google_ai_mode`, or searches with `no_cache=true`, can take longer than the default; raise this if you see a `network_error` mentioning `Client.Timeout exceeded`. Note that a timed-out search may still complete on SerpApi's side and be billed and retrievable with `serpapi archive <search-id>`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we consider google_ai_mode as a slow engine?

or searches with no_cache=true, can take longer than the default

This is also a bit confusing. All of the searches have no_cache=true by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants