Despegar Location Search
Resolve a city, airport or hotel name, or a Despegar results URL, to a destination id. A results URL is reduced to the place id in the path, such as CIT_982. A detail URL that only contains a hotel number returns 400. return_page_source is not supported and returns 400.
Credit cost: 1 credit per call
ApiKeyAuthx-api-key<token>Your API key. Include it in the x-api-key header for every request.
query*stringRequired. Place name, or a Despegar results URL. The value sent is the name or the page URL, not an API URL. A results URL is reduced to the place id in the path. A detail URL with only a hotel number returns 400.
Buenos Aireshttps://www.despegar.com.ar/accommodations/results/CIT_982/2026-12-15/2026-12-18/2language?stringOptional. Default es-AR. Aliases: es, en, pt, ar. Unknown code returns 400.
es-ARcountry?stringOptional. Two-letter site code. The value sent is the code, for example ar. It does not change the proxy. It selects the site and sends the x-locale header. If language is set, language wins for the locale. A full URL in query is left unchanged. Any other code returns 400.
armxar despegar.com.ar, mx despegar.com.mx, co despegar.com.co, cl despegar.cl, pe despegar.com.pe, uy despegar.com.uy, br decolar.com, us despegar.com.
fields?stringComma-separated list of response fields to return, with dot notation for nested fields (e.g. name,location.city).
is_async?booleanRun the request as a background job: the API answers 202 with a job_id to poll on GET /v1/jobs/{id}.
falsesoft_fail?booleanReturn HTTP 200 even when the request fails; the error is in the error field of the body.
falseSuccessful response
application/json- response
results?array<>curl -X GET 'https://api.piloterr.com/v2/despegar/location/search?query=string'{ "results": [ { "iata": "BUE", "label": "Buenos Aires, Ciudad de Buenos Aires, Argentina", "country": "Argentina", "dest_id": "CIT_982", "latitude": -34.60546, "dest_type": "city", "longitude": -58.38199 } ]}