SerpApi Official icon

SerpApi Official

Get live Google Search data and more from SerpApi's official node

Overview

This node integrates with SerpApi's Google Hotels search engine to retrieve live hotel and vacation rental data based on user-defined search criteria. It is useful for automating hotel searches, price comparisons, and gathering detailed property information without manually visiting Google Hotels.

Typical use cases include:

  • Travel agencies automating hotel availability and pricing queries.
  • Market researchers analyzing hotel ratings, amenities, and offers.
  • Developers building travel apps that require up-to-date hotel listings.
  • Users wanting to filter hotels by specific parameters like price range, rating, or eco-certification.

For example, a user can search for "Bali Resorts" with specified check-in and check-out dates, filter results by minimum rating and price, and receive structured JSON data about available properties.

Properties

Name Meaning
Search Query (q) The main search query string, e.g., "Bali Resorts". Used as the keyword for the hotel search.
Check-in Date (check_in_date) The check-in date in YYYY-MM-DD format, e.g., "2025-08-05".
Check-out Date (check_out_date) The check-out date in YYYY-MM-DD format, e.g., "2025-08-06".
Additional Fields A collection of optional parameters to refine the search:
- Country (gl) Country code to localize the search, e.g., "us" for United States. Many country options available.
- Language (hl) Language code for the search results, e.g., "en" for English. Multiple language options supported.
- Currency (currency) Currency code for prices, e.g., "USD". Many currency options supported.
- Number of Adults (adults) Number of adults for the booking; defaults to 2.
- Number of Children (children) Number of children; defaults to 0.
- Children's Ages (children_ages) Comma-separated ages of children, matching the number of children, e.g., "5,8,10". Ages range from 1 to 17.
- Sort By (sort_by) Sorting option for results: "Lowest price", "Highest rating", or "Most reviewed".
- Min. Price (min_price) Minimum price filter for results.
- Max. Price (max_price) Maximum price filter for results.
- Property Types (property_types) Filter by property types using comma-separated IDs, e.g., "10,12,20".
- Amenities (amenities) Filter results by amenities using comma-separated IDs, e.g., "5,13,21".
- Guest Rating (rating) Filter by minimum guest rating: "3.5+", "4.0+", or "4.5+".
- Brands (brands) Filter by hotel brands using comma-separated brand IDs, e.g., "33,67,101". Not applicable to Vacation Rentals.
- Hotel Class (hotel_class) Filter by hotel star class, e.g., "2,3,4". Not applicable to Vacation Rentals.
- Free Cancellation (free_cancellation) Boolean to show only results offering free cancellation. Not applicable to Vacation Rentals.
- Special Offers (special_offers) Boolean to show only results with special offers. Not applicable to Vacation Rentals.
- Eco Certified (eco_certified) Boolean to show only eco-certified properties. Not applicable to Vacation Rentals.
- Vacation Rentals (vacation_rentals) Boolean to include vacation rentals in the search results.
- Min. bedrooms (bedrooms) Minimum number of bedrooms for vacation rentals; defaults to 0.
- Min. bathrooms (bathrooms) Minimum number of bathrooms for vacation rentals; defaults to 0.
- Next Page Token (next_page_token) Token to retrieve the next page of results for pagination.
- Property Token (property_token) Token to get detailed information about a specific property, such as name, address, phone, prices, nearby places, etc. Obtained from Google Hotels Properties API.
- JSON Restrictor (json_restrictor) String to restrict fields returned in the JSON response, e.g., organic_results[].{title,snippet} to limit output fields.
- Disable Caching (no_cache) Boolean to force fetching fresh results instead of cached ones. Cached results expire after 1 hour. Cannot be used together with async.
- Async (async) Boolean to perform asynchronous search submission. Requires separate retrieval of results later. Cannot be used with no_cache or on accounts with Ludicrous Speed enabled.
- ZeroTrace Mode (zero_trace) Boolean to enable enterprise-only mode that skips storing search parameters and metadata on SerpApi servers, enhancing privacy but making debugging harder.
- Output (output) Defines the final output format: "json" (default) for structured JSON or "html" for raw HTML content.

Output

The node outputs a JSON object containing the search results from Google Hotels via SerpApi. The structure includes:

  • Lists of hotel or vacation rental properties matching the search criteria.
  • Detailed information per property such as name, address, phone, prices, ratings, amenities, nearby places, and more.
  • Pagination tokens if available for retrieving additional pages.
  • Metadata about the search query and parameters.

If the output format is set to "html," the raw HTML content of the search results page is returned instead of JSON.

No binary data output is produced by this node.

Dependencies

  • Requires an active SerpApi account and a valid API key credential for authentication.
  • The node sends HTTP requests to https://serpapi.com/search.json.
  • No other external dependencies are required.
  • Proper configuration of the API key credential in n8n is necessary.

Troubleshooting

  • Missing or invalid API key: The node will fail if the API key is not provided or incorrect. Ensure the API key credential is configured properly.
  • Invalid date formats: Check-in and check-out dates must be in YYYY-MM-DD format. Invalid formats may cause errors or empty results.
  • Mismatched children ages count: The number of ages provided in children_ages must match the number of children specified.
  • Conflicting parameters: Using both no_cache and async simultaneously is not allowed and will cause errors.
  • Pagination issues: When using next_page_token, ensure it is valid and corresponds to the previous result set.
  • Unsupported filters for vacation rentals: Some filters like brands, hotel_class, free_cancellation, special_offers, and eco_certified do not apply to vacation rentals and may be ignored or cause unexpected results.
  • ZeroTrace mode: Enabling this mode disables logging and caching, which might complicate debugging if issues arise.

Links and References

Discussion