Location Information

get

Location Information

This service retrieves the location information corresponding to a IATA city or airport code.

When provided with an IATA code, the service determines whether this code could relate to a city code, an airport code or both. If the city could contain multiple airports, it will return all possible airports that correspond to that city code.

This API is based on the Amadeus supported Geobases open-source project. If you wish to make your own database with all IATA location information, in order to get faster reponses, you can download the latest raw data from their github page.

Resource URL

https://api.sandbox.amadeus.com/v1.2 /location/{code}

Query Parameters


Name Values Description
apikey
(required)

API Key provided for your account, to identify you for API access. Make sure to keep this API key secret.


Request Body

code IATA location code for which further information is required BOS true

Make a request and see the response.

Make a request and see the response.

Make a request and see the response.

Working...

 

Response format - Location Information

The response is returned in JSON with the following elements:

Element Meaning Multiplicity
Root object
city A city object with information for any IATA code city which corresponds to the provided code 0..1
airports An airport object with information for any IATA airport city which corresponds to the provided code 0..n
City object
code The IATA code of this city. If you intend to make a flight search from the output of this call, I recommend using this as your input parameter as it generally gives the best results. 1
geonames_ID The ID of this city in the open-sourced 1
name The name of this city, in English 1
state The state code of this city, if applicable 0..1
country The ISO 3166-1 alpha-2 country code in which this city can be found. 1
location This city's approximate geolocation as a location object. The exact center of a city is often not an exact location, so be aware that this might not be exact. 1
timezone The Olson format name of the timezone in which this airport is located 1
currency The ISO-4217 currency code of the official local currency at this location 0..1
Airport object
code The 3 letter IATA airport code of this given airport. You can use this as an input parameter for a low-fare flight search, to get more specific results than the city code, but inspiration search works best using the city code. 1
name The name of this airport, in UTF-8 format 1
city_code The three letter IATA city code of the city in which this airport is located. 1
city_name The English name of the city in which this airport is located 1
state The state code of this city, if applicable 0..1
country The ISO 3166-1 alpha-2 country code in which this city can be found. 1
location An object containing the longitude and latitude of the given airport 1
aircraft_movements The annual number of aircraft movements at that airport. 1
timezone The Olson format name of the timezone in which this airport is located 1
Location object
latitude The north-south coordinate of this location, in decimal degrees, between -90 and 90 1
longitude The east-west coordinate of this location, in decimal degrees, between -180 and 180 1
 

Example

Request

Retrieving information about the city code PAR:

http://api.sandbox.amadeus.com/v1.2/location/PAR/?apikey=<your API key>

Response

		
{
    "city": {
        "code": "PAR", 
        "geonames_ID": 2988507, 
        "name": "Paris", 
        "state": "", 
        "country": "FR", 
        "location": {
            "latitude": 48.85341, 
            "longitude": 2.3488
        }, 
        "timezone": "Europe/Paris"
    }, 
    "airports": [
        {
            "code": "BVA", 
            "name": "Beauvais-Till\u00e9", 
            "city_code": "PAR", 
            "city_name": "Paris", 
            "state": "", 
            "country": "FR", 
            "location": {
                "latitude": 49.454444, 
                "longitude": 2.112778
            }, 
            "aircraft_movements": 1287, 
            "timezone": "Europe/Paris"
        }, 
        {
            "code": "CDG", 
            "name": "Paris - Charles-de-Gaulle", 
            "city_code": "PAR", 
            "city_name": "Paris", 
            "state": "", 
            "country": "FR", 
            "location": {
                "latitude": 49.012779, 
                "longitude": 2.55
            }, 
            "aircraft_movements": 211834, 
            "timezone": "Europe/Paris"
        }, 
        {
            "code": "ORY", 
            "name": "Paris-Orly", 
            "city_code": "PAR", 
            "city_name": "Paris", 
            "state": "", 
            "country": "FR", 
            "location": {
                "latitude": 48.725278, 
                "longitude": 2.359444
            }, 
            "aircraft_movements": 96394, 
            "timezone": "Europe/Paris"
        }
    ]
}	
	
	

Errors

Some IATA codes do not correspond to a location. In this case, you will receive an info response. For example

http://api.sandbox.amadeus.com/v1.2/location/WTF/?apikey=<YOUR API KEY>

will return:

{
    "Info": "No data available for location code WTF"
}