SearchApi icon

SearchApi

Access real-time search results from Google, Google Images, Google Maps, Google Shopping and more. Use this when you need current, up-to-date information, product searches, location data, or visual content that may not be available in your training data.

Actions4

Overview

The Google Images Search operation allows users to perform real-time image searches using Google's search engine. It is designed to retrieve images based on a query string and various optional filters and settings, such as geographic location, language, image size, color, type, and usage rights. This node is beneficial when you need to automate the retrieval of relevant images for content creation, marketing, research, or any workflow requiring up-to-date visual content.

Practical examples include:

  • Automatically fetching images related to a product name for e-commerce listings.
  • Gathering images filtered by color or aspect ratio for design inspiration.
  • Searching for images within a specific country or language context.
  • Filtering images by usage rights to ensure compliance with licensing.

Properties

Name Meaning
Query The search query string. Supports regular Google search syntax including advanced parameters like inurl:, site:, intitle:, as_dt, and as_eq.
Location & Language Settings Collection of settings to control the origin and language of the search results:
- Geographic Location: Approximate location from which the search originates.
- Encoded Location: Google encoded location (cannot be used with Geographic Location).
- Country: Country code to restrict search results.
- Interface Language: Language of the search interface.
Search Filters Collection of filters to refine search results:
- Content Filter: Enable/disable duplicate content and host crowding filters.
- Country Restriction: Restrict results to documents from a specific country.
- Encoded Filters: Encoded URL restrictions (e.g., size, color).
- Language Restriction: Restrict results by document language.
- No Auto-Correction: Include or exclude auto-corrected queries.
- SafeSearch: Enable or disable filtering of adult content.
Image Options Collection of image-specific filters:
- Aspect Ratio: Filter images by shape (square, tall, wide, panoramic).
- Color Filter: Filter images by color (black, white, red, blue, etc.).
- Image Size: Filter by image size (icon, large, larger than specified resolutions).
- Image Type: Filter by type (clipart, face, gif, line drawing, photo).
- Time Period: Restrict results by date (last hour, day, week, month, year).
- Usage Rights: Filter by license type (commercial or Creative Commons).
Technical Settings Collection of technical parameters:
- Device Type: Specify device type for search (desktop, mobile, tablet).
- Google Domain: Specify Google domain to use (e.g., google.com).
- Page Number: Specify which page of results to return.

Output

The node outputs JSON data containing the search results from Google Images. Each item in the output typically includes metadata about an image such as its URL, title, source, thumbnail, and possibly licensing information depending on the filters applied.

If binary data output is supported (not explicitly stated), it would represent the actual image files retrieved from the search results.

Dependencies

  • Requires an API key credential for accessing the SearchAPI service.
  • The node sends requests to the SearchAPI endpoint at https://www.searchapi.io/api/v1/search.
  • Proper configuration of the API key credential in n8n is necessary.
  • Internet access is required to reach the external SearchAPI service.

Troubleshooting

  • Quota Limits: Users may hit the free quota limit of 100 requests per month. In this case, upgrading the plan or waiting for quota reset is necessary.
  • Invalid Query: If the query parameter is empty or malformed, the node may return errors or no results. Ensure the query string is valid.
  • Conflicting Parameters: Using both "Geographic Location" and "Encoded Location" simultaneously will cause conflicts; only one should be set.
  • Unsupported Country or Language Codes: Using unsupported or incorrect codes for country (gl), language (hl or lr), or country restriction (cr) may result in no results or errors.
  • SafeSearch Misconfiguration: Setting SafeSearch incorrectly might filter out desired results or allow unwanted content.
  • Page Number Out of Range: Requesting a page number beyond available results may return empty results.

Links and References

Discussion