API Hop 文件
Google Hotels 介面參考
搜尋 Google Hotels 飯店、飯店建議、照片與評論。
並行上限
AI 與 Data 分別共用帳戶層級的並行名額,預設 5 AI / 2 Data,訂閱方案可調整上限。介面個別設定仍受類別總上限約束。達到任一上限回傳 HTTP 429;非同步任務執行結束前占用名額。
GET /v1/google-hotels/search GET /v1/google-hotels/autocomplete GET /v1/google-hotels/photos GET /v1/google-hotels/reviews 搜尋 Google Hotels 飯店、飯店建議、照片與評論。
驗證與計費
預設每次成功請求 $0.0003(300 credits)。 使用 API Hop API Key;可用性取決於已啟用閘道與金鑰權限。成功請求價格以目前目錄與帳戶為準,帳戶專屬價格優先。成功的空結果也會計費,失敗會釋放預留額度。逾時為 60 秒,不自動重試或分頁,結算失敗不會重複呼叫上游。
Authorization: Bearer YOUR_API_KEYGoogle Hotels: 搜尋飯店
GET https://api.apihop.ai/v1/google-hotels/search
請求參數
| 欄位 | 類型 | 限制 | 範例 |
|---|---|---|---|
query | string | 搜尋詞; query: optional | hotels in New York |
next_page_token | string | 下一頁權杖; next_page_token: optional; UTF-8 bytes: 24576 | - |
currency | string | 貨幣代碼 (currency); currency: optional; ALL, DZD, ARS, AMD, AWG, AUD, AZN, BSD, BHD, BYN, BMD, BAM, BRL, GBP, BGN, XPF, CAD, CLP, CNY, COP, CRC, CUP, CZK, DKK, DOP, EGP, EUR, GEL, HKD, HUF, ISK, INR, IDR, IRR, ILS, JMD, JPY, JOD, KZT, KWD, LBP, MKD, MYR, MXN, MDL, MAD, TWD, NZD, NOK, OMR, PKR, PAB, PEN, PHP, PLN, QAR, RON, RUB, SAR, RSD, SGD, ZAR, KRW, SEK, CHF, THB, TRY, USD, UAH, AED, VND; ^[A-Z]{3}$ | USD |
country | string | 國家或站點代碼 (country); country: optional; ^[A-Za-z]{2}$ | - |
language | string | 語言; language: optional | - |
limit | integer | 結果上限; limit: optional; min: 1; max: 100 | 1 |
device | string | 裝置; device: optional; desktop, mobile, tablet | desktop |
zero_trace | boolean | 不封存回應產物; zero_trace: optional | true |
check_in_date | string | 旅行日期(YYYY-MM-DD)或介面支援的日期範圍 (check_in_date); check_in_date: optional; ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ | - |
check_out_date | string | 旅行日期(YYYY-MM-DD)或介面支援的日期範圍 (check_out_date); check_out_date: optional; ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ | - |
adults | integer | 成人人數 (adults); adults: optional; min: 1; max: 100 | 1 |
children | integer | 兒童人數 (children); children: optional; min: 0; max: 99 | 0 |
children_ages | string | 兒童年齡清單 (children_ages); 預設值: 12; children_ages: optional; UTF-8 bytes: 296; ^(?:[1-9]|1[0-7])(?:,(?:[1-9]|1[0-7])){0,98}$ | - |
sort_by | string | 排序; sort_by: optional; relevance, lowest_price, highest_rating, most_reviewed | relevance |
min_price | integer | 最低價格 (min_price); min_price: optional; min: 0; max: 2147483647 | 0 |
max_price | integer | 最高價格 (max_price); max_price: optional; min: 1; max: 2147483647 | 1 |
rating | integer | 星級(逗號分隔); 7 → 3.5+, 8 → 4.0+, 9 → 4.5+; rating: optional; 7, 8, 9 | 7 |
hotel_class | string | 住宿條件篩選 (hotel_class); hotel_class: optional; UTF-8 bytes: 7 | - |
amenities | string | 住宿條件篩選 (amenities); amenities: optional; UTF-8 bytes: 300; ^[1-9][0-9]*(?:,[1-9][0-9]*)*$ | - |
free_cancellation | boolean | 住宿條件篩選 (free_cancellation); free_cancellation: optional | true |
special_offers | boolean | 住宿條件篩選 (special_offers); special_offers: optional | true |
eco_certified | boolean | 住宿條件篩選 (eco_certified); eco_certified: optional | true |
property_types | string | 住宿條件篩選 (property_types); property_types: optional; UTF-8 bytes: 100; ^[1-9][0-9]*(?:,[1-9][0-9]*)*$ | - |
brands | string | 住宿條件篩選 (brands); brands: optional; UTF-8 bytes: 300; ^[1-9][0-9]{0,5}(?:,[1-9][0-9]{0,5})*$ | - |
vacation_rentals | boolean | 住宿條件篩選 (vacation_rentals); vacation_rentals: optional | true |
bedrooms | integer | 臥室或床數量下限 (bedrooms); bedrooms: optional; min: 0; max: 2147483647 | 0 |
bathrooms | integer | 浴室數量下限 (bathrooms); bathrooms: optional; min: 0; max: 2147483647 | 0 |
property_token | string | 從最新回應複製的選擇權杖 (property_token); property_token: optional; UTF-8 bytes: 256; ^[A-Za-z0-9_-]{16,256}$ | - |
驗證規則
僅接受查詢參數,不接受本文。拒絕未知、重複、空白或無效值。僅支援 JSON 回應,不自動分頁或重試。規則中的 AND 表示同時提供,OR 表示任一,XOR 表示二選一,NOT 表示不得提供,=> 表示需要。
GET query only; body = null; response = JSON; html, output, json_restrictor, no_cache: NOT supportedstring: UTF-8 bytes <= maxLength (default 8192); boolean = true OR false; integer: safe integerlanguage: /^[A-Za-z]{2,3}(?:[-_][A-Za-z]{2,4})?$/min_price <= max_pricecheck_in_date AND check_out_date: supply both or neither; valid YYYY-MM-DD dates; check_out_date > check_in_datequery OR property_token OR next_page_token: requiredadults (default 2) + children <= 100; children_ages: comma-separated ages 0..17; count = childrenbedrooms OR bathrooms => vacation_rentals = true; vacation_rentals = true => NOT brandsTokens: copy the exact token from a fresh response; do not invent or reuse expired tokens; each page or token lookup is a separate billable successful request
範例
curl --get "https://api.apihop.ai/v1/google-hotels/search" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "currency=USD" \
--data-urlencode "query=hotels in New York"Google Hotels: 查詢飯店建議
GET https://api.apihop.ai/v1/google-hotels/autocomplete
請求參數
| 欄位 | 類型 | 限制 | 範例 |
|---|---|---|---|
query | string | 搜尋詞; query: REQUIRED | New York |
country | string | 國家或站點代碼 (country); country: optional; ^[A-Za-z]{2}$ | - |
language | string | 語言; language: optional | - |
limit | integer | 結果上限; limit: optional; min: 1; max: 100 | 1 |
device | string | 裝置; device: optional; desktop, mobile, tablet | desktop |
zero_trace | boolean | 不封存回應產物; zero_trace: optional | true |
currency | string | 貨幣代碼 (currency); currency: optional; ALL, DZD, ARS, AMD, AWG, AUD, AZN, BSD, BHD, BYN, BMD, BAM, BRL, GBP, BGN, XPF, CAD, CLP, CNY, COP, CRC, CUP, CZK, DKK, DOP, EGP, EUR, GEL, HKD, HUF, ISK, INR, IDR, IRR, ILS, JMD, JPY, JOD, KZT, KWD, LBP, MKD, MYR, MXN, MDL, MAD, TWD, NZD, NOK, OMR, PKR, PAB, PEN, PHP, PLN, QAR, RON, RUB, SAR, RSD, SGD, ZAR, KRW, SEK, CHF, THB, TRY, USD, UAH, AED, VND; ^[A-Z]{3}$ | ALL |
驗證規則
僅接受查詢參數,不接受本文。拒絕未知、重複、空白或無效值。僅支援 JSON 回應,不自動分頁或重試。規則中的 AND 表示同時提供,OR 表示任一,XOR 表示二選一,NOT 表示不得提供,=> 表示需要。
GET query only; body = null; response = JSON; html, output, json_restrictor, no_cache: NOT supportedstring: UTF-8 bytes <= maxLength (default 8192); boolean = true OR false; integer: safe integerlanguage: /^[A-Za-z]{2,3}(?:[-_][A-Za-z]{2,4})?$/
範例
curl --get "https://api.apihop.ai/v1/google-hotels/autocomplete" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "query=New York"Google Hotels: 查詢飯店照片
GET https://api.apihop.ai/v1/google-hotels/photos
請求參數
| 欄位 | 類型 | 限制 | 範例 |
|---|---|---|---|
id | string | 從飯店搜尋結果複製的飯店識別碼 (id); id: REQUIRED | ChgI-N6n0Nnyw_K2ARoLL2cvMXRqZGgzMjkQAQ |
country | string | 國家或站點代碼 (country); country: optional; ^[A-Za-z]{2}$ | - |
language | string | 語言; language: optional | - |
limit | integer | 結果上限; limit: optional; min: 1; max: 100 | 1 |
device | string | 裝置; device: optional; desktop, mobile, tablet | desktop |
zero_trace | boolean | 不封存回應產物; zero_trace: optional | true |
next_page_token | string | 下一頁權杖; next_page_token: optional; UTF-8 bytes: 24576 | - |
驗證規則
僅接受查詢參數,不接受本文。拒絕未知、重複、空白或無效值。僅支援 JSON 回應,不自動分頁或重試。規則中的 AND 表示同時提供,OR 表示任一,XOR 表示二選一,NOT 表示不得提供,=> 表示需要。
GET query only; body = null; response = JSON; html, output, json_restrictor, no_cache: NOT supportedstring: UTF-8 bytes <= maxLength (default 8192); boolean = true OR false; integer: safe integerlanguage: /^[A-Za-z]{2,3}(?:[-_][A-Za-z]{2,4})?$/Tokens: copy the exact token from a fresh response; do not invent or reuse expired tokens; each page or token lookup is a separate billable successful request
範例
curl --get "https://api.apihop.ai/v1/google-hotels/photos" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "id=ChgI-N6n0Nnyw_K2ARoLL2cvMXRqZGgzMjkQAQ"Google Hotels: 查詢飯店評論
GET https://api.apihop.ai/v1/google-hotels/reviews
請求參數
| 欄位 | 類型 | 限制 | 範例 |
|---|---|---|---|
id | string | 從飯店搜尋結果複製的飯店識別碼 (id); id: REQUIRED | ChgI-N6n0Nnyw_K2ARoLL2cvMXRqZGgzMjkQAQ |
next_page_token | string | 下一頁權杖; next_page_token: optional; UTF-8 bytes: 24576 | - |
sort_by | string | 排序; sort_by: optional; relevance, newest, highest_rating, lowest_rating | relevance |
country | string | 國家或站點代碼 (country); country: optional; ^[A-Za-z]{2}$ | - |
language | string | 語言; language: optional | - |
limit | integer | 結果上限; limit: optional; min: 1; max: 10 | 10 |
device | string | 裝置; device: optional; desktop, mobile, tablet | desktop |
zero_trace | boolean | 不封存回應產物; zero_trace: optional | true |
category_token | string | 從最新回應複製的選擇權杖 (category_token); category_token: optional; UTF-8 bytes: 2800; ^[A-Za-z0-9_-]+$ | - |
source_number | integer | 住宿條件篩選 (source_number); source_number: optional; min: -1; max: 2147483647 | -1 |
驗證規則
僅接受查詢參數,不接受本文。拒絕未知、重複、空白或無效值。僅支援 JSON 回應,不自動分頁或重試。規則中的 AND 表示同時提供,OR 表示任一,XOR 表示二選一,NOT 表示不得提供,=> 表示需要。
GET query only; body = null; response = JSON; html, output, json_restrictor, no_cache: NOT supportedstring: UTF-8 bytes <= maxLength (default 8192); boolean = true OR false; integer: safe integerlanguage: /^[A-Za-z]{2,3}(?:[-_][A-Za-z]{2,4})?$/Tokens: copy the exact token from a fresh response; do not invent or reuse expired tokens; each page or token lookup is a separate billable successful request
範例
curl --get "https://api.apihop.ai/v1/google-hotels/reviews" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "id=ChgI-N6n0Nnyw_K2ARoLL2cvMXRqZGgzMjkQAQ" \
--data-urlencode "limit=10"回應與錯誤
保留原生 JSON 與數字精確度。以下是空成功結果範例。HTTP 400 輸入無效;401 需驗證;402 餘額不足;403 無權限或未開放;405 方法不支援;429 限流;5xx 服務錯誤。請保留 X-Request-Id。
{
"success": true,
"request_id": "example-request",
"data": {
"format": "json",
"content": {
"results": []
}
}
}