---
title: "Get the canonical code of an airport"
method: GET
path: "/airports/{id}/canonical"
tags: ["airports"]
---

# Get the canonical code of an airport

`GET /airports/{id}/canonical`

## Request

- Base URL: `https://aeroapi.flightaware.com/aeroapi`
- URL: `https://aeroapi.flightaware.com/aeroapi/airports/{id}/canonical`
- Auth: API key in header `x-apikey`
- TypeScript: <https://skmtc.dev/flightaware/apis/aeroapi/docs/airports/:id/canonical/get.ts> (a function with typed inputs; its response is checked against the schema)

Returns a list of ICAO airport codes corresponding to the given IATA or LID airport code.
IATA codes can be identical to some LID codes, so if id_type is specified, only 1 ICAO
code will be returned. If no id_type is specified and there are two possible ICAO codes,
both will be returned.

## Path parameters

- `id` string, required

## Query parameters

- `id_type` 'iata' | 'lid' | 'icao'

## Response `200`

OK

- object
  - `airports` object[], required
    - `id` string, required: Canonical airport code. This is the code by which a given airport (and its flights) can be accessed in AeroAPI.
    - `id_type` 'icao' | 'iata' | 'lid', required: Type of airport code given in id

## Other responses

- `400`: Incorrect parameter(s). Id must be a valid airport code and id_type must be 'icao', 'iata', or 'lid'.

---

[API](https://skmtc.dev/flightaware/apis/aeroapi.md) - [All operations](https://skmtc.dev/flightaware/apis/aeroapi/llms.txt) - [OpenAPI document](https://skmtc.dev/flightaware/apis/aeroapi/revisions/3023e7a0c54c?raw)
