SerpApi Official icon

SerpApi Official

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

Overview

This node enables users to perform live Google News Light searches using SerpApi's official API. It is designed to fetch news search results from Google in a lightweight, structured JSON format. This node is beneficial for scenarios where you want to automate the retrieval of current news articles related to specific topics or queries without dealing with complex scraping or parsing.

Practical examples include:

  • Monitoring news about a particular company or product.
  • Gathering recent news articles on a trending topic.
  • Automating content curation workflows by fetching relevant news headlines and snippets.

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) Defines the geographic location from which the search should originate. See SerpApi's locations API documentation for supported values.
Encoded Location (uule) Google encoded location parameter. Cannot be used together with location.
Domain (google_domain) Specifies the Google domain to use for the search, e.g., google.com, google.co.uk, etc. Defaults to google.com.
Country (gl) Defines the country code to use for the Google search, e.g., us for United States, gb for United Kingdom. Defaults to us.
Language (hl) Defines the language code for the search results, e.g., en for English, es for Spanish. Defaults to en.
Set Multiple Languages (lr) Limits the search to one or multiple countries using a special syntax with 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) A phrase that all documents in the search results must contain.
Excluded Word/Phrase (as_eq) Words or phrases that should not appear in any documents in the search results.
Link to URL (as_lq) All search 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 search results to a specified time period (quick date range).
Related URL (as_rq) Search results should be pages related to this URL.
Site Search (as_sitesearch) Limits search results to pages from a given site or excludes them depending on 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 before starting to return results (pagination offset).
Number of Results (num) Maximum number of results to return.
Device (device) Device type to simulate for the search: desktop (default), tablet, or mobile.
Disable Caching (no_cache) If true, forces fetching new results ignoring cached data. Cache expires after 1 hour. Cannot be used with async.
Async (async) If true, performs the search asynchronously, submitting the request and retrieving results 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 option to disable storing search parameters and metadata on SerpApi servers for privacy.
Output (output) Format of the final output: json (default) for structured JSON or html for raw HTML response.
JSON Restrictor (json_restrictor) Restricts fields returned in the JSON 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:

  • Metadata about the search.
  • An array of news articles matching the query, including fields like title, snippet, source, publication date, and URL.
  • Other relevant search result details depending on the parameters.

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

The node does not output binary data.

Dependencies

  • Requires an active SerpApi account and a valid API key credential configured in n8n.
  • Internet access to reach SerpApi's endpoint at https://serpapi.com/search.json.
  • No additional external dependencies beyond the API key and network connectivity.

Troubleshooting

  • Invalid API Key or Missing Credential: The node requires a valid API key credential. Ensure the credential is correctly configured in n8n.
  • Conflicting Parameters: Using both location and uule parameters simultaneously will cause errors. Use only one.
  • Cache and Async Conflict: Setting both no_cache and async to true is invalid. Choose one mode.
  • Exceeded Rate Limits: SerpApi enforces rate limits; exceeding them will result in errors. Monitor usage accordingly.
  • Unsupported Location or Language Codes: Verify that location, country, and language codes are valid per SerpApi documentation.
  • Empty or No Results: Check the search query and parameters for correctness if no results are returned.
  • Network Issues: Ensure n8n has internet access and can reach SerpApi endpoints.

Links and References

Discussion