Overview
This node performs Google searches using the Google Custom Search API. It allows users to query Google programmatically and retrieve search results directly within an n8n workflow. This is useful for automating data gathering, monitoring web content, or integrating search capabilities into larger automation processes.
Typical use cases include:
- Automatically fetching search results for specific keywords.
- Filtering search results by language, country, file type, or site.
- Limiting the number of results and paginating through them.
- Using SafeSearch filtering to exclude inappropriate content.
For example, a marketing team could automate competitor analysis by running daily searches on relevant terms and collecting the top results for review.
Properties
| Name | Meaning |
|---|---|
| Query | The search term to use. |
| Number of Results | Number of results to return (1-10). |
| Start Index | Index of the first result to return (for pagination). |
| Language | Language of search results. Options: English, French, German, Italian, Spanish. |
| Country | Country code to geolocate the search (e.g., "fr" for France, "us" for United States). |
| Safe Search | SafeSearch filtering level. Options: Active, Off. |
| File Type | Restrict results to a specific file type (e.g., "pdf"). |
| Site Search | Restrict results to a specific site (e.g., "example.com"). |
Output
The node outputs an array of JSON objects, each representing a search result item with the following fields:
title: The title of the search result.link: The URL link to the search result.text: A snippet or summary text from the search result.image: URL of the main image associated with the result (if available).thumbnail: URL of the thumbnail image (if available).
If no results are found, the output contains a message indicating no results were found along with the original query and some search metadata such as search time and total results count.
The node does not output binary data.
Dependencies
- Requires a valid Google Custom Search API key and a configured search engine ID (cx).
- The user must provide these credentials in n8n via an API key credential.
- The node makes HTTP requests to
https://www.googleapis.com/customsearch/v1to perform searches.
Troubleshooting
Common issues:
- Invalid or missing API key or search engine ID will cause authentication errors.
- Exceeding the Google Custom Search API quota limits may result in rate limiting errors.
- Providing invalid parameter values (e.g., out-of-range number of results) can cause request failures.
- Network connectivity issues can prevent successful API calls.
Error messages:
- Authentication errors typically indicate incorrect or missing API credentials.
- Quota exceeded errors mean the daily limit for API calls has been reached.
- Parameter validation errors suggest that input properties need correction (e.g., number of results must be between 1 and 10).
To resolve errors:
- Verify API credentials are correctly set up in n8n.
- Check Google Cloud Console for API usage and quotas.
- Ensure input parameters conform to allowed ranges and formats.
- Confirm network access to Google's API endpoint.