- Guides
- airport codes API (IATA)
Airport codes API: IATA and ICAO lookup
GET /v1/airports?iata=BGO returns Bergen Airport, Flesland with its ICAO code ENBR, coordinates, elevation and municipality, and country=NO lists all 154 airports we hold for Norway. The data is OurAirports, public domain, 49,343 airports across 239 countries, at 1 credit per request.
Last checked . Service: Airports dataset. Reference: endpoint docs.
IATA, ICAO and local codes
iata is the three-letter code on bag tags, icao the four-letter code pilots use, and gps_code and local_code cover airfields without either. Most rows have no IATA code at all: the dataset includes small airstrips, heliports and seaplane bases, which is why the US alone has 16,811 rows.
For a list of airports with scheduled flights, filter with type=large_airport or type=medium_airport and check scheduled_service, which is 1 for airports with scheduled airline service.
Request
Send your key in the x-api-key header. New accounts get 1,000 free requests after email verification; the quickstart takes about a minute.
curl 'https://api.apifor.dev/v1/airports?iata=BGO' \
-H 'x-api-key: YOUR_API_KEY'import os
import requests
r = requests.get(
"https://api.apifor.dev/v1/airports",
params={
"iata": "BGO",
},
headers={"x-api-key": os.environ["APIFOR_API_KEY"]},
timeout=30,
)
r.raise_for_status()
print(r.json()["data"])const res = await fetch("https://api.apifor.dev/v1/airports?iata=BGO", {
headers: { "x-api-key": process.env.APIFOR_API_KEY },
});
const { data } = await res.json();
console.log(data);Response
The OpenAPI example shows the row shape with a small US airfield. Real Norwegian rows in our snapshot include BGO/ENBR Bergen Airport, Flesland and BOO/ENBO Bodø Airport. The full spec is at api.apifor.dev/v1/openapi.json.
{
"success": true,
"data": [
{
"ident": "00AA",
"icao": null,
"iata": null,
"gps_code": "00AA",
"local_code": "00AA",
"name": "Aero B Ranch Airport",
"type": "small_airport",
"lat": 38.704022,
"lng": -101.473911,
"elevation_ft": 3435,
"continent": "NA",
"country": "US",
"country_name": "United States",
"region": "US-KS",
"region_name": "Kansas",
"municipality": "Leoti",
"scheduled_service": 0,
"home_link": null,
"wikipedia_link": null
}
]
}Search by name or city
q searches airport names, as in GET /v1/airports?q=heathrow. Combine it with country to narrow the list. Each row has municipality, region as an ISO 3166-2 code and region_name, so you can group airports by state or county.
Use lat and lng to put airports on a map or to compute the great-circle distance between two airports with the haversine formula. For a route such as Bergen to Oslo, fetch both rows by IATA code, then compute the distance in your own code; no extra call is needed.
Types and other fields
type is one of large_airport, medium_airport, small_airport, heliport, seaplane_base, balloonport or closed, following the OurAirports data dictionary. OurAirports keeps closed airports with the type closed, so filter on type for anything user-facing.
elevation_ft is the field elevation in feet, continent a two-letter continent code, and home_link and wikipedia_link point to the airport's site and article when OurAirports has them. country_name saves you a second lookup when you print a label such as "Bergen (BGO), Norway".
Search results are paged, 50 rows by default and up to 200 per page with limit. Use page to walk a large country such as the US.
Errors, limits and cost
A missing or wrong key returns 401, bad parameters return 400 with an error.code, and an unknown id returns 404. Rate limits are per key: a limited request gets 429 with a Retry-After header in seconds, so wait that long and retry. Calls that fail before any work starts are refunded. Details are in errors and rate limits.
This request costs 1 credit. Pricing is prepaid: 1,000 free requests once after email verification, then packs from $5 for 5,000 requests to $149 for 400,000. Credits never expire and there is no subscription. See pricing.
From an AI assistant
The same data is available as a tool on the APIFor MCP server at https://mcp.apifor.dev/mcp. Add it as a remote server in any client that supports remote MCP, sign in with OAuth or send your API key as a Bearer token, and ask in plain language. MCP calls use the same key and credits as REST. Setup steps are on the MCP page.
Alternatives
- OurAirports data downloads: The same data as free CSV files, released to the public domain. Download and host it yourself if you want no per-request cost.
Facts about other services come from their own pages or a test call on 1 Dec 2026. Prices and limits change, so confirm them there.
Source and licence
OurAirports (https://ourairports.com), public domain. OurAirports asks for credit but does not require it, and gives no guarantee of accuracy.
Every APIFor response carries the same attribution in meta.attribution. All sources are listed on sources and licences.
FAQ
Is there a free airport codes API?
APIFor gives 1,000 free requests once. OurAirports publishes the data as free CSV files if you would rather host it.
Why do many airports have no IATA code?
IATA codes are assigned mainly to airports with airline service. Small airfields and heliports have ICAO or local codes, or none.
Does it include flight schedules or delays?
No. It is reference data about airports, not flights.