SerpApi Official icon

SerpApi Official

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

Overview

This node integrates with SerpApi's official API to perform Google Autocomplete searches. It sends a search query to Google's autocomplete engine and retrieves suggested completions based on the input text. This is useful for applications that want to provide real-time search suggestions, enhance user search experience, or analyze popular search terms.

Common scenarios include:

  • Building search bars with live autocomplete suggestions.
  • Analyzing trending or common search queries related to a keyword.
  • Enhancing SEO tools by exploring autocomplete data.
  • Creating chatbots or assistants that suggest search queries dynamically.

Example: Given the input "n8n", the node can return autocomplete suggestions like "n8n workflow", "n8n tutorial", etc.

Properties

Name Meaning
Search Query (q) The main search query string for which autocomplete suggestions are requested.
Additional Fields A collection of optional parameters to customize the autocomplete request:
- Country (gl) Country code to localize the search results (e.g., "us" for United States, "de" for Germany). Full list includes all ISO country codes.
- Language (hl) Language code to specify the language of the search results (e.g., "en" for English, "fr" for French). Full list includes many language codes.
- Cursor pointer (cp) Position of the cursor in the query string, influencing autocomplete suggestions.
- Client (client) Defines the client type for autocomplete, such as "chrome", "firefox", "youtube", etc., affecting how results are fetched.
- Disable Caching (no_cache) Boolean flag to force fetching fresh results instead of cached ones. Cached results expire after 1 hour.
- Async (async) Boolean flag to perform the search asynchronously. If true, results must be retrieved later via a separate API call. Not compatible with caching or certain account types.
- ZeroTrace Mode (zero_trace) Boolean flag to enable enterprise mode that skips storing search metadata on SerpApi servers, enhancing privacy but making debugging harder.
- Output (output) Defines output format: "json" for structured JSON (default), or "html" for raw HTML response.
- JSON Restrictor (json_restrictor) String to restrict fields returned in the JSON response, e.g., limiting to specific result fields or number of items.

Output

The node outputs a JSON object containing the autocomplete results from SerpApi. The structure typically includes suggested completions relevant to the input query, along with metadata about the search.

If the output property is set to "json" (default), the output is a parsed JSON object with structured data.

If set to "html", the output contains the raw HTML content retrieved from the autocomplete endpoint.

No binary data output is involved in this operation.

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 network connectivity to SerpApi endpoints is necessary.

Troubleshooting

  • Empty or no suggestions returned: Ensure the search query (q) is not empty and properly formatted. Also verify that the country and language codes are valid.
  • API authentication errors: Confirm that the API key credential is correctly set up and has sufficient permissions.
  • Rate limiting or quota exceeded: SerpApi enforces usage limits; check your account status if requests fail repeatedly.
  • Conflicting parameters: Avoid using async and no_cache together as they are incompatible.
  • Unexpected output format: Verify the output parameter is set correctly; use "json" for structured data.
  • Network issues: Check firewall or proxy settings that might block access to SerpApi.

Links and References

Discussion