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 a Google Lens search based on an image URL. It allows users to send an image URL and retrieve detailed search results related to that image using Google's Lens technology. This is useful for scenarios such as identifying objects, landmarks, products, or text within images, enabling automated image recognition workflows.

Practical examples include:

  • Automatically identifying products from images in e-commerce workflows.
  • Extracting information about landmarks or places from photos.
  • Performing visual searches to gather related data or metadata about an image.

Properties

Name Meaning
Image URL (url) The URL of the image to perform the Google Lens search on. This is a required string input.
Additional Fields A collection of optional parameters to customize the search:
- Language (hl) The language code to use for the search interface and results. Options include many languages such as English (en), Spanish (es), French (fr), Chinese (zh-cn), Arabic (ar), and many others. Default is "en".
- Country (country) The country code to specify the location context for the search. Options include US (us), UK (gb), Canada (ca), Germany (de), India (in), and many more. Default is "us".
- Page Token (page_token) Token to retrieve results from a specific tab in Google Lens, used for pagination or specific result sets.
- Disable Caching (no_cache) Boolean flag to force fetching new results instead of cached ones. Cached results expire after 1 hour. Default is false. Cannot be used together with async.
- Async (async) Boolean flag to perform the search asynchronously. If true, the search is submitted and results must be retrieved later via Search Archive API. Default is false. Cannot be used with no_cache or on accounts with Ludicrous Speed enabled.
- ZeroTrace Mode (zero_trace) Boolean flag to enable ZeroTrace mode (enterprise only), which skips storing search parameters and metadata on SerpApi servers. Default is false. May make debugging harder.
- Output (output) Defines the format of the final output. Can be "json" (default) for structured JSON results or "html" for raw HTML content.
- JSON Restrictor (json_restrictor) Allows restricting the fields returned in the JSON response, e.g., limiting to certain fields or number of results.

Output

The node outputs a JSON object containing the structured results of the Google Lens search. The exact structure depends on the query and options but typically includes recognized entities, descriptions, links, and other metadata related to the image content.

If the output option is set to "html", the node returns the raw HTML content retrieved from the search.

No binary data output is indicated for this operation.

Dependencies

  • Requires an active SerpApi account with a valid API key credential configured in n8n.
  • Internet access to call the SerpApi endpoint at https://serpapi.com/search.json.
  • No additional external dependencies are needed beyond the API key.

Troubleshooting

  • Invalid or missing API key: Ensure the API key credential is correctly set up in n8n; otherwise, requests will fail authentication.
  • Invalid image URL: The provided image URL must be accessible and valid; otherwise, the search may return errors or empty results.
  • Conflicting parameters: Using no_cache and async together is not allowed and will cause errors.
  • Async usage restrictions: Async mode cannot be used with accounts that have Ludicrous Speed enabled.
  • ZeroTrace mode: Enabling ZeroTrace may complicate debugging due to lack of stored metadata.
  • Rate limits or quota exceeded: SerpApi enforces usage limits; exceeding them will result in errors.
  • Language or country codes: Use valid ISO codes as per the options; invalid codes may cause unexpected results.

Links and References

Discussion