เอกสาร API Hop
เอกสารอ้างอิง Google Hotels
ค้นหาโรงแรม คำแนะนำ รูปภาพ และรีวิวบน Google Hotels
ขีดจำกัดการทำงานพร้อมกัน
AI และ Data ใช้โควตาคำขอพร้อมกันร่วมกันภายในแต่ละหมวดของบัญชี ค่าเริ่มต้นคือ 5 AI / 2 Data และปรับตามแพ็กเกจสมาชิก ขีดจำกัดเฉพาะ endpoint ยังอยู่ภายใต้ขีดจำกัดรวมของหมวด เมื่อถึงขีดจำกัดใดจะส่ง 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 ของ API Hop การเข้าถึงขึ้นอยู่กับเกตเวย์และสิทธิ์ ดูราคาต่อคำขอที่สำเร็จในแค็ตตาล็อกและบัญชี โดยใช้ราคาบัญชีก่อน ผลลัพธ์ว่างที่สำเร็จก็คิดค่าบริการ คำขอที่ล้มเหลวคืนยอดสำรอง หมดเวลาที่ 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": []
}
}
}