Google Search and Review API
Search for hotels by location and automatically fetch Google Reviews for the top result in one seamless request.
Overview
Two APIs in One
This endpoint combines hotel search with review fetching, eliminating the need for multiple API calls and simplifying your integration.
The Google Search and Review endpoint streamlines the hotel discovery process by searching for hotels in a location and automatically fetching Google Reviews for the best matching result. This is perfect for applications that need quick access to both hotel information and customer feedback without managing Place IDs or making multiple requests.
Endpoint URL
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| location | string | Required | Location to search for hotels (e.g., "Bangkok", "Las Vegas", "Paris, France") |
| check_in | string | Required | Check-in date in YYYY-MM-DD format |
| check_out | string | Required | Check-out date in YYYY-MM-DD format |
| adults | integer | Optional | Number of adults (1-10). Default: 2 |
| currency | string | Optional | Currency code (e.g., USD, EUR, THB). Default: USD |
| min_rating | float | Optional | Minimum hotel rating filter (1.0-5.0) |
| reviews_sort_by | string | Optional | Sort order for reviews. Options: newest, most_relevant (default), highest_rating, lowest_rating |
Response Structure
Success Response (200 OK)
{
"success": true,
"location": "Bangkok",
"check_in": "2025-02-15",
"check_out": "2025-02-17",
"hotel": {
"name": "The Peninsula Bangkok",
"place_id": "ChIJhwz69lSe4jARZBQEUn3n2x0",
"overall_rating": 4.7,
"reviews": 3845,
"price_per_night": "$285",
"total_price": "$570",
"location": {
"lat": 13.7215,
"lng": 100.5171
},
"address": "333 Charoennakorn Rd, Khlong San, Bangkok 10600, Thailand",
"amenities": [
"Free WiFi",
"Pool",
"Spa",
"Fitness center",
"Restaurant",
"Bar"
],
"images": [
"https://lh5.googleusercontent.com/..."
],
"star_rating": 5
},
"reviews": [
{
"review_id": "ChdDSUhNMG9nS0VJQ0FnSURiOTlySm1RRRAB",
"author_name": "Sarah Johnson",
"rating": 5,
"date": "2 weeks ago",
"review_text": "Exceptional service and stunning river views...",
"likes": 8,
"response_from_owner": "Thank you for choosing The Peninsula Bangkok..."
}
],
"total_reviews": 3845,
"reviews_next_page_token": "CAESBkVnSUlDZw==",
"search_metadata": {
"total_hotels_found": 1250,
"search_datetime": "2025-01-25T10:30:00Z"
}
}
Response Fields
- hotel: Complete hotel information including name, price, amenities, and location
- place_id: Google Place ID for fetching additional reviews
- reviews: Array of Google Reviews for the hotel
- total_reviews: Total number of reviews available
- reviews_next_page_token: Token to fetch more reviews using the reviews endpoint
Common Use Cases
🔍 Quick Hotel Discovery
Enable users to search for hotels and immediately see authentic reviews without additional steps or API calls.
# User searches for hotels in a destination
result = search_and_review('Paris', check_in, check_out)
display_hotel_card(result['hotel'])
display_review_summary(result['reviews'])
📱 Mobile App Integration
Minimize API calls and reduce latency in mobile applications by fetching hotel and review data in one request.
// Single API call for hotel + reviews
const data = await searchHotelWithReviews(location, dates);
// Update UI with both hotel info and reviews
updateHotelView(data.hotel);
updateReviewsSection(data.reviews);
🎯 Location-Based Recommendations
Build recommendation systems that consider both hotel features and customer sentiment from reviews.
# Get top-rated hotels with positive reviews
locations = ['Bangkok', 'Phuket', 'Chiang Mai']
recommendations = []
for loc in locations:
data = search_and_review(loc, dates, min_rating=4.5)
if data['hotel']['overall_rating'] >= 4.5:
recommendations.append(data)
How It Works
-
1
Search Hotels
The API searches for hotels in the specified location using Google Hotels data
-
2
Extract Place ID
The Google Place ID is extracted from the top search result
-
3
Fetch Reviews
Google Reviews are fetched using the extracted Place ID
-
4
Combined Response
Hotel information and reviews are returned in a single response
Error Handling
| Code | Type | Description |
|---|---|---|
| 400 | INVALID_DATE_FORMAT | Date not in YYYY-MM-DD format |
| 400 | INVALID_DATES | Check-out date is before check-in date |
| 400 | PAST_DATES | Check-in date is in the past |
| 404 | NO_HOTELS_FOUND | No hotels found for the specified location |
| 429 | RATE_LIMITED | Too many requests. Please retry after the specified time |
| 502 | UPSTREAM_ERROR | Error fetching data from Google |
Pro Tips
-
💡
Use specific locations: More specific locations (e.g., "Downtown Bangkok" vs "Bangkok") return more relevant results
-
💡
Cache Place IDs: Store the returned place_id to fetch updated reviews later without searching again
-
💡
Filter by rating: Use min_rating to ensure only high-quality hotels are returned
-
💡
Review sorting: Use 'newest' to get recent feedback or 'highest_rating' for social proof
Related Endpoints
curl -X GET "https://api.stayapi.com/v1/google_reviews/search-and-review?location=Bangkok&check_in=2025-02-15&check_out=2025-02-17" \ -H "X-API-Key: YOUR_API_KEY"
const params = new URLSearchParams({ location: "Bangkok", check_in: "2025-02-15", check_out: "2025-02-17", currency: "THB", reviews_sort_by: "newest" }); const response = await fetch( `https://api.stayapi.com/v1/google_reviews/search-and-review?${params}`, { headers: { "X-API-Key": "YOUR_API_KEY" } } ); const data = await response.json(); console.log(`Found hotel: ${data.hotel.name}`); console.log(`Rating: ${data.hotel.overall_rating} (${data.hotel.reviews} reviews)`); console.log(`Price: ${data.hotel.price_per_night}/night`); // Display top reviews data.reviews.forEach(review => { console.log(`${review.author_name}: ${review.rating} stars - ${review.review_text}`); });
import requests params = { "location": "Bangkok", "check_in": "2025-02-15", "check_out": "2025-02-17", "currency": "THB", "min_rating": 4.0, "reviews_sort_by": "newest" } response = requests.get( "https://api.stayapi.com/v1/google_reviews/search-and-review", params=params, headers={"X-API-Key": "YOUR_API_KEY"} ) data = response.json() hotel = data["hotel"] print(f"Hotel: {hotel['name']}") print(f"Rating: {hotel['overall_rating']} ({hotel['reviews']} reviews)") print(f"Price: {hotel['price_per_night']}/night") print(f"Place ID: {hotel['place_id']}") # Process reviews for review in data["reviews"]: print(f"\n{review['author_name']} - {review['rating']} stars") print(review['review_text'][:200] + "...") # Get more reviews if needed if data.get("reviews_next_page_token"): # Use the place_id to fetch more reviews more_reviews = fetch_more_reviews(hotel["place_id"], data["reviews_next_page_token"])
$params = [ "location" => "Bangkok", "check_in" => "2025-02-15", "check_out" => "2025-02-17", "currency" => "THB" ]; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://api.stayapi.com/v1/google_reviews/search-and-review?" . http_build_query($params)); curl_setopt($ch, CURLOPT_HTTPHEADER, ["X-API-Key: YOUR_API_KEY"]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); $data = json_decode($response, true); $hotel = $data["hotel"]; echo "Hotel: " . $hotel["name"] . "\n"; echo "Rating: " . $hotel["overall_rating"] . " (" . $hotel["reviews"] . " reviews)\n"; echo "Price: " . $hotel["price_per_night"] . "/night\n"; // Display reviews foreach ($data["reviews"] as $review) { echo $review["author_name"] . ": " . $review["rating"] . " stars\n"; echo substr($review["review_text"], 0, 200) . "...\n\n"; }
{ "success": true, "location": "Bangkok", "check_in": "2025-02-15", "check_out": "2025-02-17", "hotel": { "name": "The Peninsula Bangkok", "place_id": "ChIJhwz69lSe4jARZBQEUn3n2x0", "overall_rating": 4.7, "reviews": 3845, "price_per_night": "$285", "total_price": "$570", "location": { "lat": 13.7215, "lng": 100.5171 }, "address": "333 Charoennakorn Rd, Khlong San, Bangkok 10600, Thailand", "amenities": [ "Free WiFi", "Pool", "Spa", "Fitness center", "Restaurant", "Bar" ], "images": [ "https://lh5.googleusercontent.com/..." ], "star_rating": 5 }, "reviews": [ { "review_id": "ChdDSUhNMG9nS0VJQ0FnSURiOTlySm1RRRAB", "author_name": "Sarah Johnson", "rating": 5, "date": "2 weeks ago", "review_text": "Exceptional service and stunning river views. The staff went above and beyond to make our stay memorable.", "likes": 8, "response_from_owner": "Thank you for choosing The Peninsula Bangkok..." }, { "review_id": "ChdDSUhNMG9nS0VJQ0FnSURiOTlySm1RRRAC", "author_name": "Michael Chen", "rating": 4, "date": "3 weeks ago", "review_text": "Beautiful property with excellent facilities. The only minor issue was the wait time at the restaurant.", "likes": 2 } ], "total_reviews": 3845, "reviews_next_page_token": "CAESBkVnSUlDZw==", "search_metadata": { "total_hotels_found": 1250, "search_datetime": "2025-01-25T10:30:00Z" } }
{ "type": "https://api.stayapi.com/errors/no-hotels-found", "title": "No Hotels Found", "status": 404, "detail": "No hotels found for the specified location", "instance": "/v1/google_reviews/search-and-review", "provider": "google_hotels", "error_code": "NO_HOTELS_FOUND", "correlation_id": "req_xyz789", "location": "Atlantis City" }