> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.auxiliar.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.auxiliar.ai/_mcp/server.

# SerpApi

Proxies [SerpApi](https://serpapi.com)'s search endpoint, injecting the secret `api_key` query parameter.

```
GET /serpapi   → https://serpapi.com/search?api_key=<secret>&<your query>
```

`GET` only — SerpApi documents no `POST` for search. Every control travels in the **query string** and is forwarded verbatim: `engine` (SerpApi defaults it to `google`), `q`, `location`, `output` (`json` default / `html` for the raw page), and so on. The gateway injects and defaults **nothing** beyond the key — your call behaves exactly as if it hit SerpApi directly.

## What the gateway injects and strips

* **`api_key` is injected** as the first query parameter.
* **A client-supplied `api_key` query param is dropped** (in any encoding), so the injected key can't be overridden.
* **The `Authorization` header is stripped** before forwarding — SerpApi has no use for your gateway token.

## Examples

```bash
curl "$GATEWAY/serpapi?engine=google&q=coffee" \
  -H "Authorization: Bearer $TOKEN"
```

```bash
curl "$GATEWAY/serpapi?engine=google&q=coffee&location=Austin,+Texas,+United+States" \
  -H "Authorization: Bearer $TOKEN"
```

```bash
curl "$GATEWAY/serpapi?engine=bing&q=coffee" \
  -H "Authorization: Bearer $TOKEN"
```

The response is SerpApi's JSON (or HTML with `output=html`), returned unchanged. For the full parameter set per engine, see [SerpApi's documentation](https://serpapi.com/search-api).