# REST API

JSON over HTTPS, authenticated with an API key from an Enterprise subscription.

> **Tip:** Building with an AI agent? Use the [MCP server](https://airportloungelist.com/docs/mcp.md) instead. It needs no key and has the same data. The REST API is for your own backend or app.

## Base URL

```text
https://airportloungelist.com/api/v1
```

All endpoints are `GET` requests that return JSON, except `POST /feedback`. The [endpoint reference](https://airportloungelist.com/docs/api/reference.md) lists them all.

## Authentication

Send your API key in the `X-API-Key` header on every request. Keys come with the [Enterprise plan](https://airportloungelist.com/docs/plans.md) and are shown on your subscription page after checkout. Keep the key on your server and out of client-side code.

```bash
curl -H "X-API-Key: $LOUNGE_API_KEY" https://airportloungelist.com/api/v1/networks
```

A key stops working when its subscription is no longer active.

## OpenAPI spec

The API is described by an OpenAPI document at [https://airportloungelist.com/openapi.json](https://airportloungelist.com/openapi.json) (OpenAPI 3.1.0). Import it into Postman, Insomnia or a code generator. The [endpoint reference](https://airportloungelist.com/docs/api/reference.md) is generated from the same file.

## Example: lounges near a location

**curl**

```curl
curl -H "X-API-Key: $LOUNGE_API_KEY" \
  "https://airportloungelist.com/api/v1/lounges/nearby?lat=51.47&lon=-0.4543&radius=30"
```

**JavaScript**

```JavaScript
const params = new URLSearchParams({ lat: "51.47", lon: "-0.4543", radius: "30" });
const response = await fetch(`https://airportloungelist.com/api/v1/lounges/nearby?${params}`, {
  headers: { "X-API-Key": process.env.LOUNGE_API_KEY },
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const { lounges } = await response.json();
for (const lounge of lounges) console.log(lounge.name, lounge.distance_mi);
```

**Python**

```Python
import os
import requests

response = requests.get(
    "https://airportloungelist.com/api/v1/lounges/nearby",
    params={"lat": 51.47, "lon": -0.4543, "radius": 30},
    headers={"X-API-Key": os.environ["LOUNGE_API_KEY"]},
    timeout=10,
)
response.raise_for_status()
for lounge in response.json()["lounges"]:
    print(lounge["name"], lounge["distance_mi"])
```

`radius` is in miles, from 1 to 300 (default 60). Each lounge in the response carries a `distance_mi` field. If nothing is found within the radius, the API widens the search to the nearest airports with lounges.

## Responses

- Responses are JSON. Successful reads return `200`; `POST /feedback` returns `201`.
- Responses are sent with `Cache-Control: private, no-store` and `X-Robots-Tag: noindex, nofollow`, so cache on your side if you need to.
- List endpoints that paginate use a `page` query parameter and return 50 items per page, with `page` and `per_page` in the response.

## Errors

Errors return a JSON body with an `error` message.

| Status | Body | Meaning |
| --- | --- | --- |
| `400` | `{"error":"Query parameter 'q' is required"}` | A required parameter is missing. |
| `401` | `{"error":"Unauthorized"}` | The `X-API-Key` is not valid, or its subscription is not active. |
| `403` | `{"error":"Forbidden"}` | The `X-API-Key` header is missing. |
| `404` | `{"error":"Lounge not found"}` | No record matches the slug, code or username. |
| `422` | `{"error":"Invalid coordinates"}` | `lat` or `lon` is out of range, or both are 0. `POST /feedback` also returns it for an invalid body. |
| `429` | `{"error":"Rate limit exceeded. Try again later."}` | A rate limit was hit. Wait for the number of seconds in the `Retry-After` header. |

`GET https://airportloungelist.com/api/v1` itself, with no key, answers `402` with a payment challenge that links to the OpenAPI spec and the [pricing page](https://airportloungelist.com/commercial_subscriptions/pricing.md). No other endpoint returns `402`.

## Rate limits

API limits are counted per client IP address, whatever your plan:

| Limit | Applies to | Rule |
| --- | --- | --- |
| REST API requests | any /api/ path, per IP address | 30 per minute |
| REST API search and nearby | paths containing nearby or search, per IP address | 10 per minute |
| REST API burst | any /api/ path, per IP address | 100 per 5 minutes |
| REST API daily | any /api/ path, per IP address | 500 per day |

Exceeding a limit returns `429` with a `Retry-After` header. If you need higher limits, see [plans and limits](https://airportloungelist.com/docs/plans.md).

---
Source: https://airportloungelist.com/docs/api
