Google Search API icon

Google Search API

Integrate with Google Search API (Serper.dev API) for search functionalities. Powered by CloudFly

Actions7

Overview

This node integrates with the Google Search API (via Serper.dev) to perform image search operations. Specifically, for the Image resource and Search Images operation, it allows users to search for images on the web based on a query string, with options to customize pagination, number of results, country, language, and autocorrect behavior.

Common scenarios where this node is beneficial include:

  • Automatically retrieving relevant images for content creation or marketing.
  • Building applications that require dynamic image search capabilities.
  • Enriching datasets with image URLs related to specific topics or keywords.

For example, a user can input a search query like "sunset beach" and receive a list of image results from Google tailored to a specific country and language preference.

Properties

Name Meaning
Page Page number for paginated results (e.g., 1, 2, 3...)
Query The search query string to find images (required)
Results Number of image results to return; options: 10, 20, 40, 60, 80, 100
Country Country code to localize the search (e.g., "us" for United States, "de" for Germany, etc.)
Language Language code to specify the language of the search results (e.g., "en" for English, "fr" for French)
Autocorrect Boolean flag to enable or disable autocorrect on the search query

Output

The node outputs an array of JSON objects representing the image search results returned by the Google Search API. Each item in the output corresponds to one image result and contains metadata such as image URLs, titles, descriptions, and other relevant data provided by the API.

No binary data output is produced by this operation.

Dependencies

  • Requires an API key credential for the Serper.dev Google Search API.
  • The node makes authenticated HTTP POST requests to https://google.serper.dev/images endpoint.
  • Proper configuration of the API key credential within n8n is necessary for successful execution.

Troubleshooting

  • Common issues:

    • Invalid or missing API key credential will cause authentication failures.
    • Exceeding API rate limits may result in errors or incomplete results.
    • Incorrect country or language codes might yield unexpected or no results.
    • Providing an empty or invalid query string will likely cause errors.
  • Error messages:

    • Errors from the API are caught and returned as error messages in the output if "Continue On Fail" is enabled.
    • Typical error messages include authentication errors, quota exceeded, or invalid parameters.
  • Resolutions:

    • Ensure the API key credential is correctly set up and valid.
    • Verify the query string is not empty and properly formatted.
    • Use supported country and language codes.
    • Monitor API usage to avoid hitting rate limits.

Links and References

Discussion