Piloterr

Despegar Hotel Search

GET
/v2/despegar/search

Search Despegar hotels by city name or by an accommodations URL. Dates are optional. If both are omitted, the stay is 3 nights starting 21 days from today. One date without the other, or a past date, returns 400. One call is one page of up to 21 hotels.

Credit cost: 2 credits 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. City name, or a Despegar accommodations URL. The value sent is the city or the page URL, not an API URL.

Buenos Aires
https://www.despegar.com.ar/accommodations/results/CIT_982/2026-12-15/2026-12-18/2
check_in?string

Optional. YYYY-MM-DD, today or later. Send it only together with check_out.

2026-12-15
check_out?string

Optional. Must be after check_in when both are set.

2026-12-18
adults?number

Optional. Default 2. Must be at least 1.

Default"2"
children?number

Optional. Default 0.

Default"0"
children_ages?string

Optional. Comma-separated ages, one per child. If children is set and this is empty, each child is 8.

8,11
stars?string

Optional. Keep hotels whose star count is exactly this value: 1, 2, 3, 4 or 5. Empty keeps every hotel on the page.

currency?string

Optional. Three letters, for example ARS. Used only when the card does not show a currency. It is not added to the URL. Prices on despegar.com.ar are usually ARS.

sort_by?string

Optional. price, review_score, or rating. Empty keeps the page order. Other values are ignored.

max_results?number

Optional. Keep only the first N hotels of this page. Empty returns the full page, up to 21. There is no default of 20.

page?number

Optional. Page number. Despegar returns up to 21 hotels per page. Default 1.

Default"1"
language?string

Optional. Default es-AR. Aliases: es, en, pt, ar. Unknown code returns 400. If set, it wins over the locale implied by country.

es-AR
en-US
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.

return_page_source?boolean

Optional. Default false. true returns {"result": html} instead of JSON. A Chrome, Brave, or Internet Explorer proxy error is still HTTP 500, and that error page is not returned.

false
Defaultfalse
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
[index: integer]?
Example Request
curl -X GET 'https://api.piloterr.com/v2/despegar/search?query=string'
Example Response
[  {    "id": "hotel-bsas-22741",    "url": "https://www.despegar.com/hoteles/argentina/buenos-aires/alvear-palace-hotel/hotel/22741?adults=2&rooms=1&checkin=2026-08-10&checkout=2026-08-15",    "name": "Alvear Palace Hotel",    "stars": 5,    "taxes": 110520,    "rating": 9.3,    "address": {      "city": "Buenos Aires",      "full": "Av. Alvear 1891, Recoleta, Buenos Aires, Argentina",      "country": "Argentina",      "neighborhood": "Recoleta"    },    "currency": "ARS",    "location": {      "lat": -34.5874,      "lng": -58.3932,      "distance_to_center": "2.1 km del centro"    },    "amenities": [      "Wi-Fi gratis",      "Restaurante",      "Spa",      "Gimnasio",      "Piscina cubierta",      "Concierge 24h"    ],    "thumbnail": "https://photos.despegar.com/hotels/22741/main.jpg",    "total_price": 921000,    "rating_label": "Excelente",    "reviews_count": 1874,    "price_per_night": 184200,    "free_cancellation": false,    "breakfast_included": true  }]