# Airport Distance API

> Airport Distance calculates the great-circle distance between two airports, plus estimated travel time, using their 3-letter IATA codes. It provides route distance in miles and kilometers plus estimated flight duration.

**Endpoint:** `GET https://api.apiverve.com/v1/airportdistance`  
**Category:** Transportation  
**Cost:** 2 credits per call  
**Canonical page:** https://apiverve.com/marketplace/airportdistance

## Overview

Supply two airport IATA codes to calculate the great-circle route distance in statute miles and kilometers together with estimated flight duration. Paid plans can query by four-letter ICAO codes and receive extra flight parameters, including nautical miles, initial compass bearing, timezone differences, passenger carbon estimates, and airport coordinates.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl "https://api.apiverve.com/v1/airportdistance?iata1=JFK&iata2=LAX" \
  -H "x-api-key: YOUR_API_KEY"
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `iata1` | string | Yes | The IATA code of the first airport (e.g. JFK); a city code such as NYC uses that city's primary airport |
| `iata2` | string | Yes | The IATA code of the second airport (e.g. LAX); a city code such as LON uses that city's primary airport |

## Response fields

- `distanceMiles` — number · Distance in statute miles
- `distanceKm` — number · Great-circle distance between the two airports in kilometres
- `distanceNauticalMiles` — number · Distance in nautical miles (aviation standard) · (premium)
- `estimatedFlightTime` — string · Estimated flight duration (e.g., 5h 24m)
- `timezoneDiffHours` — number · Timezone difference in hours between airports · (premium)
- `bearing` — number · Compass bearing from airport1 to airport2 (0-360 degrees) · (premium)
- `direction` — string · Compass direction (e.g., North, Southwest, East) · (premium)
- `isInternational` — boolean · Whether the flight crosses international borders · (premium)
- `carbonEstimateKg` — number · Estimated CO2 emissions in kg per passenger (based on ICAO methodology) · (premium)
- `airport1` — object · Details about the first airport · (premium)
  - `airport1.name` — string · Full name of the origin airport · (premium)
  - `airport1.iata` — string · Three-letter IATA code of the origin airport · (premium)
  - `airport1.icao` — string · Four-letter ICAO code of the origin airport · (premium)
  - `airport1.city` — string · City the origin airport serves · (premium)
  - `airport1.state` — string · State or region of the origin airport · (premium)
  - `airport1.country` — string · Country code of the origin airport · (premium)
  - `airport1.elevation` — number · Airport elevation in feet · (premium)
  - `airport1.latitude` — number · Airport latitude · (premium)
  - `airport1.longitude` — number · Airport longitude · (premium)
  - `airport1.timezone` — string · Airport timezone (e.g., America/New_York) · (premium)
- `airport2` — object · Details about the second airport · (premium)
  - `airport2.name` — string · Full name of the destination airport · (premium)
  - `airport2.iata` — string · Three-letter IATA code of the destination airport · (premium)
  - `airport2.icao` — string · Four-letter ICAO code of the destination airport · (premium)
  - `airport2.city` — string · City the destination airport serves · (premium)
  - `airport2.state` — string · State or region of the destination airport · (premium)
  - `airport2.country` — string · Country code of the destination airport · (premium)
  - `airport2.elevation` — number · Airport elevation in feet · (premium)
  - `airport2.latitude` — number · Airport latitude · (premium)
  - `airport2.longitude` — number · Airport longitude · (premium)
  - `airport2.timezone` — string · Airport timezone (e.g., America/Los_Angeles) · (premium)

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "distanceMiles": 2470.23,
    "distanceKm": 3974.2,
    "distanceNauticalMiles": 2145.12,
    "estimatedFlightTime": "5h 24m",
    "timezoneDiffHours": -3,
    "bearing": 265,
    "direction": "West",
    "isInternational": false,
    "carbonEstimateKg": 543,
    "airport1": {
      "name": "John F Kennedy International Airport",
      "iata": "JFK",
      "icao": "KJFK",
      "city": "New York",
      "state": "New-York",
      "country": "US",
      "elevation": 13,
      "latitude": 40.63980103,
      "longitude": -73.77890015,
      "timezone": "America/New_York"
    },
    "airport2": {
      "name": "Los Angeles International Airport",
      "iata": "LAX",
      "icao": "KLAX",
      "city": "Los Angeles",
      "state": "California",
      "country": "US",
      "elevation": 125,
      "latitude": 33.94250107,
      "longitude": -118.4079971,
      "timezone": "America/Los_Angeles"
    }
  }
}
```

## Use cases

- **Flight Booking Summary** — Travel booking platforms display flight distances and transit durations directly on ticket search results to give travelers accurate itinerary details.
- **Loyalty Points Calculation** — To award frequent flyer status, loyalty management software measures flight mileage between departure and destination hubs for every passenger ticket.
- **Corporate Emissions Tracking** — When logging business trips, corporate expense platforms look up route distances to audit travel policies and calculate flight carbon budgets.
- **Air Freight Planning** — Estimate transit times and route mileage between airfield pairs before scheduling chartered cargo flights or aircraft repositioning legs.

## SDKs

- **npm** — `npm install @apiverve/airportdistance` (https://www.npmjs.com/package/@apiverve/airportdistance)
- **PyPI** — `pip install apiverve-airportdistance` (https://pypi.org/project/apiverve-airportdistance/)
- **NuGet** — `dotnet add package APIVerve.API.AirportDistance` (https://www.nuget.org/packages/APIVerve.API.AirportDistance)
- **Source** — https://github.com/apiverve/airportdistance-api

## More

- Full reference: https://docs.apiverve.com/ref/airportdistance
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
