SerpApi Official icon

SerpApi Official

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

Overview

This node enables users to perform image searches using Bing Images through the SerpApi service. It allows querying Bing's image search engine with various filters and parameters to retrieve relevant images based on a search query. This is useful for automating image retrieval tasks, enriching content with images, or integrating image search capabilities into workflows.

Practical examples include:

  • Automatically fetching images related to a product name for e-commerce listings.
  • Gathering visual content for marketing campaigns based on keywords.
  • Searching for images by size, color, or license type to ensure compliance and relevance.

Properties

Name Meaning
Search Query (q) The main search term or phrase to find images for, similar to what you'd enter in Bing Images search.
Market codes (mkt) The market locale for the search results, e.g., "en-US" for United States English. Determines regional search behavior.
Additional Fields A collection of optional parameters to refine the search:
- Country (cc) Country code to specify the country context for the search. Mutually exclusive with Market codes.
- Result Offset (first) Offset for pagination; defines which result to start from (default is 1).
- Number of Results (count) Number of image results to return per page. This is a suggestion and may not be strictly followed.
- Image Size (imagesize) Filter images by size: Small, Medium, Large, Extra Large.
- Color (color2) Filter images by color, e.g., Black, Blue, Color Only, Gray, etc.
- Type (photo) Filter by image type: Animated GIF, Clipart, Line Drawing, Photo, Transparent.
- Layout (aspect) Filter by image layout: Square, Wide, Tall.
- People (face) Filter images containing people: Faces Only, Head & Shoulders (portrait).
- Date (age) Filter images by upload date: Past 24 hours, Past week, Past month, Past year.
- License (license) Filter images by license type, e.g., All Creative Commons, Free to modify/share/use commercially, Public Domain, etc.
- Device (device) Specify device type for search results: desktop (default), tablet, or mobile.
- Disable Caching (no_cache) Whether to bypass cached results and fetch fresh data (true/false). Cached results expire after 1 hour.
- Async (async) Whether to perform the search asynchronously (true/false). If true, results must be retrieved later via a separate API call.
- ZeroTrace Mode (zero_trace) Enterprise-only option to disable storing search metadata on servers for privacy.
- Output (output) Format of the output: JSON (structured data) or raw HTML.
- JSON Restrictor (json_restrictor) Limits fields returned in the JSON response, e.g., only certain properties of the first few results.

Output

The node outputs a JSON object containing the search results from Bing Images as returned by SerpApi. This includes metadata about each image such as URLs, thumbnails, titles, source pages, and other relevant details depending on the query parameters.

If the output format is set to HTML, the raw HTML content of the Bing Images search results page is returned instead.

Binary data is not directly output by this node; it focuses on structured JSON or HTML responses representing image search results.

Dependencies

  • Requires an active SerpApi account with a valid API key credential configured in n8n.
  • Internet access to reach SerpApi endpoints.
  • No additional external dependencies beyond the SerpApi service.

Troubleshooting

  • Common issues:

    • Missing or invalid API key credential will cause authentication errors.
    • Using mutually exclusive parameters together (e.g., both mkt and cc) may lead to unexpected results or errors.
    • Requesting too many results (count) might be limited by SerpApi quotas or API restrictions.
    • Enabling both async and no_cache simultaneously is disallowed and may cause errors.
  • Error messages:

    • Authentication failures: Verify that the API key credential is correctly set up.
    • Parameter validation errors: Check that mutually exclusive parameters are not used together.
    • Rate limit exceeded: Reduce request frequency or check your SerpApi plan limits.
    • Invalid parameter values: Ensure all options conform to allowed values (e.g., valid market codes, colors).

Links and References

Discussion