Search locations
A hotel search takes a location id, not a name. This call turns a city, neighbourhood, landmark, airport, or property name into that id.
Send X-API-Key the same way as on every other call. query is required. country and locale default to US and en.
Which id to send
Use locations[].locationId as location on Search hotels. 29230 is London. A neighbourhood and an airport in the same city have their own ids.
A row with locationType: hotel is a specific property. Its locationId is still the city, so a search for that id returns the city. Its hotelId is what Hotel reviews takes, and it matches id on a result from that city.
A query that matches nothing returns 200 with an empty locations list. A missing query, a blank query, a bad locale, or an unsupported country returns 400. If the lookup itself fails, the response is 502 LOCATIONS_UNAVAILABLE.
Parameters
Query parameters.
City, neighbourhood, landmark, airport, or property name. 1 to 80 characters. A blank value is rejected.
ISO 3166-1 alpha-2 market. Omit it for US. Any other value is rejected. Same set as on a hotel search.
Possible values59
USGBDEFRESITNLBEATCHIEPTGRPLCZROSENODKFITRAESAILINJPKRHKTWSGMYTHIDPHVNAUNZCAMXBRARCLCOPEUYPYBOECVECRPAGTHNNISVDOPRZAUA2-letter language code. Omit it for en. Anything that is not two letters is rejected.
Returns
A successful response, captured live.
{
"query": "London",
"locations": [
{
"locationId": "29230",
"name": "London, England, United Kingdom",
"city": "London",
"region": "England",
"country": "United Kingdom",
"countryCode": "GB",
"locationType": "city",
"lat": 51.49916450106749,
"lng": -0.12525865742190945
},
{
"locationId": "174457",
"name": "Heathrow, London, England, United Kingdom, (LHR)",
"city": "London",
"region": "England",
"country": "United Kingdom",
"countryCode": "GB",
"locationType": "airport",
"lat": 51.47115,
"lng": -0.4564899999999999
},
{
"locationId": "62830",
"name": "London, Ontario, Canada",
"city": "London",
"region": "Ontario",
"country": "Canada",
"countryCode": "CA",
"locationType": "city",
"lat": 42.98339,
"lng": -81.23304
}
]
}