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 Google Images searches and retrieve live image search data. It is designed to fetch structured results from Google Images based on a variety of search parameters, enabling users to automate image retrieval tasks within their workflows.

Common scenarios where this node is beneficial include:

  • Automatically gathering images related to specific topics or keywords for content creation.
  • Monitoring visual trends by searching images filtered by date, color, size, or license.
  • Enriching datasets with relevant images for marketing, research, or e-commerce applications.
  • Filtering images by usage rights to ensure compliance with copyright requirements.

Practical example:

  • A marketing team wants to collect recent high-resolution photos of "coffee" from the US region, filtering only free-to-use images. They can configure this node with the query "coffee", set the country to "us", specify image size as "large", and filter licenses to "free to use or share".

Properties

Name Meaning
Search Query (q) The main search term or phrase to find images for. Example: "coffee".
Additional Fields A collection of optional parameters to refine the image search. These include:
- Location (location) Origin location for the search. See SerpApi docs for supported locations.
- Encoded Location (uule) Google encoded location string; cannot be used together with location.
- Domain (google_domain) Google domain to use for the search, e.g., google.com, google.co.uk, etc.
- Country (gl) Country code to localize the search, e.g., "us" for United States, "gb" for United Kingdom.
- Language (hl) Language code for the search interface, e.g., "en" for English, "fr" for French.
- Set Multiple Countries (cr) Limit search to multiple 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 range filtering.
- Search Range End (as_nhi) End value for numeric range filtering.
- 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 values).
- Related URL (as_rq) Results related to a specified URL.
- Site Search (as_sitesearch) Restrict results to a given site or exclude it depending on as_dt.
- Time Period Unit (period_unit) Unit of time for recent image filtering, e.g., seconds, minutes, hours, days, weeks, months, years. Cannot be combined with start/end dates. Defaults to "year".
- Time Period Value (period_value) Numeric value for the time period unit, e.g., 15 for 15 days.
- Start Date (start_date) Start date for limiting image search (format YYYYMMDD). Cannot be combined with period_unit/period_value.
- End Date (end_date) End date for limiting image search (format YYYYMMDD). Cannot be combined with period_unit/period_value.
- Image search filter (chips) Filter images by suggested search chips provided by Google, e.g., "red apple".
- 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. Default is Square.
- Image Size Filtering (imgsz) Filter images by size: Icon, Large, Medium, or various megapixel thresholds. Default is Large.
- Image Color Filtering (image_color) Filter images by color: Black, Blue, Brown, Gray, Green, Orange, Pink, Purple, Red, Teal, Transparent, White, Yellow, Black and white. Default is Black and white.
- Image Type Filtering (image_type) Filter images by type: Animated, Clip art, Face, Line drawing, Photo. Default is Photo.
- Usage Rights Filtering (licenses) Filter images by license scope: Commercial, Creative Commons, Free to use/share, etc. Default is Free to use or share.
- 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. Default false (include them).
- Results Filtering (filter) Enable or disable filters for 'Similar Results' and 'Omitted Results'. Default true (enabled).
- Page Number (images) (ijn) Page number for image results; each page contains 100 images.
- Device (device) Device type for search results: desktop (default), tablet, or mobile.
- Disable Caching (no_cache) Force fetching new results ignoring cache. Default false (allow cached results). Cannot be used with async.
- Async (async) Perform search asynchronously. Default false. Cannot be used with no_cache or on accounts with Ludicrous Speed enabled.
- ZeroTrace Mode (zero_trace) Enterprise-only mode to skip storing search metadata on SerpApi servers. Default false.
- Output (output) Format of final output: JSON (default) or raw HTML.
- JSON Restrictor (json_restrictor) Restrict fields returned in JSON response, e.g., limit to first 3 organic results with title and snippet only.

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 attributes.

If configured to output raw HTML, the node returns the full HTML content retrieved from the search instead of structured JSON.

No binary data output is indicated for this operation.

Dependencies

  • Requires an active SerpApi account and a valid API key credential for authentication.
  • The node sends HTTP requests to SerpApi's endpoint at https://serpapi.com/search.json.
  • Proper configuration of the API key credential in n8n is necessary.
  • Internet access is required for the node to communicate with SerpApi.

Troubleshooting

  • Invalid API Key or Authentication Errors: Ensure the API key credential is correctly configured and has sufficient permissions.
  • Empty or No Results: Verify the search query and filters are correct. Some combinations of filters may yield no results.
  • Conflicting Parameters: For example, do not use both location and uule simultaneously; similarly, avoid combining period_unit/period_value with start_date/end_date.
  • Rate Limits or Quotas Exceeded: SerpApi enforces usage limits; monitor your account usage to avoid hitting limits.
  • Async and no_cache Conflict: Do not enable both async and no_cache options together.
  • Unsupported Domains or Locations: Use only supported Google domains and location codes as per SerpApi documentation.
  • Incorrect Date Formats: Dates must be in YYYYMMDD format without separators.

Links and References

Discussion