SerpApi Official icon

SerpApi Official

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

Overview

The SerpApi Official node provides access to live Google Search data and other search engine results through the SerpApi service. Specifically, for the "Google Trends" operation, it allows users to query Google Trends data programmatically. This includes retrieving interest over time, interest by region, related topics, related queries, and compared breakdowns by region.

This node is beneficial in scenarios where you want to analyze trending search terms, monitor public interest in specific topics over time or across regions, or gather insights about related queries and topics. For example, marketers can track the popularity of a product keyword, researchers can study regional interest variations, and content creators can find related trending topics to target.

Properties

Name Meaning
Search Query (q) The main search term(s) to query Google Trends for. Can be a single query or multiple queries depending on the data type.
Additional Fields A collection of optional parameters to refine the Google Trends search:
- Language (hl) Language code for the search interface (e.g., English 'en', Spanish 'es', French 'fr', etc.).
- Location (geo) Geographic location code to specify the origin of the search. Defaults to worldwide if empty. Includes a comprehensive list of country and region codes.
- Region (region) Specifies the granularity of the region for certain data types: Country, Subregion, Metro, or City. Only applicable for some chart types like "Compared breakdown by region" and "Interest by region".
- Data type (data_type) Type of Google Trends data to retrieve: Interest over time, Compared breakdown by region, Interest by region, Related queries, or Related topics.
- Time Zone (tz) Time zone offset for the search results. Default is 420 (Pacific Day Time).
- Category (cat) Search category filter to narrow down trends to a specific topic area (e.g., Arts & Entertainment, Business & Industrial, Health, Sports, Technology, etc.). Defaults to "All categories".
- Property (gprop) Filters results by Google property such as Google Shopping, Image Search, News Search, Web Search, or YouTube Search.
- Date (date) Defines the date range for the trends data (e.g., "today 12-m" for last 12 months).
- Show CSV (csv) Boolean flag to request results in CSV format instead of JSON.
- Include Low Search Volume Regions (include_low_search_volume) Whether to include regions with low search volume in the results. Only applicable when data_type is "Compared breakdown by region" or "Interest by region".
- Disable Caching (no_cache) If true, forces fetching fresh results ignoring cached data. Cache expires after 1 hour. Cannot be used together with async.
- Async (async) If true, performs the search asynchronously. Results must be retrieved later via Search Archive API. Cannot be used with no_cache or on accounts with Ludicrous Speed enabled.
- ZeroTrace Mode (zero_trace) Enterprise-only option to skip storing search parameters and metadata on SerpApi servers for privacy.
- Output (output) Format of the final output: JSON (default) or raw HTML.
- JSON Restrictor (json_restrictor) Allows restricting fields in the JSON response to reduce payload size (e.g., only first 3 organic results with title and snippet).

Output

The node outputs a JSON object containing the Google Trends data corresponding to the query and parameters specified. The structure depends on the data_type selected:

  • Interest over time: Time series data showing the popularity of the search query over the specified period.
  • Compared breakdown by region: Comparative data showing interest levels across different regions.
  • Interest by region: Interest data broken down by geographic regions.
  • Related queries: Queries related to the main search query.
  • Related topics: Topics related to the main search query.

If the "Show CSV" option is enabled, the output will be in CSV format instead of JSON.

The node does not output binary data.

Dependencies

  • Requires an active SerpApi account and a valid API key credential for authentication.
  • The node sends HTTP requests to the SerpApi endpoint at 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 that the API key credential is correctly configured and has sufficient permissions.
  • Rate Limiting or Quota Exceeded: SerpApi enforces usage limits; exceeding these may cause errors. Monitor your usage and upgrade your plan if needed.
  • Incorrect Parameter Values: Using unsupported or invalid values for parameters like geo, region, cat, or data_type may result in empty or error responses. Refer to SerpApi documentation for valid options.
  • Conflicting Parameters: The no_cache and async parameters cannot be used together. Similarly, async should not be used with accounts having Ludicrous Speed enabled.
  • Empty or Unexpected Results: Some combinations of parameters might not return data if Google Trends does not have information for them. Try adjusting parameters like date range, location, or category.
  • Network Issues: Ensure that your n8n instance can reach https://serpapi.com.

Links and References

Discussion