# API Reference (https://expand.ai/api-reference)

Every Expand API endpoint, with its request, response, and errors.

This reference lists every endpoint, request field, response field, and error. How to use them is in the [docs](https://expand.ai/docs).

## Base URL

```
https://api.expand.ai
```

## Authentication

Send your API key in the `x-expand-api-key` header. The SDKs read it from the `EXPAND_API_KEY` environment variable.

```bash
curl https://api.expand.ai/v1/fetch \
  -H "x-expand-api-key: $EXPAND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com"}'
```

## Endpoints

- [Fetch](https://expand.ai/api-reference/fetch/fetch.fetch): a URL as Markdown text.
- [Fetch JSON Mode](https://expand.ai/api-reference/fetch/fetch.fetchJson): a URL as a JSON object.
- [Snapshot Highlights](https://expand.ai/api-reference/snapshots/snapshots.highlights): the passages of a page that match a query.
- [Start Batched Fetch](https://expand.ai/api-reference/fetch/fetch.batched), [Get Batched Status](https://expand.ai/api-reference/fetch/fetch.getBatched), and [Cancel Batched Fetch](https://expand.ai/api-reference/fetch/fetch.cancelBatched): many URLs in one run.

## Errors

Every error and its payload is on [Errors](https://expand.ai/api-reference/errors). Which to retry, and what you are charged for, is in the [Errors & retries](https://expand.ai/docs/errors-and-retries) guide. Rate and concurrency limits are on [Limits](https://expand.ai/docs/limits).
