Overview
This node performs Google Custom Search operations, specifically enabling users to execute search queries using a custom search engine ID. It is useful for automating web searches within workflows, extracting relevant search results programmatically, and integrating Google search capabilities into automation pipelines.
Common scenarios include:
- Retrieving search results for specific queries in bulk.
- Filtering search results by country, date, file type, or other criteria.
- Performing image searches with detailed filtering options.
- Automating data collection from Google search results for analysis or reporting.
For example, a user can input a query like "latest technology trends" and receive structured search results limited to a certain number or all available results, optionally filtered by date or region.
Properties
| Name | Meaning |
|---|---|
| Search Engine ID | The custom search engine ID to use for this request. |
| Query | The search query string to perform the search. |
| Return All Results | Whether to return all available search results or only up to a specified limit. |
| Limit | Maximum number of search results to return (used if "Return All Results" is false). Range: 1-100. |
| Additional Fields | Collection of optional parameters to refine the search: |
| - Country Restriction (cr) | Restricts results to documents originating from a specific country. |
| - Date Restrict | Limits results based on date ranges (e.g., d[number], w[number], m[number], y[number]). |
| - Exact Terms | Phrase that must appear in all returned documents. |
| - Exclude Terms | Words or phrases that should not appear in any returned documents. |
| - File Type | Restricts results to files of a specific extension (e.g., pdf, ppt, svg). |
| - GL Parameter | Geolocation of the end user as a two-letter country code. |
| - Google Domain | The Google domain to use for the search (e.g., google.com, google.de). Default is www.google.com. |
| - High Range | Specifies the ending value for a numeric search range. |
| - HL Parameter | Sets the user interface language for the search. |
| - Image Color Type | Filters images by color type: Color, Gray Scale, Monochrome, Transparent. |
| - Image Dominant Color | Filters images by dominant color: Black, Blue, Brown, Gray, Green, Pink, Purple, Teal, White, Yellow. |
| - Image Size | Filters images by size: Extra Large, Icon, Large, Medium, Small, Extra Large (2MP), Extra Extra Large (4MP). |
| - Image Type | Filters images by type: Clip Art, Face, Line Drawing, News, Photo, Animated. |
| - Link Site | Requires all search results to contain a link to a particular URL. |
| - Low Range | Specifies the starting value for a numeric search range. |
| - Number (num) | Number of search results to return per request (max 10). |
| - Rights | Filters results based on licensing (e.g., public domain, attribution required, share alike). |
| - Safe | Search safety level: Active or Off. |
| - Search Type | Specifies the search type; currently supports "Image". |
| - Site Search | Specifies a site to include or exclude in the search results. |
| - Site Search Filter | Controls whether to include or exclude results from the specified site. Options: Include, Exclude. |
| - Sort | Sort expression to apply to the results. |
| - Start | Index of the first result to return (pagination). Range: 1-91. |
Output
The node outputs an array of JSON objects representing individual search results retrieved from the Google Custom Search API. Each item corresponds to one search result and contains fields such as title, snippet, link, and other metadata provided by the API.
If the search type is set to "image," the results will include image-specific metadata.
No binary data output is produced by this node.
Dependencies
- Requires an API key credential with access to the Google Custom Search API.
- The node uses OAuth tokens for authorization, so proper OAuth credentials setup in n8n is necessary.
- External dependency: Axios library is used internally to make HTTP requests to the Google Custom Search API endpoint (
https://www.googleapis.com/customsearch/v1).
Troubleshooting
Common issues:
- Invalid or missing API credentials will cause authentication errors.
- Exceeding the Google Custom Search API quota limits may result in rate limiting errors.
- Incorrect or invalid search engine ID will lead to no results or API errors.
- Providing invalid parameter values (e.g., out-of-range start index or limit) may cause API errors.
Error messages:
- Authentication errors: Ensure the API key and OAuth tokens are correctly configured.
- Quota exceeded: Check Google Cloud Console for usage limits and increase quota if needed.
- No results found: Verify the search query and search engine ID.
- Parameter validation errors: Review input properties for correct types and valid values.