curl --request POST \
--url https://api.anysite.io/api/despegar/hotels/search \
--header 'Content-Type: application/json' \
--header 'access-token: <api-key>' \
--data '
{
"destination": "<string>",
"count": 2,
"timeout": 300,
"region": "AR",
"check_in": "2023-12-25",
"check_out": "2023-12-25",
"adults": 2,
"children_ages": [],
"rooms": 1
}
'import requests
url = "https://api.anysite.io/api/despegar/hotels/search"
payload = {
"destination": "<string>",
"count": 2,
"timeout": 300,
"region": "AR",
"check_in": "2023-12-25",
"check_out": "2023-12-25",
"adults": 2,
"children_ages": [],
"rooms": 1
}
headers = {
"access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
destination: '<string>',
count: 2,
timeout: 300,
region: 'AR',
check_in: '2023-12-25',
check_out: '2023-12-25',
adults: 2,
children_ages: [],
rooms: 1
})
};
fetch('https://api.anysite.io/api/despegar/hotels/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.anysite.io/api/despegar/hotels/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'destination' => '<string>',
'count' => 2,
'timeout' => 300,
'region' => 'AR',
'check_in' => '2023-12-25',
'check_out' => '2023-12-25',
'adults' => 2,
'children_ages' => [
],
'rooms' => 1
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"access-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.anysite.io/api/despegar/hotels/search"
payload := strings.NewReader("{\n \"destination\": \"<string>\",\n \"count\": 2,\n \"timeout\": 300,\n \"region\": \"AR\",\n \"check_in\": \"2023-12-25\",\n \"check_out\": \"2023-12-25\",\n \"adults\": 2,\n \"children_ages\": [],\n \"rooms\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("access-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.anysite.io/api/despegar/hotels/search")
.header("access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"destination\": \"<string>\",\n \"count\": 2,\n \"timeout\": 300,\n \"region\": \"AR\",\n \"check_in\": \"2023-12-25\",\n \"check_out\": \"2023-12-25\",\n \"adults\": 2,\n \"children_ages\": [],\n \"rooms\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.anysite.io/api/despegar/hotels/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"destination\": \"<string>\",\n \"count\": 2,\n \"timeout\": 300,\n \"region\": \"AR\",\n \"check_in\": \"2023-12-25\",\n \"check_out\": \"2023-12-25\",\n \"adults\": 2,\n \"children_ages\": [],\n \"rooms\": 1\n}"
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"@type": "DespegarSearchHotel",
"name": "<string>",
"distance_text": "<string>",
"stars": 123,
"rating": 123,
"price": 123,
"original_price": 123,
"currency": "<string>",
"discount_label": "<string>",
"has_free_cancellation": true,
"is_promoted": true,
"is_flexible": true,
"loyalty_points": 123,
"reference_date": "<string>",
"city_id": "<string>",
"url": "<string>",
"image": "<string>",
"images": [],
"amenities": []
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}/despegar/hotels/search
Search Despegar hotels and accommodations in a city. Returns properties with id, name, distance from the city centre, star rating, guest rating, nightly from-price (and pre-discount price with discount label), currency, free-cancellation flag, loyalty points, amenities, main photo, photo gallery and the hotel detail URL. Pass a destination city id (resolve it via places search) and optionally check-in/check-out dates and room occupancy for dated pricing. Results are the curated ‘from-price’ shelf offers Despegar surfaces for the city (popular/best/by-star/with-breakfast shelves, deduplicated per hotel) — a discovery listing, not an exhaustive filterable availability board; star/price/amenity facets are not accepted as inputs.
Price: 10 credits
⚠️ Common errors: 412: City not found or no hotels available for the given destination
curl --request POST \
--url https://api.anysite.io/api/despegar/hotels/search \
--header 'Content-Type: application/json' \
--header 'access-token: <api-key>' \
--data '
{
"destination": "<string>",
"count": 2,
"timeout": 300,
"region": "AR",
"check_in": "2023-12-25",
"check_out": "2023-12-25",
"adults": 2,
"children_ages": [],
"rooms": 1
}
'import requests
url = "https://api.anysite.io/api/despegar/hotels/search"
payload = {
"destination": "<string>",
"count": 2,
"timeout": 300,
"region": "AR",
"check_in": "2023-12-25",
"check_out": "2023-12-25",
"adults": 2,
"children_ages": [],
"rooms": 1
}
headers = {
"access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
destination: '<string>',
count: 2,
timeout: 300,
region: 'AR',
check_in: '2023-12-25',
check_out: '2023-12-25',
adults: 2,
children_ages: [],
rooms: 1
})
};
fetch('https://api.anysite.io/api/despegar/hotels/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.anysite.io/api/despegar/hotels/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'destination' => '<string>',
'count' => 2,
'timeout' => 300,
'region' => 'AR',
'check_in' => '2023-12-25',
'check_out' => '2023-12-25',
'adults' => 2,
'children_ages' => [
],
'rooms' => 1
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"access-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.anysite.io/api/despegar/hotels/search"
payload := strings.NewReader("{\n \"destination\": \"<string>\",\n \"count\": 2,\n \"timeout\": 300,\n \"region\": \"AR\",\n \"check_in\": \"2023-12-25\",\n \"check_out\": \"2023-12-25\",\n \"adults\": 2,\n \"children_ages\": [],\n \"rooms\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("access-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.anysite.io/api/despegar/hotels/search")
.header("access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"destination\": \"<string>\",\n \"count\": 2,\n \"timeout\": 300,\n \"region\": \"AR\",\n \"check_in\": \"2023-12-25\",\n \"check_out\": \"2023-12-25\",\n \"adults\": 2,\n \"children_ages\": [],\n \"rooms\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.anysite.io/api/despegar/hotels/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"destination\": \"<string>\",\n \"count\": 2,\n \"timeout\": 300,\n \"region\": \"AR\",\n \"check_in\": \"2023-12-25\",\n \"check_out\": \"2023-12-25\",\n \"adults\": 2,\n \"children_ages\": [],\n \"rooms\": 1\n}"
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"@type": "DespegarSearchHotel",
"name": "<string>",
"distance_text": "<string>",
"stars": 123,
"rating": 123,
"price": 123,
"original_price": 123,
"currency": "<string>",
"discount_label": "<string>",
"has_free_cancellation": true,
"is_promoted": true,
"is_flexible": true,
"loyalty_points": 123,
"reference_date": "<string>",
"city_id": "<string>",
"url": "<string>",
"image": "<string>",
"images": [],
"amenities": []
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
API token from the dashboard
Headers
Body
1x >= 120 <= x <= 1500AR, BO, CL, CO, CR, EC, SV, GT, MX, NI, PA, PY, PE, PR, US, UY 1 <= x <= 81 <= x <= 8Response
Successful Response