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

# ScrapingBee

Fronts the HTML API of [ScrapingBee](https://www.scrapingbee.com); the gateway fills in the secret `api_key` parameter on the query string:

```
GET|POST /scrapingbee   → https://app.scrapingbee.com/api/v1/?api_key=<secret>&<your query>
```

* A `GET` fetches the target URL.
* A `POST` is passed on to the target as a POST.

Everything is driven by the **query string**: the target `url` plus any ScrapingBee parameter (`premium_proxy`, `render_js`, `country_code`, `extract_rules`, …). What you put there reaches ScrapingBee exactly as written.

## Credential handling

Three auth channels exist on ScrapingBee's side; the gateway fills one channel and closes the remaining two:

* **`api_key` goes in ahead of everything you send**, so it can't be swallowed by a target URL with incomplete encoding.
* **An `api_key` supplied by the client in the query is discarded** (any encoding).
* **`Authorization` is removed** — it doubles as an auth channel on ScrapingBee's side, and it carries your gateway token.
* **The header form of the key, `X-API-KEY`, is discarded.**

## Examples

#### Basic scrape

```bash
curl "$GATEWAY/scrapingbee?url=https://example.com" \
  -H "Authorization: Bearer $TOKEN"
```

#### Render JS + premium proxy

```bash
curl "$GATEWAY/scrapingbee?url=https://example.com&render_js=true&premium_proxy=true" \
  -H "Authorization: Bearer $TOKEN"
```

ScrapingBee's response comes back untouched. Every supported parameter is listed in [ScrapingBee's documentation](https://www.scrapingbee.com/documentation/).