Finnhub.io icon

Finnhub.io

Consume Finnhub.io API

Overview

The Finnhub.io n8n node allows users to interact with the Finnhub API, a service providing real-time and historical data for stocks, indices, ETFs, forex, cryptocurrencies, and alternative financial data.
For the Stock resource and the Earnings Surprises operation, this node retrieves information about earnings surprises for a specified stock symbol. Earnings surprises are instances where a company's reported earnings differ from analysts' expectations, which can significantly impact stock prices.

Common scenarios:

  • Financial analysts or investors monitoring how companies perform relative to market expectations.
  • Automated workflows that trigger alerts or reports when significant earnings surprises occur.
  • Integrating earnings surprise data into dashboards or further analytics pipelines.

Example:
A user could set up an n8n workflow to fetch Apple Inc.'s (AAPL) latest earnings surprises after each quarterly report and send a summary via email or Slack.

Properties

Name Type Meaning
Symbol String The stock ticker symbol to search for (e.g., "AAPL"). Used to specify the target company.
Premium Boolean Indicates whether you have a Premium Subscription for Finnhub.io. May affect data access or limits.

Output

The node outputs a json object containing the earnings surprises data for the specified stock symbol.
Typical fields in the output may include (based on Finnhub's API documentation):

[
  {
    "symbol": "AAPL",
    "actual": 1.24,
    "estimate": 1.20,
    "surprise": 0.04,
    "surprisePercent": 3.33,
    "period": "2024-03-31"
  }
]
  • symbol: The stock symbol queried.
  • actual: Reported earnings per share (EPS).
  • estimate: Analyst consensus estimate for EPS.
  • surprise: Difference between actual and estimated EPS.
  • surprisePercent: Percentage difference between actual and estimated EPS.
  • period: Reporting period for the earnings.

Note: The exact structure may vary depending on Finnhub's API response.

Dependencies

  • External Service: Requires access to the Finnhub.io API.
  • API Key: You must provide a valid Finnhub API key as credentials in n8n.
  • n8n Configuration: Ensure the Finnhub credential is set up in your n8n instance.

Troubleshooting

Common Issues:

  • Invalid or missing API key: If the API key is not provided or incorrect, requests will fail with authentication errors.
  • Symbol not found: If an invalid or unsupported stock symbol is entered, the API may return an empty result or an error.
  • Premium data required: Some data may only be available to premium subscribers; if Premium is set to true without appropriate subscription, access may be denied.

Error Messages:

  • "401 Unauthorized": Check your Finnhub API key in n8n credentials.
  • "404 Not Found" or empty results: Verify the stock symbol is correct and supported by Finnhub.
  • "403 Forbidden": You may be trying to access premium data without a subscription.

Links and References

Discussion