SerpApi Official icon

SerpApi Official

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

Overview

This node enables users to perform Google Images searches using SerpApi's official API. It allows querying Google Images with a wide range of customizable parameters such as search query, location, language, image size, color, type, usage rights, and more. This node is beneficial for workflows that require automated retrieval of image search results from Google, such as content curation, market research, or media monitoring.

For example, you can use this node to:

  • Search for images related to "coffee" filtered by large size and black-and-white color.
  • Retrieve recent images from a specific country or region.
  • Filter images by license type for commercial reuse.
  • Paginate through multiple pages of image results.

Properties

Name Meaning
Search Query (q) The main search term or phrase to find images for.
Additional Fields A collection of optional parameters to refine the search:
- Location (location) Origin location for the search (see SerpApi locations API for supported values).
- Encoded Location (uule) Google encoded location string; mutually exclusive with location.
- Domain (google_domain) Google domain to use for the search (e.g., google.com, google.co.uk).
- Country (gl) Country code to tailor search results geographically.
- Language (hl) Language code for the search interface and results.
- Set Multiple Countries (cr) Limit search to one or more countries using country codes separated by `
- Include/Exclude Site (as_dt) Control inclusion or exclusion of results from a specific site.
- Required Phrase (as_epq) Phrase that must appear in all documents returned.
- Excluded Word/Phrase (as_eq) Words or phrases to exclude from results.
- Link to URL (as_lq) Results must contain a link to this URL.
- Search Range Start (as_nlo) Start value for numeric search range.
- Search Range End (as_nhi) End value for numeric search range.
- Additional Search Terms (as_oq) Additional terms where at least one must appear in results.
- Search Terms (as_q) Additional search terms to check for in documents.
- Time Period (as_qdr) Quick date range filter for results (see SerpApi docs for supported values).
- Related URL (as_rq) Results related to a specified URL.
- Site Search (as_sitesearch) Restrict results to a given site or exclude it based on as_dt.
- Time Period Unit (period_unit) Unit of time for recent image filtering (second, minute, hour, day, week, month, year). Cannot be used with start/end dates.
- Time Period Value (period_value) Numeric value for the time period unit.
- Start Date (start_date) Start date for limiting search results (format YYYYMMDD). Cannot be used with period_unit/value.
- End Date (end_date) End date for limiting search results (format YYYYMMDD). Cannot be used with period_unit/value.
- Image search filter (chips) Filter images by suggested search chips provided by Google.
- Advanced Search Parameter (tbs) Advanced search parameters not possible in regular query field.
- Aspect Ratio Filtering (imgar) Filter images by aspect ratio: Square, Tall, Wide, Panoramic.
- Image Size Filtering (imgsz) Filter images by size: Icon, Large, Medium, and various megapixel thresholds.
- Image Color Filtering (image_color) Filter images by color: Black, White, Blue, Red, etc.
- Image Type Filtering (image_type) Filter images by type: Animated, Clip art, Face, Line drawing, Photo.
- Usage Rights Filtering (licenses) Filter images by license scope: Commercial, Creative Commons, Free to use/share, etc.
- Adult Content Filtering (safe) Level of adult content filtering: Active (default) or Off.
- Exclude Auto-corrected Results (nfpr) Whether to exclude results from auto-corrected queries. Boolean.
- Results Filtering (filter) Enable or disable filters for similar and omitted results. Boolean.
- Page Number (images) (ijn) Page number for pagination (100 images per page).
- Device (device) Device type for search: desktop, tablet, mobile.
- Disable Caching (no_cache) Force fresh results ignoring cache. Boolean.
- Async (async) Perform search asynchronously. Boolean.
- ZeroTrace Mode (zero_trace) Enterprise mode to skip storing search metadata on servers. Boolean.
- Output (output) Format of output: JSON (default) or raw HTML.
- JSON Restrictor (json_restrictor) Restrict fields in JSON response (e.g., only first 3 organic results' titles and snippets).

Output

The node outputs a JSON object containing the structured results of the Google Images search as returned by SerpApi. This includes metadata about the search, an array of image results with details such as image URLs, thumbnails, titles, source links, and other relevant information.

If the output format is set to html, the node returns the raw HTML content retrieved from the search instead of JSON.

No binary data output is indicated for this operation.

Dependencies

  • Requires an active SerpApi account and a valid API key credential configured in n8n.
  • The node makes HTTP requests to SerpApi's endpoint https://serpapi.com/search.json.
  • Proper internet connectivity is required to reach SerpApi services.

Troubleshooting

  • Invalid API Key or Missing Credentials: The node requires a valid API key credential. Ensure the API key is correctly configured in n8n credentials.
  • Rate Limits or Quotas Exceeded: SerpApi enforces usage limits. If you receive errors related to quota, verify your account status and consider upgrading your plan.
  • Conflicting Parameters: Some parameters cannot be used together, e.g., location and uule, or period_unit with start_date/end_date. Review parameter combinations if the API returns errors.
  • Empty or Unexpected Results: Check the search query and filters. Overly restrictive filters may yield no results.
  • Async and No Cache Flags: These two options should not be enabled simultaneously; doing so may cause errors.
  • Network Issues: Ensure your server or environment has access to the internet and can reach serpapi.com.

Links and References

Discussion