Airport codes api autocomplete - variables

Root variables

Name Type Description
status Boolean Determines if result has any valid airports. False means no airports will be in the response.
airports Array An array of all the matching airports.
term String The search term used in the look up.
cached Boolean If the retrieval from the database was cached.
statusCode Integer This will be a number corresponding to the response code type.
message String Will only be provided for error responses. It will display a text message explaining the current error.

Airport object variable

The airports array consists of individual airport objects with many airport variables for each

Name Type Description
name String The name of the airport.
city String The city the airport resides in.
state Object The state the airport resides in. An object with the name, abbreviation and type of the region. Every country varies on what a state/province is called. The type of region is provided for this purpose (eg. State, Province, Municipality, County, District, etc).
country Object The country the airport resides in. An object with the name and iso of the country.
iata String The iata airport code.
children array If the airport is a municipal airport group (eg: New York), this will populate with all of its associated airports, with the following variables: name, city, state, country, iata.

Example response

The response will be in typical json fashion. The following response is from a search request for the term "new yo".

{
    "airports": [
        {
            "name": "Lakefront Airport",
            "city": "New Orleans",
            "iata": "NEW",
            "country": {
                "name": "United States",
                "iso": "US"
            },
            "state": {
                "name": "Louisiana",
                "abbr": "LA"
            }
        },
        {
            "name": "New York City - All Airports",
            "city": "New York City",
            "iata": "NYC",
            "country": {
                "name": "United States",
                "iso": "US"
            },
            "state": {
                "name": "New York",
                "abbr": "NY"
            },
            "children": [
                {
                    "name": "Newark Liberty International Airport",
                    "city": "Newark",
                    "iata": "EWR",
                    "state": {
                        "name": "New Jersey",
                        "abbr": "NJ"
                    }
                },
                {
                    "name": "John F. Kennedy International Airport",
                    "city": "New York City",
                    "iata": "JFK",
                    "state": {
                        "name": "New York",
                        "abbr": "NY"
                    }
                },
                {
                    "name": "La Guardia Airport",
                    "city": "New York City",
                    "iata": "LGA",
                    "state": {
                        "name": "New York",
                        "abbr": "NY"
                    }
                },
                {
                    "name": "Long Island MacArthur Airport",
                    "city": "Ronkonkoma",
                    "iata": "ISP",
                    "state": {
                        "name": "New York",
                        "abbr": "NY"
                    }
                },
                {
                    "name": "Downtown Manhattan Heliport ",
                    "city": "New York City",
                    "iata": "JRB",
                    "state": {
                        "name": "New York",
                        "abbr": "NY"
                    }
                }
            ]
        },
        {
            "name": "New Chitose Airport",
            "city": "Sapporo",
            "iata": "CTS",
            "country": {
                "name": "Japan",
                "iso": "JP"
            },
            "state": {
                "name": "Hokkaidō (北海道)",
                "abbr": null
            }
        },
        {
            "name": "Newport News Williamsburg International Airport",
            "city": "Newport News",
            "iata": "PHF",
            "country": {
                "name": "United States",
                "iso": "US"
            },
            "state": {
                "name": "Virginia",
                "abbr": "VA"
            }
        },
        {
            "name": "Newcastle Airport",
            "city": "Newcastle upon Tyne",
            "iata": "NCL",
            "country": {
                "name": "United Kingdom",
                "iso": "GB"
            },
            "state": {
                "name": "Tyne and Wear",
                "abbr": null
            }
        }
    ],
    "term": "new",
    "limit": 10,
    "size": 0,
    "cached": false,
    "status": true,
    "statusCode": 200
}

An error response will look like this.

{
    "status":false,
    "statusCode":404,
    "message":"No results found for search term.",
    "term":"new oky"
}