> ## Documentation Index
> Fetch the complete documentation index at: https://docs.55-tech.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Scraping API Authentication

> Authenticate Scraping API requests using the X-API-Key header. Rate limits, key formats, and per-key configuration.

All Scraping API endpoints (except `GET /healthz`) require authentication.

## Passing your API key

Pass your API key using one of these methods depending on the endpoint:

**HTTP header (for `/fetch`, `/usage`, `/network/*`, `/debug/pick`):**

```bash theme={null}
curl -H "X-API-Key: YOUR_API_KEY" \
  -H "X-Target-URL: https://example.com" \
  https://scraping-api.55-tech.com/fetch
```

**JSON body field (for `/browser`, `/ws`, and `/amqp`):**

```json theme={null}
{
  "apiKey": "YOUR_API_KEY",
  "url": "https://example.com"
}
```

For `/browser`, `/ws`, and `/amqp`, the key is read from the JSON body field `apiKey` (or `key`), or the `X-API-Key` header.

## Error responses

| Status | Meaning         |
| ------ | --------------- |
| `401`  | Missing API key |
| `403`  | Invalid API key |

## Rate limits

Each API key has a configurable rate limit:

| Setting                   | Default      |
| ------------------------- | ------------ |
| Requests per second (RPS) | 10           |
| Burst capacity            | Equal to RPS |

When rate limited, the API returns `429 Too Many Requests` with these headers:

```
Retry-After: 1
X-RateLimit-Limit: 10
X-RateLimit-Remaining: 0
```

Implement exponential backoff: wait 1s, 2s, 4s, etc.

Check your current rate limit and usage:

```bash theme={null}
curl -H "X-API-Key: YOUR_API_KEY" \
  https://scraping-api.55-tech.com/usage
```

The response includes your remaining tokens:

```json theme={null}
{
  "rate_limit": {
    "rps": 10.0,
    "burst": 10,
    "remaining": 9.3
  }
}
```

## Public endpoints

These endpoints do **not** require authentication:

| Endpoint       | Description                     |
| -------------- | ------------------------------- |
| `GET /`        | API overview and status         |
| `GET /healthz` | Liveness probe (`{"ok": true}`) |

## Obtaining a key

Contact [contact@55-tech.com](mailto:contact@55-tech.com) to obtain an API key with a rate limit configured for your use case.
