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 live Google News Light searches. It allows users to query Google News with various parameters to retrieve news articles and related information in real-time. This is useful for monitoring current events, tracking news on specific topics, or gathering news data for analysis.

Practical examples include:

  • Searching for the latest news about a product launch.
  • Monitoring news coverage of a company or competitor.
  • Gathering news articles from specific locations or languages.
  • Filtering news results by date range or site.

Properties

Name Meaning
Search Query (q) The main search query string, supporting any standard Google search syntax such as inurl:, site:, or intitle:. Example: "Coffee".
Location (location) Origin location for the search, specifying where the search should be considered from. See SerpApi's location API docs for supported values.
Encoded Location (uule) Google encoded location parameter. Cannot be used together with location.
Domain (google_domain) Google domain to use for the search, e.g., google.com, google.co.uk, etc. Defaults to google.com.
Country (gl) Country code to use for the search, e.g., us for United States, gb for United Kingdom. Defaults to us.
Language (hl) Language code for the search interface, e.g., en for English, es for Spanish. Defaults to en.
Set Multiple Languages (lr) Limits the search to one or multiple countries using country codes separated by `
Include/Exclude Site (as_dt) Controls whether to include or exclude results from the site specified in as_sitesearch.
Required Phrase (as_epq) Phrase that all documents must contain.
Excluded Word/Phrase (as_eq) Word or phrase that should not appear in any document.
Link to URL (as_lq) All results should contain a link to this URL.
Search Range Start (as_nlo) Starting value for a numeric search range.
Search Range End (as_nhi) Ending value for a numeric search range.
Additional Search Terms (as_oq) Additional terms where each document must contain at least one.
Search Terms (as_q) Additional search terms to check for in documents.
Time Period (as_qdr) Limits results to a specified time period (quick date range).
Related URL (as_rq) Results should be pages related to this URL.
Site Search (as_sitesearch) Limits results to pages from a given site or excludes them if combined with as_dt.
Adult Content Filtering (safe) Level of filtering for adult content; options are active (default) or off.
Exclude Auto-corrected Results (nfpr) Whether to exclude results from auto-corrected queries when the original query was misspelled.
Results Filtering (filter) Whether filters for 'Similar Results' and 'Omitted Results' are enabled (true) or disabled (false).
Result Offset (start) Number of results to skip (offset).
Number of Results (num) Maximum number of results to return.
Device (device) Device type for the search: desktop (default), tablet, or mobile.
Disable Caching (no_cache) Force fetching new results instead of cached ones. Cached results expire after 1 hour. Cannot be used with async.
Async (async) Perform search asynchronously. If true, results must be retrieved later via Search Archive API. Cannot be used with no_cache. Not recommended for accounts with Ludicrous Speed enabled.
ZeroTrace Mode (zero_trace) Enterprise-only mode to skip storing search parameters and metadata on SerpApi servers. May complicate debugging.
Output (output) Format of the output: json (default) for structured JSON or html for raw HTML.
JSON Restrictor (json_restrictor) Restricts fields returned in the response, e.g., organic_results[0:3].{title,snippet} returns only title and snippet of first 3 organic results.

Output

The node outputs a JSON object containing the search results from Google News Light according to the specified query and parameters. The structure typically includes arrays of news articles with fields such as titles, snippets, URLs, publication dates, and sources.

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

No binary data output is indicated for this operation.

Dependencies

  • Requires an active API key credential for SerpApi to authenticate requests.
  • The node sends HTTP requests to https://serpapi.com/search.json.
  • No additional external dependencies are required.
  • Proper configuration of the API key credential in n8n is necessary.

Troubleshooting

  • Invalid API Key or Authentication Errors: Ensure the API key credential is correctly configured and valid.
  • Conflicting Parameters: Using both location and uule simultaneously will cause errors; use only one.
  • Caching Issues: If stale results are returned, consider setting Disable Caching to true to force fresh data.
  • Async Mode Usage: When using async mode, results are not immediately available; you must retrieve them later via the Search Archive API.
  • Rate Limits or Quotas: Exceeding SerpApi usage limits may result in errors; monitor your quota and usage.
  • Unsupported Locations or Languages: Verify that the location and language codes are supported by SerpApi.
  • Malformed Queries: Invalid or malformed search queries can lead to no results or errors; test queries directly on Google to validate.

Links and References

Discussion