Piloterr

Despegar Location Search

GET
/v2/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

Authentification

ApiKeyAuth
headerx-api-key<token>

Your API key. Include it in the x-api-key header for every request.

Paramètres de requête

query*string

Required. 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 Aires
https://www.despegar.com.ar/accommodations/results/CIT_982/2026-12-15/2026-12-18/2
language?string

Optional. Default es-AR. Aliases: es, en, pt, ar. Unknown code returns 400.

es-AR
country?string

Optional. 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.

ar
mx

ar 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?string

Comma-separated list of response fields to return, with dot notation for nested fields (e.g. name,location.city).

is_async?boolean

Run the request as a background job: the API answers 202 with a job_id to poll on GET /v1/jobs/{id}.

Defaultfalse
soft_fail?boolean

Return HTTP 200 even when the request fails; the error is in the error field of the body.

Defaultfalse

Corps de la réponse

Successful response

application/json
  1. response
results?array<>
Example Request
curl -X GET 'https://api.piloterr.com/v2/despegar/location/search?query=string'
Example Response
{  "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    }  ]}