API Hop

เอกสาร

เอกสาร API Hop

เอกสารอ้างอิง Google Hotels

ค้นหาโรงแรม คำแนะนำ รูปภาพ และรีวิวบน Google Hotels

ขีดจำกัดการทำงานพร้อมกัน

AI และ Data ใช้โควตาคำขอพร้อมกันร่วมกันภายในแต่ละหมวดของบัญชี ค่าเริ่มต้นคือ 5 AI / 2 Data และปรับตามแพ็กเกจสมาชิก ขีดจำกัดเฉพาะ endpoint ยังอยู่ภายใต้ขีดจำกัดรวมของหมวด เมื่อถึงขีดจำกัดใดจะส่ง HTTP 429 งานอะซิงโครนัสใช้ช่องจนกว่าการทำงานจะสิ้นสุด

GET /v1/google-hotels/search
ขีดจำกัดเริ่มต้น: 2
GET /v1/google-hotels/autocomplete
ขีดจำกัดเริ่มต้น: 2
GET /v1/google-hotels/photos
ขีดจำกัดเริ่มต้น: 2
GET /v1/google-hotels/reviews
ขีดจำกัดเริ่มต้น: 2

ค้นหาโรงแรม คำแนะนำ รูปภาพ และรีวิวบน Google Hotels

การยืนยันตัวตนและค่าบริการ

ราคามาตรฐานต่อคำขอที่สำเร็จคือ $0.0003 (300 credits) ใช้คีย์ API ของ API Hop การเข้าถึงขึ้นอยู่กับเกตเวย์และสิทธิ์ ดูราคาต่อคำขอที่สำเร็จในแค็ตตาล็อกและบัญชี โดยใช้ราคาบัญชีก่อน ผลลัพธ์ว่างที่สำเร็จก็คิดค่าบริการ คำขอที่ล้มเหลวคืนยอดสำรอง หมดเวลาที่ 60 วินาที ไม่ลองซ้ำหรือแบ่งหน้าอัตโนมัติ ข้อผิดพลาดการชำระไม่เรียกผู้ให้บริการซ้ำ

http
Authorization: Bearer YOUR_API_KEY

Google Hotels: ค้นหาโรงแรม

GET https://api.apihop.ai/v1/google-hotels/search

พารามิเตอร์

ฟิลด์ชนิดข้อจำกัดตัวอย่าง
querystringคำค้น; query: optionalhotels in New York
next_page_tokenstringโทเค็นหน้าถัดไป; next_page_token: optional; UTF-8 bytes: 24576-
currencystringรหัสสกุลเงิน (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
countrystringรหัสประเทศหรือร้านค้า (country); country: optional; ^[A-Za-z]{2}$-
languagestringภาษา; language: optional-
limitintegerจำนวนผลลัพธ์สูงสุด; limit: optional; min: 1; max: 1001
devicestringอุปกรณ์; device: optional; desktop, mobile, tabletdesktop
zero_tracebooleanไม่เก็บถาวรคำตอบ; zero_trace: optionaltrue
check_in_datestringวันเดินทาง (YYYY-MM-DD) หรือช่วงวันที่ที่รองรับ (check_in_date); check_in_date: optional; ^[0-9]{4}-[0-9]{2}-[0-9]{2}$-
check_out_datestringวันเดินทาง (YYYY-MM-DD) หรือช่วงวันที่ที่รองรับ (check_out_date); check_out_date: optional; ^[0-9]{4}-[0-9]{2}-[0-9]{2}$-
adultsintegerจำนวนผู้ใหญ่ (adults); adults: optional; min: 1; max: 1001
childrenintegerจำนวนเด็ก (children); children: optional; min: 0; max: 990
children_agesstringรายการอายุเด็ก (children_ages); ค่าเริ่มต้น: 12; children_ages: optional; UTF-8 bytes: 296; ^(?:[1-9]|1[0-7])(?:,(?:[1-9]|1[0-7])){0,98}$-
sort_bystringการเรียง; sort_by: optional; relevance, lowest_price, highest_rating, most_reviewedrelevance
min_priceintegerราคาต่ำสุด (min_price); min_price: optional; min: 0; max: 21474836470
max_priceintegerราคาสูงสุด (max_price); max_price: optional; min: 1; max: 21474836471
ratingintegerดาว คั่นด้วยจุลภาค; 7 → 3.5+, 8 → 4.0+, 9 → 4.5+; rating: optional; 7, 8, 97
hotel_classstringตัวกรองที่พัก (hotel_class); hotel_class: optional; UTF-8 bytes: 7-
amenitiesstringตัวกรองที่พัก (amenities); amenities: optional; UTF-8 bytes: 300; ^[1-9][0-9]*(?:,[1-9][0-9]*)*$-
free_cancellationbooleanตัวกรองที่พัก (free_cancellation); free_cancellation: optionaltrue
special_offersbooleanตัวกรองที่พัก (special_offers); special_offers: optionaltrue
eco_certifiedbooleanตัวกรองที่พัก (eco_certified); eco_certified: optionaltrue
property_typesstringตัวกรองที่พัก (property_types); property_types: optional; UTF-8 bytes: 100; ^[1-9][0-9]*(?:,[1-9][0-9]*)*$-
brandsstringตัวกรองที่พัก (brands); brands: optional; UTF-8 bytes: 300; ^[1-9][0-9]{0,5}(?:,[1-9][0-9]{0,5})*$-
vacation_rentalsbooleanตัวกรองที่พัก (vacation_rentals); vacation_rentals: optionaltrue
bedroomsintegerจำนวนห้องนอนหรือเตียงขั้นต่ำ (bedrooms); bedrooms: optional; min: 0; max: 21474836470
bathroomsintegerจำนวนห้องน้ำขั้นต่ำ (bathrooms); bathrooms: optional; min: 0; max: 21474836470
property_tokenstringโทเค็นเลือกจากคำตอบล่าสุด (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 supported
  • string: UTF-8 bytes <= maxLength (default 8192); boolean = true OR false; integer: safe integer
  • language: /^[A-Za-z]{2,3}(?:[-_][A-Za-z]{2,4})?$/
  • min_price <= max_price
  • check_in_date AND check_out_date: supply both or neither; valid YYYY-MM-DD dates; check_out_date > check_in_date
  • query OR property_token OR next_page_token: required
  • adults (default 2) + children <= 100; children_ages: comma-separated ages 0..17; count = children
  • bedrooms OR bathrooms => vacation_rentals = true; vacation_rentals = true => NOT brands
  • 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

ตัวอย่าง

bash
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

พารามิเตอร์

ฟิลด์ชนิดข้อจำกัดตัวอย่าง
querystringคำค้น; query: REQUIREDNew York
countrystringรหัสประเทศหรือร้านค้า (country); country: optional; ^[A-Za-z]{2}$-
languagestringภาษา; language: optional-
limitintegerจำนวนผลลัพธ์สูงสุด; limit: optional; min: 1; max: 1001
devicestringอุปกรณ์; device: optional; desktop, mobile, tabletdesktop
zero_tracebooleanไม่เก็บถาวรคำตอบ; zero_trace: optionaltrue
currencystringรหัสสกุลเงิน (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 supported
  • string: UTF-8 bytes <= maxLength (default 8192); boolean = true OR false; integer: safe integer
  • language: /^[A-Za-z]{2,3}(?:[-_][A-Za-z]{2,4})?$/

ตัวอย่าง

bash
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

พารามิเตอร์

ฟิลด์ชนิดข้อจำกัดตัวอย่าง
idstringรหัสโรงแรมจากผลค้นหา (id); id: REQUIREDChgI-N6n0Nnyw_K2ARoLL2cvMXRqZGgzMjkQAQ
countrystringรหัสประเทศหรือร้านค้า (country); country: optional; ^[A-Za-z]{2}$-
languagestringภาษา; language: optional-
limitintegerจำนวนผลลัพธ์สูงสุด; limit: optional; min: 1; max: 1001
devicestringอุปกรณ์; device: optional; desktop, mobile, tabletdesktop
zero_tracebooleanไม่เก็บถาวรคำตอบ; zero_trace: optionaltrue
next_page_tokenstringโทเค็นหน้าถัดไป; 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 supported
  • string: UTF-8 bytes <= maxLength (default 8192); boolean = true OR false; integer: safe integer
  • language: /^[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

ตัวอย่าง

bash
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

พารามิเตอร์

ฟิลด์ชนิดข้อจำกัดตัวอย่าง
idstringรหัสโรงแรมจากผลค้นหา (id); id: REQUIREDChgI-N6n0Nnyw_K2ARoLL2cvMXRqZGgzMjkQAQ
next_page_tokenstringโทเค็นหน้าถัดไป; next_page_token: optional; UTF-8 bytes: 24576-
sort_bystringการเรียง; sort_by: optional; relevance, newest, highest_rating, lowest_ratingrelevance
countrystringรหัสประเทศหรือร้านค้า (country); country: optional; ^[A-Za-z]{2}$-
languagestringภาษา; language: optional-
limitintegerจำนวนผลลัพธ์สูงสุด; limit: optional; min: 1; max: 1010
devicestringอุปกรณ์; device: optional; desktop, mobile, tabletdesktop
zero_tracebooleanไม่เก็บถาวรคำตอบ; zero_trace: optionaltrue
category_tokenstringโทเค็นเลือกจากคำตอบล่าสุด (category_token); category_token: optional; UTF-8 bytes: 2800; ^[A-Za-z0-9_-]+$-
source_numberintegerตัวกรองที่พัก (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 supported
  • string: UTF-8 bytes <= maxLength (default 8192); boolean = true OR false; integer: safe integer
  • language: /^[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

ตัวอย่าง

bash
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

json
{
  "success": true,
  "request_id": "example-request",
  "data": {
    "format": "json",
    "content": {
      "results": []
    }
  }
}