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

> ## Agent Instructions
> Perceptlayer is a web data API: one key for structured JSON from about 250 websites. Base URL https://api.perceptlayer.com.
> Send the key in the X-API-Key header. GET parameters go in the query string; POST parameters in a JSON body.
> A successful call costs the credits on its endpoint (X-Credits-Used); failed calls cost nothing. Errors are {"error": {"code", "message", "request_id"}}.
> AI agents can use every endpoint through the MCP server at https://api.perceptlayer.com/mcp (tools search_endpoints, get_endpoint, call_endpoint), with Authorization: Bearer <key>.
> Get a free key at https://perceptlayer.com/signup.

# Authentication

> Send your API key in the X-API-Key header.

Every request needs a key. Send it in the `X-API-Key` header:

```bash theme={"dark"}
curl "https://api.perceptlayer.com/v1/airbnb/listing?listing_id=18648717" \
  -H "X-API-Key: $API_KEY"
```

Tools that can't set headers can pass the key as the `api_key` query parameter instead. Prefer the header where you can: URLs end up in logs and browser history.

The MCP server takes the key as `Authorization: Bearer sk_live_...` (or `X-API-Key`). See [AI agents (MCP)](https://docs.perceptlayer.com/ai-agents.md).

## Managing keys

Create, rename, rotate and revoke keys in the [dashboard](https://perceptlayer.com/dashboard/keys).

* Keys start with `sk_live_` and are shown once, when you create or rotate them.
* An account can have up to 10 active keys. All of them share the account's credits and [rate limit](https://docs.perceptlayer.com/rate-limits.md).
* Rotating a key issues a new one and stops the old one at once. Revoking stops it at once.
* You need a verified email to create a key.
* We email a security notice when a key is created, rotated or revoked. You can turn this off in [notifications](https://perceptlayer.com/dashboard/notifications).

> [!WARNING]
>
> Keep keys on your server. Don't put them in browser code or mobile apps, where anyone can read them.

A missing, unknown or revoked key returns `401 invalid_api_key`.


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