SerpApi Official icon

SerpApi Official

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

Overview

The node provides live Google Finance data by querying SerpApi's official API. It allows users to search for financial information such as stocks, indices, mutual funds, currencies, or futures using a flexible query parameter. This node is beneficial for workflows that require up-to-date financial market data, enabling automation of financial analysis, portfolio monitoring, or integration of stock market insights into business processes.

Practical examples include:

  • Retrieving the latest stock price and historical data for a specific company.
  • Monitoring currency exchange rates in real-time.
  • Fetching financial summaries or charts for investment research.

Properties

Name Meaning
Search Query (q) Defines the search query for financial data. Can be a stock symbol, index, mutual fund, currency, or futures identifier. Example: "GOOGL:NASDAQ".
Additional Fields Optional extra parameters to customize the search:
- Language (hl) Language code for the search results. Options include many languages such as English (en), Spanish (es), French (fr), Chinese Simplified (zh-cn), Japanese (ja), and many others. Default is English (en).
- Time Range (window) Sets the time range for the financial graph. Options: 1 Day, 5 Days, 1 Month, 6 Months, Year to Date, 1 Year, 5 Years, Maximum.
- Disable Caching (no_cache) Boolean flag to force fetching fresh results instead of cached ones. Cached results expire after 1 hour. Default is false (allow cache). Cannot be used with async.
- Async (async) Boolean flag to perform the search asynchronously. If true, the search is submitted and results must be retrieved later via another API. Default is false. Cannot be used with no_cache or on accounts with special speed enabled.
- ZeroTrace Mode (zero_trace) Enterprise-only boolean flag to disable storing search parameters and metadata on the server for privacy. Default is false.
- Output (output) Defines the output format: "json" for structured JSON (default) or "html" for raw HTML response.
- JSON Restrictor (json_restrictor) Allows restricting fields in the JSON response, e.g., limiting to certain result items or fields like titles and snippets.

Output

The node outputs a JSON object containing the search results from Google Finance via SerpApi. The structure includes detailed financial data corresponding to the query, such as stock prices, charts, summaries, and other relevant financial metrics depending on the query and options set.

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

No binary data output is indicated for this operation.

Dependencies

  • Requires an active SerpApi account with a valid API key credential configured in n8n.
  • Internet access to call the SerpApi endpoint at https://serpapi.com/search.json.
  • Proper configuration of the API key credential in n8n to authenticate requests.

Troubleshooting

  • Common Issues:

    • Invalid or missing API key credential will cause authentication errors.
    • Using incompatible combinations of parameters, such as setting both no_cache and async to true, will lead to request failures.
    • Requests with unsupported or malformed queries may return empty or error responses.
    • Exceeding API usage limits can result in rate limiting or quota errors.
  • Error Messages:

    • Authentication errors typically indicate invalid or missing API credentials; verify and update the API key in n8n.
    • Parameter conflict errors occur if no_cache and async are both true; adjust parameters accordingly.
    • Network or timeout errors suggest connectivity issues; ensure stable internet connection.
    • Unexpected response formats may indicate changes in the external API; check SerpApi documentation for updates.

Links and References

Discussion