# Airports API

> Airport codes to airports, and airports by city.

Every airport in the world with an IATA code, plus every Indian airfield and heliport, from OurAirports. Indian airports carry their state code.

Base URL `https://api.dharun.dev`. No API key. Answers are JSON, `{ "data": ..., "meta": { ... } }`, and errors are `{ "error": { "code", "message" } }` with a matching HTTP status. Rate limit: 600 requests a minute per client.

## Airport for a code

`GET /v1/airports/{code}`

Parameters:

- `code` (path, required): IATA code (MAA) or ICAO code (VOMM).

Example: https://api.dharun.dev/v1/airports/MAA

Response:

```json
{
  "data": {
    "iata": "MAA",
    "icao": "VOMM",
    "ident": "VOMM",
    "name": "Chennai International Airport",
    "type": "large_airport",
    "city": "Chennai",
    "stateCode": "TN",
    "country": "IN",
    "countryName": "India",
    "latitude": 12.990005,
    "longitude": 80.169296,
    "elevationFt": 52,
    "scheduledService": true,
    "wikipedia": "https://en.wikipedia.org/wiki/Chennai_International_Airport"
  },
  "meta": {
    "source": {
      "name": "OurAirports",
      "url": "https://ourairports.com/data/",
      "licence": "Public domain",
      "version": "9509 airports kept",
      "retrieved": "2026-10-13",
      "attribution": "Airport data from OurAirports, released into the public domain."
    }
  }
}
```

## Search airports

`GET /v1/airports`

By name, city or code; airports with scheduled flights and larger airports first.

Parameters:

- `q` (query): Name, city or code, 2 or more characters.
- `country` (query): Two-letter ISO country code, such as IN.
- `state` (query): State code or name, for example TN or Tamil Nadu.
- `type` (query): Kind of airfield. One of: large_airport, medium_airport, small_airport, heliport, seaplane_base.
- `limit` (query): Results per page, 1 to 100.
- `offset` (query): Results to skip.

Example: https://api.dharun.dev/v1/airports?q=chennai

Response, with lists and long text shortened:

```json
{
  "data": [
    {
      "iata": "MAA",
      "icao": "VOMM",
      "ident": "VOMM",
      "name": "Chennai International Airport",
      "type": "large_airport",
      "city": "Chennai",
      "stateCode": "TN",
      "country": "IN",
      "countryName": "India",
      "latitude": 12.990005,
      "longitude": 80.169296,
      "elevationFt": 52,
      "scheduledService": true,
      "wikipedia": "https://en.wikipedia.org/wiki/Chennai_International_Airport"
    },
    {
      "iata": null,
      "icao": null,
      "ident": "VOTX",
      "name": "Tambaram Air Force Station",
      "type": "small_airport",
      "city": "Chennai",
      "stateCode": "TN",
      "country": "IN",
      "countryName": "India",
      "latitude": 12.9072,
      "longitude": 80.121902,
      "elevationFt": 90,
      "scheduledService": false,
      "wikipedia": "https://en.wikipedia.org/wiki/Tambaram_Air_Force_Station"
    },
    {
      "iata": null,
      "icao": null,
      "ident": "IN-0260",
      "name": "Chennai Military Hospital Helipad",
      "type": "heliport",
      "city": "Chennai",
      "stateCode": "TN",
      "country": "IN",
      "countryName": "India",
      "latitude": 13.0196,
      "longitude": 80.1976,
      "elevationFt": 52,
      "scheduledService": false
    }
  ],
  "meta": {
    "total": 4,
    "limit": 20,
    "offset": 0,
    "source": {
      "name": "OurAirports",
      "url": "https://ourairports.com/data/",
      "licence": "Public domain",
      "version": "9509 airports kept",
      "retrieved": "2026-10-13",
      "attribution": "Airport data from OurAirports, released into the public domain."
    }
  }
}
```

## Data source

- [OurAirports](https://ourairports.com/data/), 9509 airports kept, retrieved 2026-10-13. Licence: Public domain. Airport data from OurAirports, released into the public domain.
