qstringจำเป็น
q
https://api.sandbase.ai/v1/api/google-hotels/searchGoogle Hotels results for a destination and stay dates: hotels, nightly rates, ratings, amenities and offers.
เอาต์พุตของคุณจะแสดงที่นี่
กรอกอินพุตให้ครบ แล้วคลิก Run
Returns Google Hotels results for a search phrase and stay dates. Send a destination or query in q, the check_in_date and check_out_date, and the number of adults. The response lists matching hotels with nightly rates, ratings, amenities and review data, plus a list of sponsored offers.
deal and deal_description fields for properties priced below their usual rate.gps_coordinates to show options on a travel planning page.curl -X POST "https://api.sandbase.ai/v1/api/google-hotels/search" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"q": "Bali Resorts", "check_in_date": "2026-12-15", "check_out_date": "2026-12-16", "adults": 2}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
adults | integer | Yes | adults |
check_in_date | string | Yes | YYYY-MM-DD |
check_out_date | string | Yes | YYYY-MM-DD |
q | string | Yes | q |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"ads": [
{
"amenities": [
"Hot tub"
],
"extracted_price": 31,
"gps_coordinates": {
"latitude": -8.545097,
"longitude": 115.48575900000002
},
"link": "https://www.google.com/aclk?sa=l&ai=DChsSEwi48L3VpOuXAxUtakcBHU6xNy0YACICCAEQERo…",
"name": "Bhalance Hotel Retreat",
"overall_rating": 4.7,
"price": "$31",
"property_token": "CgsI1eid…",
"reviews": 167,
"source": "Booking.com",
"source_icon": "https://www.gstatic.com/travel-hotels/branding/icon_184.png",
"thumbnail": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTvjG2IR0PzonYXe8V7wELVznFu…"
}
],
"brands": [
{
"children": [
{
"id": 67,
"name": "Banyan Tree"
}
],
"id": 33,
"name": "Accor Live Limitless"
}
],
"properties": [
{
"amenities": [
"Breakfast"
],
"check_in_time": "3:00 PM",
"check_out_time": "12:00 PM",
"deal": "46% less than usual",
"deal_description": "Great Deal",
"description": "Upscale oceanfront retreat with elegant rooms, suites & villas, plus 9 restauran…",
"extracted_hotel_class": 5,
"gps_coordinates": {
"latitude": -8.786196799999999,
"longitude": 115.1392512
},
"hotel_class": "5-star hotel",
"images": [
{
"original_image": "https://lh3.googleusercontent.com/grass-cs/AABkmLc314DkNzZrU8uGbTczw8WfncDhg6d2S…",
"thumbnail": "https://lh3.googleusercontent.com/grass-cs/AABkmLc314DkNzZrU8uGbTczw8WfncDhg6d2S…"
}
],
"link": "https://www.ayana.com/",
"location_rating": 4.1
}
],
"search_information": {
"total_results": 15000
}
}
| Field | Meaning |
|---|---|
properties[].name | Name of the hotel or resort. |
properties[].overall_rating / properties[].reviews | Average guest rating and the total number of reviews for the property. |
properties[].rate_per_night.extracted_display_price / properties[].rate_per_night.extracted_lowest | Nightly price as a number. The first is the displayed price before taxes and fees. The second is the lowest figure, which matches the after_taxes_fees value in the sample. |
properties[].total_rate | Same structure as rate_per_night, with price strings such as display_price and numeric extracted_ versions. |
properties[].deal / properties[].deal_description | Text such as 46% less than usual and a label such as Great Deal. Present only on some properties. |
properties[].hotel_class / properties[].extracted_hotel_class | Star class as text (5-star hotel) and as a number (5). |
properties[].amenities[] / properties[].check_in_time / properties[].check_out_time | Listed amenities and the check-in and check-out times of the property. |
properties[].reviews_breakdown[] | Per-category review counts (positive, neutral, negative, total_mentioned) for topics such as Property, Service and Nature. |
properties[].nearby_places[] | Nearby landmarks, each with a travel type (for example Taxi or Walking) and a duration. |
ads[].name / ads[].extracted_price / ads[].source | Sponsored listings with the hotel name, a numeric price and the booking site shown for the offer. free_cancellation appears on some. |
properties[].property_token / ads[].property_token | Identifier for a single property. |
YYYY-MM-DD.brands array lists hotel brand groups with an id, a name and children sub-brands.$ sign, and each has a matching extracted_ number you can use directly.outputs[0].data.$0.015 per successful call. Failed calls are not charged.
เริ่มสร้าง
เอ็นด์พอยต์ของ Platform API ที่มีการยืนยันตัวตนและการติดตามการใช้งานแบบรวมศูนย์
curl -X POST "https://api.sandbase.ai/v1/api/google-hotels/search" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"q": "Bali Resorts",
"adults": 2,
"check_in_date": "2026-12-15",
"check_out_date": "2026-12-16"
}'ตั้งค่า SandBase API key ของคุณในสภาพแวดล้อมฝั่งเซิร์ฟเวอร์ คำขอจะใช้การยืนยันตัวตนแบบ Bearer
export SANDBASE_API_KEY="YOUR_API_KEY"เก็บ key ไว้บนเซิร์ฟเวอร์ อย่าเปิดเผยในโค้ดฝั่งเบราว์เซอร์
qstringจำเป็นq
check_in_datestringจำเป็นYYYY-MM-DD
check_out_datestringจำเป็นYYYY-MM-DD
adultsintegerจำเป็นadults
บันทึกตัวอย่างการตอบกลับสำหรับ API นี้; จะไม่มีการส่งคำขอจริงเมื่อเปิดดู
ยังไม่มีการเผยแพร่การตอบกลับที่บันทึกไว้ ให้รัน API ใน Playground เพื่อดูการตอบกลับ
สำรวจเพิ่มเติม
| API | ราคา | การตอบกลับ |
|---|---|---|
Google Hotels SearchAPI นี้ Google Hotels | $0.015 ต่อการเรียก | JSON |
Google Hotels | $0.01 ต่อการเรียก | JSON |
Google Hotels | $0.01 ต่อการเรียก | JSON |
Google Hotels | $0.01 ต่อการเรียก | JSON |
Google Hotels | $0.01 ต่อการเรียก | JSON |
คำถาม
ส่งคำขอ POST ไปที่ https://api.sandbase.ai/v1/api/google-hotels/search โดยใส่ SandBase API key ของคุณใน Authorization header (Bearer) และส่งพารามิเตอร์เป็น JSON body คุณยังสามารถลองใช้ได้ใน Playground บนหน้านี้โดยไม่ต้องเขียนโค้ด
$0.015 ต่อครั้ง คิดจากยอดคงเหลือ SandBase ของคุณ คุณจะถูกเรียกเก็บเฉพาะคำขอที่คุณส่งเท่านั้น ไม่มีค่าสมาชิกรายเดือน
ที่ต้องระบุ: q (string), check_in_date (string), check_out_date (string) และ adults (integer). ตาราง Parameters และ Playground ในหน้านี้แสดงทุกฟิลด์
การตอบกลับ JSON ที่ส่งกลับในคำขอ HTTP เดียวกัน (แบบซิงโครนัส) README บนหน้านี้มีตัวอย่างการตอบกลับ
ไม่จำเป็น Google Hotels Search ทำงานผ่าน SandBase ดังนั้น SandBase API key เดียวครอบคลุม endpoint นี้และทุก API กับโมเดลอื่นในแค็ตตาล็อก คุณไม่ต้องสมัครขอสิทธิ์เข้าถึง Google Hotels API แยกต่างหาก