# Fixed reference example. Playground inputs do not update this sample.
curl --request POST \
--url https://api.aisa.one/apis/v1/dataforseo/business_data/google/hotel_searches/task_post \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '[
{
"language_code": "en",
"location_name": "New York,New York,United States",
"keyword": "cheap hotel",
"check_in": "2023-06-01",
"check_out": "2023-06-30",
"currency": "USD",
"adults": 2,
"children": [
"14"
],
"sort_by": "highest_rating",
"priority": 2,
"tag": "example"
}
]'curl --request POST \
--url https://api.aisa.one/apis/v1/dataforseo/business_data/google/hotel_searches/task_post \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"adults": 2,
"check_in": "2023-06-01",
"check_out": "2023-06-30",
"children": [
"14"
],
"currency": "USD",
"keyword": "cheap hotel",
"language_code": "en",
"location_name": "New York,New York,United States",
"priority": 2,
"sort_by": "highest_rating",
"tag": "example"
}
]
'import requests
url = "https://api.aisa.one/apis/v1/dataforseo/business_data/google/hotel_searches/task_post"
payload = [
{
"adults": 2,
"check_in": "2023-06-01",
"check_out": "2023-06-30",
"children": ["14"],
"currency": "USD",
"keyword": "cheap hotel",
"language_code": "en",
"location_name": "New York,New York,United States",
"priority": 2,
"sort_by": "highest_rating",
"tag": "example"
}
]
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
adults: 2,
check_in: '2023-06-01',
check_out: '2023-06-30',
children: ['14'],
currency: 'USD',
keyword: 'cheap hotel',
language_code: 'en',
location_name: 'New York,New York,United States',
priority: 2,
sort_by: 'highest_rating',
tag: 'example'
}
])
};
fetch('https://api.aisa.one/apis/v1/dataforseo/business_data/google/hotel_searches/task_post', 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.aisa.one/apis/v1/dataforseo/business_data/google/hotel_searches/task_post",
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([
[
'adults' => 2,
'check_in' => '2023-06-01',
'check_out' => '2023-06-30',
'children' => [
'14'
],
'currency' => 'USD',
'keyword' => 'cheap hotel',
'language_code' => 'en',
'location_name' => 'New York,New York,United States',
'priority' => 2,
'sort_by' => 'highest_rating',
'tag' => 'example'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.aisa.one/apis/v1/dataforseo/business_data/google/hotel_searches/task_post"
payload := strings.NewReader("[\n {\n \"adults\": 2,\n \"check_in\": \"2023-06-01\",\n \"check_out\": \"2023-06-30\",\n \"children\": [\n \"14\"\n ],\n \"currency\": \"USD\",\n \"keyword\": \"cheap hotel\",\n \"language_code\": \"en\",\n \"location_name\": \"New York,New York,United States\",\n \"priority\": 2,\n \"sort_by\": \"highest_rating\",\n \"tag\": \"example\"\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.aisa.one/apis/v1/dataforseo/business_data/google/hotel_searches/task_post")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"adults\": 2,\n \"check_in\": \"2023-06-01\",\n \"check_out\": \"2023-06-30\",\n \"children\": [\n \"14\"\n ],\n \"currency\": \"USD\",\n \"keyword\": \"cheap hotel\",\n \"language_code\": \"en\",\n \"location_name\": \"New York,New York,United States\",\n \"priority\": 2,\n \"sort_by\": \"highest_rating\",\n \"tag\": \"example\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/dataforseo/business_data/google/hotel_searches/task_post")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"adults\": 2,\n \"check_in\": \"2023-06-01\",\n \"check_out\": \"2023-06-30\",\n \"children\": [\n \"14\"\n ],\n \"currency\": \"USD\",\n \"keyword\": \"cheap hotel\",\n \"language_code\": \"en\",\n \"location_name\": \"New York,New York,United States\",\n \"priority\": 2,\n \"sort_by\": \"highest_rating\",\n \"tag\": \"example\"\n }\n]"
response = http.request(request)
puts response.read_body{
"cost": 123,
"status_code": 123,
"status_message": "<string>",
"tasks_count": 123,
"tasks_error": 123,
"time": "<string>",
"version": "<string>",
"tasks": [
{
"cost": 123,
"data": {},
"id": "<string>",
"path": [
"<string>"
],
"result_count": 123,
"status_code": 123,
"status_message": "<string>",
"time": "<string>",
"result": {}
}
]
}Setting Google Hotel Searches Tasks
Queues a Google Hotels search, returning a task id.
# Fixed reference example. Playground inputs do not update this sample.
curl --request POST \
--url https://api.aisa.one/apis/v1/dataforseo/business_data/google/hotel_searches/task_post \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '[
{
"language_code": "en",
"location_name": "New York,New York,United States",
"keyword": "cheap hotel",
"check_in": "2023-06-01",
"check_out": "2023-06-30",
"currency": "USD",
"adults": 2,
"children": [
"14"
],
"sort_by": "highest_rating",
"priority": 2,
"tag": "example"
}
]'curl --request POST \
--url https://api.aisa.one/apis/v1/dataforseo/business_data/google/hotel_searches/task_post \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"adults": 2,
"check_in": "2023-06-01",
"check_out": "2023-06-30",
"children": [
"14"
],
"currency": "USD",
"keyword": "cheap hotel",
"language_code": "en",
"location_name": "New York,New York,United States",
"priority": 2,
"sort_by": "highest_rating",
"tag": "example"
}
]
'import requests
url = "https://api.aisa.one/apis/v1/dataforseo/business_data/google/hotel_searches/task_post"
payload = [
{
"adults": 2,
"check_in": "2023-06-01",
"check_out": "2023-06-30",
"children": ["14"],
"currency": "USD",
"keyword": "cheap hotel",
"language_code": "en",
"location_name": "New York,New York,United States",
"priority": 2,
"sort_by": "highest_rating",
"tag": "example"
}
]
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
adults: 2,
check_in: '2023-06-01',
check_out: '2023-06-30',
children: ['14'],
currency: 'USD',
keyword: 'cheap hotel',
language_code: 'en',
location_name: 'New York,New York,United States',
priority: 2,
sort_by: 'highest_rating',
tag: 'example'
}
])
};
fetch('https://api.aisa.one/apis/v1/dataforseo/business_data/google/hotel_searches/task_post', 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.aisa.one/apis/v1/dataforseo/business_data/google/hotel_searches/task_post",
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([
[
'adults' => 2,
'check_in' => '2023-06-01',
'check_out' => '2023-06-30',
'children' => [
'14'
],
'currency' => 'USD',
'keyword' => 'cheap hotel',
'language_code' => 'en',
'location_name' => 'New York,New York,United States',
'priority' => 2,
'sort_by' => 'highest_rating',
'tag' => 'example'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.aisa.one/apis/v1/dataforseo/business_data/google/hotel_searches/task_post"
payload := strings.NewReader("[\n {\n \"adults\": 2,\n \"check_in\": \"2023-06-01\",\n \"check_out\": \"2023-06-30\",\n \"children\": [\n \"14\"\n ],\n \"currency\": \"USD\",\n \"keyword\": \"cheap hotel\",\n \"language_code\": \"en\",\n \"location_name\": \"New York,New York,United States\",\n \"priority\": 2,\n \"sort_by\": \"highest_rating\",\n \"tag\": \"example\"\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.aisa.one/apis/v1/dataforseo/business_data/google/hotel_searches/task_post")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"adults\": 2,\n \"check_in\": \"2023-06-01\",\n \"check_out\": \"2023-06-30\",\n \"children\": [\n \"14\"\n ],\n \"currency\": \"USD\",\n \"keyword\": \"cheap hotel\",\n \"language_code\": \"en\",\n \"location_name\": \"New York,New York,United States\",\n \"priority\": 2,\n \"sort_by\": \"highest_rating\",\n \"tag\": \"example\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/dataforseo/business_data/google/hotel_searches/task_post")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"adults\": 2,\n \"check_in\": \"2023-06-01\",\n \"check_out\": \"2023-06-30\",\n \"children\": [\n \"14\"\n ],\n \"currency\": \"USD\",\n \"keyword\": \"cheap hotel\",\n \"language_code\": \"en\",\n \"location_name\": \"New York,New York,United States\",\n \"priority\": 2,\n \"sort_by\": \"highest_rating\",\n \"tag\": \"example\"\n }\n]"
response = http.request(request)
puts response.read_body{
"cost": 123,
"status_code": 123,
"status_message": "<string>",
"tasks_count": 123,
"tasks_error": 123,
"time": "<string>",
"version": "<string>",
"tasks": [
{
"cost": 123,
"data": {},
"id": "<string>",
"path": [
"<string>"
],
"result_count": 123,
"status_code": 123,
"status_message": "<string>",
"time": "<string>",
"result": {}
}
]
}id. Asynchronous: submit returns a task id in tasks[0].id, fetch returns the result once ready, and the charge lands on the submit - fetching is free, including re-fetching. Wrapped in DataForSEO’s envelope: data in tasks[0].result, outcome in tasks[0].status_code - a rejected request still returns HTTP 200. Retrieve with get_dataforseo_business_google_hotel_searches_fetch.
Example
curl -X POST "https://api.aisa.one/apis/v1/dataforseo/business_data/google/hotel_searches/task_post" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '[{"keyword": "...", "priority": "...", "location_name": "..."}]'
Request contract
- Method and path: POST /apis/v1/dataforseo/business_data/google/hotel_searches/task_post
- Availability: enabled
- Request URL template:
https://api.aisa.one/apis/v1/dataforseo/business_data/google/hotel_searches/task_post - Runtime facts: 6ab8fec17df1d5dcdff2e036dd1eb40587752b774ec040ab4eb0cc6946c3dd3c
{
"operationId": "post_dataforseo_business_google_hotel_searches_submit",
"method": "POST",
"path": "/apis/v1/dataforseo/business_data/google/hotel_searches/task_post",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [],
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"example": [
{
"adults": 2,
"check_in": "2023-06-01",
"check_out": "2023-06-30",
"children": [
"14"
],
"currency": "USD",
"keyword": "cheap hotel",
"language_code": "en",
"location_name": "New York,New York,United States",
"priority": 2,
"sort_by": "highest_rating",
"tag": "example"
}
],
"items": {
"oneOf": [
{
"properties": {
"adults": {
"description": "<em>number of adults</em><br>optional field<br>if you don't specify this field, the default value of <code>2</code> will be applied;<br><strong>note</strong> that you can specify up to 6 persons including both adults and children<br>example:<br><code>1</code>",
"type": [
"integer",
"null"
]
},
"amenities": {
"description": "<em>hotel amenities</em><br>optional field<br>you can use this field to specify different hotel amenities<br>example:<br><code> [<br> \"free_parking\",<br> \"pets_allowed\"<br> ]<br></code><br>possible values:<br><code>\"air_conditioning\",<br>\"all_inclusive_available\",<br>\"bar\",<br>\"free_breakfast\",<br>\"fitness_center\",<br>\"kid_friendly\",<br>\"free_parking\",<br>\"pets_allowed\",<br>\"pool\",<br>\"restaurant\",<br>\"room_service\",<br>\"spa\",<br>\"free_wifi\",<br>\"parking\",<br>\"indoor_pool\",<br>\"outdoor_pool\",<br>\"wheelchair_accessible\",<br>\"beach_access\"</code>",
"items": {
"type": "string"
},
"type": [
"array",
"null"
]
},
"check_in": {
"description": "<em>check-in date</em><br>optional field<br>if you don't specify this field, tomorrow's date will be used by default;<br>date format: <code>\"yyyy-mm-dd\"</code><br>example:<br><code>\"2019-01-15\"</code><br><strong>Note:</strong> the value cannot precede the today's date",
"type": [
"string",
"null"
]
},
"check_out": {
"description": "<em>check-out date</em><br>optional field<br>if you don't specify this field, our system will apply the date of two days from now by default;<br>date format: <code>\"yyyy-mm-dd\"</code><br>example:<br><code>\"2019-01-15\"</code><br><strong>Note:</strong> the value cannot be less than or equal to <code>check_in</code>;<br>the range between <code>check_in</code> and <code>check_out</code> values cannot exceed 30 days",
"type": [
"string",
"null"
]
},
"children": {
"description": "<em>number and age of children</em><br>optional field<br>if you don't specify this field, no children will be included in the search;<br>age of child can be from <code>0</code> to <code>17</code>;<br><strong>note</strong> that you can specify up to 6 persons including both adults and children<br>set the following value if you want to include one 14-year-old child:<br><code>[14]</code><br>set the following value if you want to include one 13-year-old child and one 8-year-old child:<br><code>[13,8]</code>",
"items": {
"type": "string"
},
"type": [
"array",
"null"
]
},
"currency": {
"description": "<em>currency</em><br>optional field<br>example:<br><code>\"USD\"</code>",
"type": [
"string",
"null"
]
},
"depth": {
"description": "<em>parsing depth</em><br>optional field<br>number of results in Google Hotels<br>default value: <code>18</code> organic results<br>max value: <code>140</code><br><strong>Note:</strong> your account will be billed per each 18 organic results regardless of paid listings in the response;<br>thus, setting a depth above <code>18</code> may result in additional charges if Google Hotels return more than 18 results;<br>if the specified depth is higher than the number of results in the response, the difference will be refunded automatically to your account balance",
"type": [
"integer",
"null"
]
},
"free_cancellation": {
"description": "<em>hotels with a free cancellation</em><br>optional field<br>set this field to <code>true</code> if you want to get the list of hotels with free cancellation of reservations<br>default value: <code>false</code>",
"type": [
"boolean",
"null"
]
},
"is_vacation_rentals": {
"description": "<em>search for vacation rentals</em><br>optional field<br>set this field to <code>true</code> if you want to get the list of vacation rentals instead of hotels<br>default value: <code>false</code>",
"type": [
"boolean",
"null"
]
},
"keyword": {
"description": "<em>keyword</em><br>optional field<br>the keyword you specify is used to search for the list of hotels;<br>if you don't use this field, we will return the list of hotels found in a specified location;<br>you can specify <strong>up to 700 characters</strong> in the <code>keyword</code> filed<br><strong>all %## will be decoded (plus character ‘+’ will be decoded to a space character)</strong><br>if you need to use the “%” character for your <code>keyword</code>, please specify it as “%25”; <br><strong>Note:</strong> in order to obtain accurate search results, the location name is appended to the keyword automatically<p>learn more about rules and limitations of <code>keyword</code> and <code>keywords</code> fields in DataForSEO APIs in this <a href=\"https://dataforseo.com/help-center/rules-and-limitations-of-keyword-and-keywords-fields-in-dataforseo-apis\" rel=\"noopener noreferrer\" target=\"_blank\">Help Center article</a>",
"type": [
"string",
"null"
]
},
"language_code": {
"description": "<em>search engine language code</em><br><strong>required field if you don't specify <code>language_name</code></strong><br><strong>if you use this field, you don't need to specify <code>language_name</code></strong><br>you can receive the list of available languages with their <code>language_code</code>_by making a separate request to <code>https://api.dataforseo.com/v3/business_data/google/languages</code><em><br></em>example:<em><br></em><code class=\"long-string\">en</code>",
"type": "string"
},
"language_name": {
"description": "<em>full name of search engine language</em><br><strong>required field if you don't specify <code>language_code</code></strong><br><strong>if you use this field, you don't need to specify <code>language_code</code></strong><br>you can receive the list of available languages with <code>language_name</code> by making a separate request to <code>https://api.dataforseo.com/v3/business_data/google/languages</code><br>example:<br><code class=\"long-string\">English</code>",
"type": "string"
},
"location_code": {
"description": "<em>search engine location code</em><br><strong>required field if you don't specify <code>location_name</code>_or <code>location_coordinate</code></strong><br><strong>if you use this field, you don't need to specify <code>location_name</code> or <code>location_coordinate</code></strong><br>you can receive the list of available locations with <code>location_code</code> by making a separate request to the <code>https://api.dataforseo.com/v3/business_data/google/locations</code><br>example:<br><code class=\"long-string\">2840</code>n",
"type": "integer"
},
"location_coordinate": {
"description": "<em>GPS coordinates of a location</em><br><strong>required field if you don't specify <code>location_name</code>_or <code>location_code</code></strong><br><strong>if you use this field, you don't need to specify <code>location_name</code> or <code>location_code</code></strong><br><code>location_coordinate</code> parameter should be specified in the <em>\"latitude,longitude\"</em> format<br>the maximum number of decimal digits for <em>\"latitude\"</em> and <em>\"longitude\"</em>: 7<br><strong>Note</strong>: if the coordinates are used to set a location, the search will occur in the nearest settlement;<br>example:<br><code class=\"long-string\">53.476225,-2.243572</code>",
"type": "string"
},
"location_name": {
"description": "<em>full name of search engine location</em><br><strong>required field if you don't specify <code>location_code</code> or <code>location_coordinate</code></strong><br><strong>if you use this field, you don't need to specify <code>location_code</code> or <code>location_coordinate</code></strong><br>you can receive the list of available locations with <code>location_name</code> by making a separate request to <code>https://api.dataforseo.com/v3/business_data/google/locations</code><br>example:<br><code class=\"long-string\">London,England,United Kingdom</code><br><strong>Note:</strong> in order to obtain accurate search results, the <code>location_name</code> you specify will be automatically appended to the keyword",
"type": "string"
},
"max_price": {
"description": "<em>maximum price per night</em><br>optional field<br>the currency of this value depends on the <code>currency</code> field<br>example:<br><code>600</code>",
"type": [
"integer",
"null"
]
},
"min_price": {
"description": "<em>minimum price per night</em><br>optional field<br>the currency of this value depends on the <code>currency</code> field<br>example:<br><code>100</code>",
"type": [
"integer",
"null"
]
},
"min_rating": {
"description": "<em>minimum rating</em><br>optional field<br>you can use this field to specify guest rating higher than a certain value<br>example:<br><code>2.5</code>",
"type": [
"number",
"null"
]
},
"pingback_url": {
"description": "<em>notification URL of a completed task</em><br>optional field<br>when a task is completed we will notify you by GET request sent to the URL you have specified<br>you can use the ‘$id’ string as a <code>$id</code> variable and ‘$tag’ as urlencoded <code>$tag</code> variable. We will set the necessary values before sending the request.<br>example:<br><code>http://your-server.com/pingscript?id=$id</code><br><code>http://your-server.com/pingscript?id=$id&tag=$tag</code><br><strong>Note:</strong> special characters in <code>pingback_url</code> will be urlencoded; <br>i.a., the <code>#</code> character will be encoded into <code>%23</code><p>learn more on our <a href=\"https://dataforseo.com/help-center/pingbacks-postbacks-with-dataforseo-api\" target=\"_blank\" rel=\"noopener noreferrer\">Help Center</a>",
"type": [
"string",
"null"
]
},
"postback_url": {
"description": "<em>URL for sending task results</em><br>optional field<br>once the task is completed, we will send a POST request with its results compressed in the <code>gzip</code> format to the <code>postback_url</code> you specified<br>you can use the ‘$id’ string as a <code>$id</code> variable and ‘$tag’ as urlencoded <code>$tag</code> variable. We will set the necessary values before sending the request.<br>example:<br><code>http://your-server.com/postbackscript?id=$id</code><br><code>http://your-server.com/postbackscript?id=$id&tag=$tag</code><br><strong>Note:</strong> special characters in <code>postback_url</code> will be urlencoded; <br>i.a., the <code>#</code> character will be encoded into <code>%23</code><p>learn more on our <a href=\"https://dataforseo.com/help-center/pingbacks-postbacks-with-dataforseo-api\" target=\"_blank\" rel=\"noopener noreferrer\">Help Center</a>",
"type": [
"string",
"null"
]
},
"priority": {
"description": "<em>task priority</em><br>optional field<br>can take the following values:<br>1 – normal execution priority (set by default)<br>2 – high execution priorityYou will be additionally charged for the tasks with high execution priority.<br>The cost can be calculated on the <a title=\"Pricing\" href=\"https://dataforseo.com/pricing/business-data/google-hotels-api\" target=\"_blank\" rel=\"noopener noreferrer\">Pricing</a> page.",
"type": [
"integer",
"null"
]
},
"search_this_area": {
"description": "<em>show hotels from the displayed area</em><br>optional field<br>can take the values: <code>true</code>, <code>false</code><br>default value: <code>true</code><br>if set to <code>false</code> the <code>search_this_area</code> mode will be turned off<br><strong>Note:</strong> if the <code>search_this_area</code> mode is turned off, the <code>location_name</code> won't be appended to the <code>keyword</code> during search<br>learn more about this parameter <a href=\"https://dataforseo.com/help-center/how-to-use-search_this_area-parameter-in-google-hotel-searches\" target=\"_blank\">on our Help Center</a>",
"type": [
"boolean",
"null"
]
},
"sort_by": {
"description": "<em>results sorting parameters</em><br>optional field<br>you can use this field to sort the results<br>possible types of sorting:<br><code>relevance</code> – sort by most relevant<br><code>lowest_price</code> – sort by the lowest price<br><code>highest_rating</code> – sort by highest rating<br><code>most_reviewed</code> – sort by most reviewed<br>default value: <code>relevance</code>",
"type": [
"string",
"null"
]
},
"stars": {
"description": "<em>hotel stars</em><br>optional field<br>set this field to <code>[5]</code> if you want to get the list of 5-star hotels only<br>example:<br><code>[3,4,5]</code>",
"items": {
"type": "string"
},
"type": [
"array",
"null"
]
},
"tag": {
"description": "<em>user-defined task identifier</em><br>optional field<br><em>the character limit is 255</em><br>you can use this parameter to identify the task and match it with the result<br>you will find the specified <code>tag</code> value in the <code>data</code> object of the response",
"type": [
"string",
"null"
]
}
},
"type": "object"
}
],
"type": [
"object",
"null"
]
},
"type": "array"
}
}
}
},
"x-aisa-status": "enabled",
"x-aisa-pricing": {
"cost_contract": "response_usd",
"customer_multiplier": 1.0,
"customer_pricing": "provider_cost_multiplier",
"default_request_estimate_usd": 0.2428,
"estimate_source": "profile_seed",
"evidence_source": "response_body"
},
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
Cost and request rules
Usage-based billing; Default request estimate: $0.2428 USD (not a fixed price). Account-specific pricing and final settlement may differ. Published reference values are not an account-specific quote or a settled charge. For endpoints supporting X-AISA-Cost-Mode: quote, obtain a free quote for your exact request before execution; reconcile the settled cost with response metadata and Usage Logs. USD amounts use 1,000,000 integer micro-USD per dollar.- Default request reference estimate (USD): 0.2428
- Cost contract: response_usd
- Published reference multiplier: 1.0
- Settlement evidence source: response_body
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
number of adults
optional field
if you don't specify this field, the default value of 2 will be applied;
note that you can specify up to 6 persons including both adults and children
example:1
hotel amenities
optional field
you can use this field to specify different hotel amenities
example:[ "free_parking", "pets_allowed" ]
possible values:"air_conditioning","all_inclusive_available","bar","free_breakfast","fitness_center","kid_friendly","free_parking","pets_allowed","pool","restaurant","room_service","spa","free_wifi","parking","indoor_pool","outdoor_pool","wheelchair_accessible","beach_access"
check-in date
optional field
if you don't specify this field, tomorrow's date will be used by default;
date format: "yyyy-mm-dd"
example:"2019-01-15"
Note: the value cannot precede the today's date
check-out date
optional field
if you don't specify this field, our system will apply the date of two days from now by default;
date format: "yyyy-mm-dd"
example:"2019-01-15"
Note: the value cannot be less than or equal to check_in;
the range between check_in and check_out values cannot exceed 30 days
number and age of children
optional field
if you don't specify this field, no children will be included in the search;
age of child can be from 0 to 17;
note that you can specify up to 6 persons including both adults and children
set the following value if you want to include one 14-year-old child:[14]
set the following value if you want to include one 13-year-old child and one 8-year-old child:[13,8]
currency
optional field
example:"USD"
parsing depth
optional field
number of results in Google Hotels
default value: 18 organic results
max value: 140
Note: your account will be billed per each 18 organic results regardless of paid listings in the response;
thus, setting a depth above 18 may result in additional charges if Google Hotels return more than 18 results;
if the specified depth is higher than the number of results in the response, the difference will be refunded automatically to your account balance
hotels with a free cancellation
optional field
set this field to true if you want to get the list of hotels with free cancellation of reservations
default value: false
search for vacation rentals
optional field
set this field to true if you want to get the list of vacation rentals instead of hotels
default value: false
keyword
optional field
the keyword you specify is used to search for the list of hotels;
if you don't use this field, we will return the list of hotels found in a specified location;
you can specify up to 700 characters in the keyword filed
all %## will be decoded (plus character ‘+’ will be decoded to a space character)
if you need to use the “%” character for your keyword, please specify it as “%25”;
Note: in order to obtain accurate search results, the location name is appended to the keyword automatically
learn more about rules and limitations of keyword and keywords fields in DataForSEO APIs in this Help Center article
search engine language code
required field if you don't specify language_name
if you use this field, you don't need to specify language_name
you can receive the list of available languages with their language_code_by making a separate request to https://api.dataforseo.com/v3/business_data/google/languages
example:en
full name of search engine language
required field if you don't specify language_code
if you use this field, you don't need to specify language_code
you can receive the list of available languages with language_name by making a separate request to https://api.dataforseo.com/v3/business_data/google/languages
example:English
search engine location code
required field if you don't specify location_name_or location_coordinate
if you use this field, you don't need to specify location_name or location_coordinate
you can receive the list of available locations with location_code by making a separate request to the https://api.dataforseo.com/v3/business_data/google/locations
example:2840n
GPS coordinates of a location
required field if you don't specify location_name_or location_code
if you use this field, you don't need to specify location_name or location_codelocation_coordinate parameter should be specified in the "latitude,longitude" format
the maximum number of decimal digits for "latitude" and "longitude": 7
Note: if the coordinates are used to set a location, the search will occur in the nearest settlement;
example:53.476225,-2.243572
full name of search engine location
required field if you don't specify location_code or location_coordinate
if you use this field, you don't need to specify location_code or location_coordinate
you can receive the list of available locations with location_name by making a separate request to https://api.dataforseo.com/v3/business_data/google/locations
example:London,England,United Kingdom
Note: in order to obtain accurate search results, the location_name you specify will be automatically appended to the keyword
maximum price per night
optional field
the currency of this value depends on the currency field
example:600
minimum price per night
optional field
the currency of this value depends on the currency field
example:100
minimum rating
optional field
you can use this field to specify guest rating higher than a certain value
example:2.5
notification URL of a completed task
optional field
when a task is completed we will notify you by GET request sent to the URL you have specified
you can use the ‘$id’ string as a $id variable and ‘$tag’ as urlencoded $tag variable. We will set the necessary values before sending the request.
example:http://your-server.com/pingscript?id=$idhttp://your-server.com/pingscript?id=$id&tag=$tag
Note: special characters in pingback_url will be urlencoded;
i.a., the # character will be encoded into %23
learn more on our Help Center
URL for sending task results
optional field
once the task is completed, we will send a POST request with its results compressed in the gzip format to the postback_url you specified
you can use the ‘$id’ string as a $id variable and ‘$tag’ as urlencoded $tag variable. We will set the necessary values before sending the request.
example:http://your-server.com/postbackscript?id=$idhttp://your-server.com/postbackscript?id=$id&tag=$tag
Note: special characters in postback_url will be urlencoded;
i.a., the # character will be encoded into %23
learn more on our Help Center
show hotels from the displayed area
optional field
can take the values: true, false
default value: true
if set to false the search_this_area mode will be turned off
Note: if the search_this_area mode is turned off, the location_name won't be appended to the keyword during search
learn more about this parameter on our Help Center
results sorting parameters
optional field
you can use this field to sort the results
possible types of sorting:relevance – sort by most relevantlowest_price – sort by the lowest pricehighest_rating – sort by highest ratingmost_reviewed – sort by most reviewed
default value: relevance
hotel stars
optional field
set this field to [5] if you want to get the list of 5-star hotels only
example:[3,4,5]
user-defined task identifier
optional field
the character limit is 255
you can use this parameter to identify the task and match it with the result
you will find the specified tag value in the data object of the response
[
{
"adults": 2,
"check_in": "2023-06-01",
"check_out": "2023-06-30",
"children": ["14"],
"currency": "USD",
"keyword": "cheap hotel",
"language_code": "en",
"location_name": "New York,New York,United States",
"priority": 2,
"sort_by": "highest_rating",
"tag": "example"
}
]
Response
Successful operation
total tasks cost, USD
general status code you can find the full list of the response codes here
general informational message you can find the full list of general informational messages here
the number of tasks in the tasks array
the number of tasks in the tasks array returned with an error
total execution time, seconds
the current version of the API
array of tasks
Show child attributes
Show child attributes