Hotel search
import requests
url = "https://api.parallel.ai/v1/hotels/search"
payload = {
"location": "Lisbon",
"check_in_date": "2023-12-25",
"check_out_date": "2023-12-25"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({location: 'Lisbon', check_in_date: '2023-12-25', check_out_date: '2023-12-25'})
};
fetch('https://api.parallel.ai/v1/hotels/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.parallel.ai/v1/hotels/search \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"location": "Lisbon",
"check_in_date": "2023-12-25",
"check_out_date": "2023-12-25"
}
'{
"search_id": "<string>",
"session_id": "session_8a911eb27c7a4afaa20d0d9dc98d07c0",
"results": [
{
"url": "<string>",
"url_kind": "property_website",
"name": "<string>",
"property_type": "hotel",
"currency": "<string>",
"offers": [
{
"currency": "<string>",
"seller": "<string>",
"url": "<string>",
"price_per_night": 123,
"total_price": 123,
"free_cancellation": true
}
],
"address": "<string>",
"latitude": 123,
"longitude": 123,
"hotel_class": 123,
"rating": "fair",
"images": [
"<string>"
],
"price_per_night": 123,
"total_price": 123,
"free_cancellation": true,
"amenities": [
"<string>"
],
"check_in_time": "<string>",
"check_out_time": "<string>"
}
],
"warnings": [
{
"type": "spec_validation_warning",
"message": "<string>",
"detail": {}
}
],
"usage": [
{
"name": "sku_search",
"count": 1
}
]
}{
"type": "error",
"error": {
"ref_id": "search_fcb2b4f3c75e418687bccaa1a8381331",
"message": "The stay cannot be searched in this mode or for this organization"
}
}{
"type": "error",
"error": {
"ref_id": "search_fcb2b4f3c75e418687bccaa1a8381331",
"message": "Request validation error"
}
}Search
Hotel search
Searches hotels and vacation rentals for a stay and links each to its own page.
POST
/
v1
/
hotels
/
search
Hotel search
import requests
url = "https://api.parallel.ai/v1/hotels/search"
payload = {
"location": "Lisbon",
"check_in_date": "2023-12-25",
"check_out_date": "2023-12-25"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({location: 'Lisbon', check_in_date: '2023-12-25', check_out_date: '2023-12-25'})
};
fetch('https://api.parallel.ai/v1/hotels/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.parallel.ai/v1/hotels/search \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"location": "Lisbon",
"check_in_date": "2023-12-25",
"check_out_date": "2023-12-25"
}
'{
"search_id": "<string>",
"session_id": "session_8a911eb27c7a4afaa20d0d9dc98d07c0",
"results": [
{
"url": "<string>",
"url_kind": "property_website",
"name": "<string>",
"property_type": "hotel",
"currency": "<string>",
"offers": [
{
"currency": "<string>",
"seller": "<string>",
"url": "<string>",
"price_per_night": 123,
"total_price": 123,
"free_cancellation": true
}
],
"address": "<string>",
"latitude": 123,
"longitude": 123,
"hotel_class": 123,
"rating": "fair",
"images": [
"<string>"
],
"price_per_night": 123,
"total_price": 123,
"free_cancellation": true,
"amenities": [
"<string>"
],
"check_in_time": "<string>",
"check_out_time": "<string>"
}
],
"warnings": [
{
"type": "spec_validation_warning",
"message": "<string>",
"detail": {}
}
],
"usage": [
{
"name": "sku_search",
"count": 1
}
]
}{
"type": "error",
"error": {
"ref_id": "search_fcb2b4f3c75e418687bccaa1a8381331",
"message": "The stay cannot be searched in this mode or for this organization"
}
}{
"type": "error",
"error": {
"ref_id": "search_fcb2b4f3c75e418687bccaa1a8381331",
"message": "Request validation error"
}
}Body
application/json
Hotel search request: places to stay in a location for a date range.
Response
Successful Response
Hotel search response.