The APIVex Aviation Data API lets you search airports, retrieve airport records, and work with flight status and live aircraft data through JSON endpoints. This guide builds an airport lookup: search by name, choose the correct airport, then retrieve its codes, coordinates, and runways.
Airport names are not unique. A search for “heathrow” returned both a small airport in Texas and London Heathrow. A reliable integration checks the country and airport code before using a result in a flight dashboard.
Start with an airport search
Get your APIVex key from the dashboard. Requests use the x-apivex-key header. Keep this key on your server, rather than embedding it in a public map or browser application.
The base URL is https://api.apivex.com/aviation-data. The name search accepts query, with optional filters including country, type, and scheduled_service_only.
curl --get 'https://api.apivex.com/aviation-data/api/airports/search' \
--header "x-apivex-key: $APIVEX_API_KEY" \
--data-urlencode 'query=heathrow' \
--data-urlencode 'limit=2'Results are in data.airports. These selected fields came from the London result in that response:
{
"name": "London Heathrow Airport",
"country": "GB",
"iata": "LHR",
"icao": "EGLL",
"latitude": 51.470748,
"longitude": -0.459909,
"scheduled_service": true
}This is an excerpt, not the complete response. Some airports have no IATA or ICAO code; do not assume every search result can be displayed as a three-letter airport abbreviation.
Retrieve the airport record and runways
Use the selected code with /api/airports/detail. Code detection is automatic by default; code_type can make the intended code system explicit. Set with_runways=true to include runway data in the same request.
The following Node.js example selects London Heathrow by country and IATA code, then prints the returned airport record. Save it as airport.mjs, set APIVEX_API_KEY in your environment, and run node airport.mjs with Node.js 20 or newer.
const key = process.env.APIVEX_API_KEY;
if (!key) throw new Error('Set APIVEX_API_KEY first');
const base = 'https://api.apivex.com/aviation-data';
// Demonstration pacing; use the request rate allowed by your plan.
const pause = () => new Promise(resolve => setTimeout(resolve, 2500));
async function get(path, params) {
const url = new URL(base + path);
url.search = new URLSearchParams(params).toString();
const response = await fetch(url, {
headers: {'x-apivex-key': key},
signal: AbortSignal.timeout(30000)
});
if (!response.ok) throw new Error('HTTP ' + response.status);
const body = await response.json();
if (body.status !== true) throw new Error(body.message || 'API request failed');
return body.data;
}
const search = await get('/api/airports/search', {query: 'heathrow', limit: 2});
const airport = search.airports.find(a => a.country === 'GB' && a.iata === 'LHR');
if (!airport) throw new Error('London Heathrow was not in this result page');
await pause();
const detail = await get('/api/airports/detail', {code: airport.iata, with_runways: true});
console.log(JSON.stringify(detail, null, 2));The detail response places the airport directly under data. In the returned runway records, length_ft and width_ft are feet, while low and high describe the runway ends. Keep units in your field names when storing this information.
Choose the right endpoint for flight data
An airport reference record does not tell you whether a particular aircraft has landed. The API separates those tasks:
| Task | Route | Identifier |
|---|---|---|
| Airport reference and runways | /api/airports/detail | Airport code |
| Arrivals board | /api/flights/arrivals | Airport code in code |
| Departures board | /api/flights/departures | Airport code in code |
| Status of a flight number | /api/flights/status | flight, with optional date |
| Aircraft near coordinates | /api/live/radius | lat, lon, and radius |
A flight number can recur on different dates. For date-specific reporting, supply the flight date rather than assuming the current or next flight instance is the one your user means. The live-radius endpoint uses nautical miles; do not pass a distance measured in kilometers without converting it.
Handle ambiguous and missing results
Show the airport name, country, municipality, and available codes in an autocomplete picker. Let the user confirm the airport before saving its identifier. If you already know the destination country, use the search country filter to narrow the candidates.
Keep missing codes and coordinates as missing values. A null coordinate is not zero, and an empty result is not proof that a flight was canceled. Treat reference information, flight status, and aircraft observations as separate records with their own retrieval times.
For larger lists, respect each route’s pagination and your plan’s request limits. The example deliberately pauses between requests; choose production scheduling from your actual plan rather than copying that delay as a universal limit.
Open the Aviation Data documentation to try the airport search and review the exact parameters for your next flight-data workflow.



