# Despegar Location Search ## Overview | Property | Value | |----------|-------| | **Status** | active | | **Method** | `GET` | | **Endpoint** | `/v2/despegar/location/search` | | **Base URL** | `https://api.piloterr.com` | | **Credit Cost** | 1 credit per call | | **Documentation** | https://www.piloterr.com/library/despegar-location-search | ## Description 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. ## Authentication - **Key Name:** `x-api-key` - **Location:** HTTP Header - **Get an API key:** https://app.piloterr.com/register ## Example Request ```bash curl --location --request GET 'https://api.piloterr.com/v2/despegar/location/search' \ --header 'Content-Type: application/json' \ --header 'x-api-key: YOUR_API_KEY' ``` ## Example Response ### Example ```json { "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 } ] } ``` ## Documentation ## Overview Search Despegar Argentina for places, hotels and flights. ## Quickstart Copy one URL at a time. ``` https://api.piloterr.com/v2/despegar/location/search?query=Buenos%20Aires ``` ``` https://api.piloterr.com/v2/despegar/search?destination=Buenos%20Aires&check_in=2026-12-15&check_out=2026-12-18&adults=2 ``` ``` https://api.piloterr.com/v2/despegar/ad?url=https://www.despegar.com.ar/accommodations/detail/242503/2026-12-15/2026-12-18/2 ``` ``` https://api.piloterr.com/v2/despegar/flight/search?query=BUE-MAD ``` Hotel dates are required and must be today or later. Flight dates are optional: without them the route page returns published fares.