SerpApi Official icon

SerpApi Official

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

Overview

The node provides an interface to perform searches using SerpApi's official API, specifically supporting a variety of search engines and specialized Google search modes. The "Google AI Mode" operation allows users to send queries to Google's AI-powered search engine via SerpApi, retrieving live search results enhanced by AI capabilities.

This node is beneficial for scenarios where you want to programmatically access Google's AI-enhanced search results without dealing with scraping or direct API complexities. For example, it can be used to:

  • Automate research by querying complex questions and receiving structured answers.
  • Integrate AI-powered search results into chatbots or virtual assistants.
  • Extract summarized or AI-interpreted data from Google searches in multiple languages.

Properties

Name Meaning
Search Query (q) The main query string you want to search using Google AI Mode. You can use any query as you would in a regular Google AI Mode search. Supports multiple languages (not all available yet).
Additional Fields A collection of optional parameters to customize the search:
- Location (location) Defines the geographic location from which the search should originate. See SerpApi's locations API documentation for supported values.
- Encoded Location (uule) Google encoded location parameter. Cannot be used together with location.
- Device (device) Specifies the device type for the search user agent. Options: desktop (default), tablet, or mobile.
- Disable Caching (no_cache) Boolean flag to force fetching fresh results instead of cached ones. Defaults to false. Cached results are free and expire after 1 hour. Cannot be used together with async.
- Async (async) Boolean flag to perform the search asynchronously. Defaults to false. If true, the search is submitted and results must be retrieved later via Search Archive API. Cannot be used with no_cache or on accounts with Ludicrous Speed enabled.
- ZeroTrace Mode (zero_trace) Enterprise-only boolean flag to disable storing search parameters, files, and metadata on SerpApi servers. Defaults to false. May make debugging harder.
- Output (output) Defines the format of the final output. Options: json (default) for structured JSON results, or html for raw HTML content.
- JSON Restrictor (json_restrictor) Allows restricting the fields returned in the JSON response. For example, organic_results[0:3].{title,snippet} returns only the title and snippet of the first 3 organic results. Defaults to empty (no restriction).

Output

The node outputs the search results in the json field of the output data. Depending on the output property:

  • If json is selected (default), the output contains a structured JSON object representing the search results as returned by SerpApi's Google AI Mode endpoint. This includes various fields such as organic results, snippets, related questions, and more depending on the query and parameters.
  • If html is selected, the output contains the raw HTML content retrieved from the search.

The node does not output binary data.

Dependencies

  • Requires an active SerpApi account and an API key credential configured in n8n.
  • The node makes HTTP requests to https://serpapi.com/search.json.
  • Proper configuration of the API key credential in n8n is necessary for authentication.
  • Some features like ZeroTrace mode require enterprise-level access on SerpApi.
  • Usage limits and caching behavior depend on the SerpApi plan.

Troubleshooting

  • Common Issues:

    • Using both location and uule parameters simultaneously will cause errors; only one should be set.
    • Setting both no_cache and async to true is invalid and will result in request failure.
    • Enabling async on accounts with Ludicrous Speed enabled is not supported.
    • Incorrect or missing API key credential will cause authentication failures.
    • Invalid or unsupported location codes may lead to no results or errors.
  • Error Messages:

    • Authentication errors typically indicate missing or invalid API keys.
    • Parameter validation errors occur if mutually exclusive options are set together.
    • Rate limit exceeded errors mean the monthly search quota has been reached.
  • Resolutions:

    • Verify API key credential setup in n8n.
    • Ensure only one of location or uule is provided.
    • Avoid combining no_cache and async flags.
    • Check SerpApi account plan and usage limits.
    • Consult SerpApi documentation for valid parameter values.

Links and References

Discussion