SerpApi Official icon

SerpApi Official

Get live Google Search data and more from SerpApi's official node

Overview

The node performs a Google Lens search using the SerpApi service. It allows users to submit an image URL and retrieve search results related to that image, leveraging Google's visual search capabilities. This node is useful for scenarios such as identifying objects, landmarks, products, or text within images, and obtaining relevant information or similar images from the web.

Practical examples include:

  • Automatically identifying products in an e-commerce workflow by submitting product images.
  • Extracting information about landmarks or artworks from photos.
  • Searching for visually similar images or related content based on an input image URL.

Properties

Name Meaning
Image URL (url) The URL of the image to perform the Google Lens search on. This is a required string property.
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), Japanese (ja), 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 A token string to retrieve results from a specific tab or page in Google Lens search results.
- Disable Caching Boolean flag to force fetching new results instead of using cached ones. Defaults to false. Cached searches are free and expire after 1 hour.
- Async Boolean flag to perform the search asynchronously. If true, the search is submitted and results must be retrieved later via a separate API call. Defaults to false. Should not be used with caching enabled or certain account types.
- ZeroTrace Mode Boolean flag to enable ZeroTrace mode (enterprise only), which skips storing search parameters and metadata on SerpApi servers. Defaults to false.
- Output Defines the output format: "json" for structured JSON results (default) or "html" for raw HTML response.
- JSON Restrictor A string to restrict fields in the JSON response, e.g., limiting returned data to specific fields or result counts.

Output

The node outputs a JSON object containing the Google Lens search results as returned by SerpApi. The structure includes various details depending on the search results, such as identified objects, related images, descriptions, and links.

If the output format 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 and an API key credential configured in n8n.
  • The node sends HTTP requests to SerpApi's endpoint https://serpapi.com/search.json.
  • Proper network access to SerpApi service is necessary.

Troubleshooting

  • Common issues:

    • Invalid or missing image URL will cause the search to fail.
    • Incorrect or expired API key credential will result in authentication errors.
    • Using incompatible combinations of async and no_cache options may cause errors.
    • Exceeding SerpApi usage limits or quota can lead to request failures.
  • Error messages:

    • Authentication errors typically indicate invalid API credentials; verify and update your API key.
    • Parameter validation errors suggest missing required fields like the image URL.
    • Rate limit exceeded errors mean you have hit your monthly or per-second query limits; consider upgrading your plan or reducing request frequency.

Links and References

Discussion