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

# API Reference

> REST API reference for Prefetch. All endpoints accept GET requests and return JSON.

## Base URL

```
https://api.prefetch.io
```

## Authentication

All endpoints (except `/health` and `/ready`) require an `X-API-Key` header.

```bash theme={null}
curl https://api.prefetch.io/classify?url=https://example.com \
  -H "X-API-Key: your_api_key"
```

See [Authentication](/concepts/authentication) for full details including first-party origin injection.

## Response format

Every response uses a consistent envelope:

```json theme={null}
{
  "success": true,
  "data": { },
  "meta": {
    "requestId": "uuid-v4",
    "durationMs": 1234
  }
}
```

On error, `success` is `false` and `data` is replaced by `error`:

```json theme={null}
{
  "success": false,
  "error": "Credit limit exceeded",
  "meta": {
    "requestId": "uuid-v4",
    "durationMs": 8
  }
}
```

## Credit costs

| Endpoint          | Credits |
| ----------------- | ------- |
| `GET /enrich`     | 20      |
| `GET /brand`      | 10      |
| `GET /company`    | 5       |
| `GET /classify`   | 5       |
| `GET /screenshot` | 2       |
| `GET /health`     | —       |
| `GET /ready`      | —       |

Credits are deducted only on successful responses. See [Credits](/concepts/credits).

## Rate limits

* **Global:** 300 requests per minute per IP
* **Per key:** Configurable sliding window (1-minute) set on your API key

Exceeding either limit returns HTTP 429. See [Rate limits](/concepts/rate-limits).

## Endpoints

<CardGroup cols={2}>
  <Card title="GET /enrich" icon="layer-group" href="/api-reference/endpoint/enrich">
    Brand + company + classification in one call. **20 credits.**
  </Card>

  <Card title="GET /brand" icon="palette" href="/api-reference/endpoint/brand">
    Colors, logos, fonts, and social links. **10 credits.**
  </Card>

  <Card title="GET /company" icon="building" href="/api-reference/endpoint/company">
    Company name, emails, and addresses. **5 credits.**
  </Card>

  <Card title="GET /classify" icon="tags" href="/api-reference/endpoint/classify">
    IAB category, descriptions, tickers, and ISINs. **5 credits.**
  </Card>

  <Card title="GET /screenshot" icon="camera" href="/api-reference/endpoint/screenshot">
    Webpage screenshot URL. **2 credits.**
  </Card>

  <Card title="GET /health" icon="heart-pulse" href="/api-reference/endpoint/health">
    Liveness probe. **Free.**
  </Card>
</CardGroup>
