OptionalfetchOptionalinit: RequestInitOptionalinit: RequestInitOptionalheadersExtra request headers, merged over the browser-like defaults. Chiefly useful for varying
user-agent: Google answers the widgetdata endpoints with 429 when the agent string looks
like a Node HTTP client, and a server running several sessions wants them to differ.
OptionallanguageLanguage tag; a bare code such as "en" is expanded to "en-US".
OptionalmaxHow many proxies to try before giving up on a query. Defaults to the pool size, capped at 5.
OptionalonCalled when a query fails and the pool rotates. Useful for logging.
OptionalproxiesProxy URLs to rotate through, e.g. ["http://user:pass@gate.example.com:7000"].
One proxy is pinned per query and the pool advances only when a query fails, because
Google binds its cookie and widget token to the exit IP. Requires the optional
peer dependency undici. Mutually exclusive with fetch.
OptionalretriesRetry count for network-level failures within a single request. Default 0.
OptionalrpcOverride the pinned batchexecute RPC identifiers. They are stable for long stretches
but Google does rename them; this lets you patch without waiting for a release.
OptionaltimeoutPer-request timeout in milliseconds. Default 10000.
Injectable
fetch, for proxies, logging, or tests. Defaults to the global.