Search for destinations or hotels
curl --request GET \
--url https://sandbox.travel.selfbook.com/rest/v1/destinations/search \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://sandbox.travel.selfbook.com/rest/v1/destinations/search"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://sandbox.travel.selfbook.com/rest/v1/destinations/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://sandbox.travel.selfbook.com/rest/v1/destinations/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sandbox.travel.selfbook.com/rest/v1/destinations/search"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sandbox.travel.selfbook.com/rest/v1/destinations/search")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.travel.selfbook.com/rest/v1/destinations/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"results": [
{
"objectID": "united-states:new-york:new-york-city",
"type": "destination",
"name": "New York City, New York, United States",
"city": "New York City",
"state": "New York",
"country": "United States",
"country_code": "US",
"hotels_count": 44,
"hotels": [
"YX_95353",
"MO_55033",
"PH_91096"
]
}
]
}{
"code": 2001,
"details": [
{
"message": "check_out_date is missing",
"field": [
"check_out_date"
]
}
],
"message": "Unable to process your request. Missing or invalid request parameters.",
"type": "VALIDATION"
}Destinations
Destinations Search
Returns a list of geographic destinations and/or specific hotel properties based on a search query.
Objects in the results array may be a Destination (geographic area) or a Hotel (specific property),
distinguished by their type field.
GET
/
rest
/
v1
/
destinations
/
search
Search for destinations or hotels
curl --request GET \
--url https://sandbox.travel.selfbook.com/rest/v1/destinations/search \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://sandbox.travel.selfbook.com/rest/v1/destinations/search"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://sandbox.travel.selfbook.com/rest/v1/destinations/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://sandbox.travel.selfbook.com/rest/v1/destinations/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sandbox.travel.selfbook.com/rest/v1/destinations/search"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sandbox.travel.selfbook.com/rest/v1/destinations/search")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.travel.selfbook.com/rest/v1/destinations/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"results": [
{
"objectID": "united-states:new-york:new-york-city",
"type": "destination",
"name": "New York City, New York, United States",
"city": "New York City",
"state": "New York",
"country": "United States",
"country_code": "US",
"hotels_count": 44,
"hotels": [
"YX_95353",
"MO_55033",
"PH_91096"
]
}
]
}{
"code": 2001,
"details": [
{
"message": "check_out_date is missing",
"field": [
"check_out_date"
]
}
],
"message": "Unable to process your request. Missing or invalid request parameters.",
"type": "VALIDATION"
}Authorizations
Basic authentication where:
- user-id is a partner account ID
- user-password is an API key token associated with the partner account
Query Parameters
The search term. An empty string triggers a wildcard search.
Filters results by a specific category (e.g., Beach, Spotlights).
Limits the result types returned.
Available options:
destinations, hotels Response
A successful search response
A geographic location result (country, state, or city).
- Option 1
- Option 2
Show child attributes
Show child attributes
⌘I