Search via SerpApi

View as Markdown

Proxies to https://serpapi.com/search, injecting the secret api_key as the first query parameter. GET only. Every control travels in the query string and is forwarded verbatim; nothing is defaulted by the gateway (SerpApi itself defaults engine to google). A client-supplied api_key query param is dropped.

Authentication

AuthorizationBearer

A per-client bearer token issued by the gateway operator. Send it as Authorization: Bearer <token>. The token is validated against a hashed allowlist in Cloudflare KV; a missing or unknown token returns 401. This token is stripped before the request is forwarded upstream, so it never leaves the gateway.

Query parameters

enginestringOptional

Search engine to use. SerpApi defaults this to google when omitted.

qstringOptional
The search query.
locationstringOptional
Geographic location to originate the search from.
outputenumOptional

Response format — json (default) or html for the raw results page.

Allowed values:

Response

The upstream’s response, passed through unchanged (status, headers, and body). Shown here as JSON; the exact shape is defined by the upstream provider.

Errors

404
Not Found Error