Finnhub.io icon

Finnhub.io

Consume Finnhub.io API

Overview

The Stock: Price Target [PREMIUM] operation in the custom n8n Finnhub node retrieves analyst price target data for a specified stock symbol using the Finnhub.io API. This is a premium feature, meaning it requires a premium subscription to Finnhub.io. Typical use cases include financial analysis workflows, automated investment research, or dashboards that display analyst expectations for stock prices.

Example scenarios:

  • Automatically fetching and displaying the latest analyst price targets for a given stock (e.g., AAPL) in a reporting dashboard.
  • Integrating with alerting systems to notify users when new price targets are published for stocks of interest.

Properties

Name Type Meaning
Symbol String The ticker symbol of the company to retrieve price target information for (e.g., "AAPL").
Premium Boolean Indicates whether you have a Premium Subscription for Finnhub.io. Required for this operation.

Output

The output will be a JSON object containing the analyst price target data for the specified stock symbol. While the exact structure depends on the Finnhub.io API response, typical fields may include:

{
  "symbol": "AAPL",
  "targetHigh": 200,
  "targetLow": 150,
  "targetMean": 175,
  "targetMedian": 180,
  "lastUpdated": "2024-06-01"
}
  • symbol: The stock symbol queried.
  • targetHigh: Highest analyst price target.
  • targetLow: Lowest analyst price target.
  • targetMean: Average analyst price target.
  • targetMedian: Median analyst price target.
  • lastUpdated: Date of the last update.

Note: Actual field names and presence may vary based on Finnhub's API.

Dependencies

  • External Service: Requires access to the Finnhub.io API.
  • API Key: You must provide a valid Finnhub API key via n8n credentials.
  • Premium Subscription: This operation requires a premium Finnhub.io account.
  • n8n Configuration: Ensure the Finnhub credential is set up in your n8n instance.

Troubleshooting

  • Missing or Invalid API Key:
    Error message: "401 Unauthorized" or similar.
    Resolution: Check that your Finnhub API key is correctly configured in n8n credentials.

  • Insufficient Permissions / Not Premium:
    Error message: "403 Forbidden" or "Premium endpoint" error.
    Resolution: Ensure your Finnhub account has a premium subscription and the "Premium" property is set to true.

  • Invalid Symbol:
    Error message: "Symbol not found" or empty result.
    Resolution: Verify the stock symbol is correct and supported by Finnhub.

  • API Rate Limits:
    Error message: "429 Too Many Requests".
    Resolution: Wait before retrying or upgrade your Finnhub plan.

Links and References

Discussion