> ## 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

> Base URL, authentication, the response envelope and the conventions every Prefetch endpoint shares.

Each endpoint page in this section lists every parameter and response field, with a playground you can call from the browser. For how an endpoint works, with examples in cURL, Node.js and Python, read its guide in the **Docs** tab.

## Base URL

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

## Authentication

Every endpoint except `/health` and `/ready` needs an `X-API-Key` header:

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

See [Authentication](https://docs.prefetch.io/concepts/authentication.md) for OAuth, bearer tokens and key errors.

## Response envelope

Every response has the same shape:

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

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

```json theme={"theme":"css-variables"}
{
  "success": false,
  "error": "The target URL could not be resolved. Please check the domain name.",
  "error_code": "DNS_RESOLUTION_FAILED",
  "retryable": false,
  "meta": {
    "requestId": "b9e1a2f3-4c5d-6e7f-8a9b-0c1d2e3f4a5b",
    "durationMs": 412
  }
}
```

Branch on `error_code`, not on the wording of `error`, which can change. `retryable` tells you whether the same request can succeed later.

See [Error handling](https://docs.prefetch.io/concepts/errors.md) for every code.

## Conventions

* **Parameters** are snake\_case (`only_main_content`), except on `/brand` and `/enrich`, which take camelCase (`screenshotColors`). Batches and MCP take snake\_case everywhere.
* **GET or POST:** `/scrape`, `/search` and `/transaction` accept the same fields as a query string on `GET` or a JSON body on `POST`. Use `POST` for nested options like `json_schema`, `headers` or `scrape_options`.
* **URLs** can omit the scheme. `stripe.com` means `https://stripe.com`.
* **Request bodies** can be up to 1 MB.
* **Time limits:** most requests finish within 55 seconds, or fail with `TIMEOUT`. Give your HTTP client at least 60.
* **Ids** carry a prefix: `crw_` for crawls and batches, `mon_` for monitors, `chk_` for monitor checks.

## Background jobs

Crawls, batches and monitor checks run in the background. `POST /crawl`, `POST /batch/scrape`, `POST /batch/{endpoint}` and `POST /monitor/{id}/run` return `202` with an id, and you read the results with the matching `GET`, or get them by [webhook](https://docs.prefetch.io/concepts/webhooks.md). See [Async jobs](https://docs.prefetch.io/concepts/async-jobs.md).

## Rate limits

Each plan limits how many requests can run at once, from 1 on Free to 500 on Scale. The Free plan also allows 30 requests a minute. Going over either returns `429`. See [Rate limits](https://docs.prefetch.io/concepts/rate-limits.md).

## Credit costs

| Endpoint | Credits |
| - | - |
| `GET /resolve` | 1. 3 when a live lookup runs (`live=true`). 0 when nothing matches. |
| `GET /transaction` | 3. 1 for a line looked up in the last 7 days. +10 with `include_brand`. |
| `GET /enrich` | 12 |
| `GET /brand` | 10 |
| `GET /styleguide` | 10 |
| `GET /company` | 5 |
| `GET /classify` | 5 |
| `GET /scrape` | 1. +3 when you ask for `summary`, `json` or `check_prompt_injection`. |
| `GET /search` | 2 per 10 results, rounded up. Each result page scraped costs what `/scrape` costs. |
| `GET /map` | 1 |
| `GET /screenshot` | 1 |
| `POST /answers` | 10 in `fast` mode. 100 in `ultra` mode, the REST default. |
| `POST /crawl` | Free to submit. 1 per page returned, or 4 with `summary`, `json` or `check_prompt_injection`. |
| `POST /batch/scrape` | Free to submit. 1 per page returned, or 4 with `summary`, `json` or `check_prompt_injection`. |
| `POST /batch/{endpoint}` | Free to submit. Each URL answered costs what one call of that endpoint costs. |
| Monitor checks | 1 per page fetched, +3 when a `json` extraction runs, +1 per page judged against a goal. A search target costs 2 per search, +1 per new result read. |
| Logo CDN images | No credits. Each plan includes a monthly logo quota. |
| Everything else | Free: job status, errors and cancel calls, managing monitors, `/logo/token`, `/health` and `/ready`. |

You're only charged for successful requests. See [Credits](https://docs.prefetch.io/concepts/credits.md).

## OpenAPI

The full spec is at [`/api-reference/openapi.json`](https://docs.prefetch.io/api-reference/openapi.json). Use it to generate a client in your language.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.