Aller au contenu

Airports

Ce contenu n’est pas encore disponible dans votre langue.

The Airports resource provides fake airport data with names, codes, IATA codes, coordinates, and timezone information.

MethodEndpointDescription
GET/v1/airportsList all airports
GET/v1/airports/:idGet a specific airport
{
"id": 1,
"cityId": 1,
"name": "John F. Kennedy International Airport",
"code": "KJFK",
"iataCode": "JFK",
"latitude": 40.6413111,
"longitude": -73.7781391,
"timezone": "America/New_York",
"createdAt": "2026-01-15T10:30:00.000Z",
"updatedAt": "2026-01-15T10:30:00.000Z"
}
Field Type Description
id number Unique identifier
cityId number ID of the city
name string Airport name
code string ICAO code (e.g. KJFK)
iataCode string IATA code (e.g. JFK)
latitude number Latitude coordinate
longitude number Longitude coordinate
timezone string Timezone
createdAt string ISO 8601 timestamp
updatedAt string ISO 8601 timestamp
Terminal window
curl https://api.phantomjson.app/v1/airports
Parameter Type Default Description
page number 1 Page number
limit number 20 Items per page (max: 100)
sort string Sort field and direction
q string Search query
fields string Fields to return
cityId number Filter by city ID
iataCode string Filter by IATA code
{
"data": [
{
"id": 1,
"cityId": 1,
"name": "John F. Kennedy International Airport",
"code": "KJFK",
"iataCode": "JFK"
}
],
"meta": {
"total": 50,
"page": 1,
"limit": 20,
"totalPages": 3
}
}
Terminal window
curl https://api.phantomjson.app/v1/airports/1
{
"data": {
"id": 1,
"cityId": 1,
"name": "John F. Kennedy International Airport",
"code": "KJFK",
"iataCode": "JFK",
"latitude": 40.6413111,
"longitude": -73.7781391,
"timezone": "America/New_York"
}
}
Terminal window
curl "https://api.phantomjson.app/v1/airports?q=kennedy"
Terminal window
curl "https://api.phantomjson.app/v1/airports?cityId=1"
Terminal window
curl "https://api.phantomjson.app/v1/airports?iataCode=JFK"
Terminal window
# A-Z
curl "https://api.phantomjson.app/v1/airports?sort=name:asc"
# Z-A
curl "https://api.phantomjson.app/v1/airports?sort=name:desc"
Terminal window
curl "https://api.phantomjson.app/v1/airports?fields=id,name,iataCode,cityId"
  • City — Each airport belongs to a city (cityId)