Finnhub.io icon

Finnhub.io

Consume Finnhub.io API

Overview

The Indices Historical Constituents [PREMIUM] operation of the "Index" resource in this custom n8n node allows users to retrieve historical constituent data for a specified financial index symbol from the Finnhub.io API. This is particularly useful for financial analysts, researchers, or developers who need to track changes in index composition over time (e.g., S&P 500, NASDAQ). For example, you could use this node to analyze which companies were part of the S&P 500 at different points in history.

Properties

Name Type Meaning
Symbol String The ticker symbol of the index to search for historical constituents. Example: ^GSPC for S&P 500.

Output

  • The output will be a JSON object containing the historical constituents of the specified index symbol.
  • The structure typically includes:
    • A list/array of objects, each representing the constituents of the index at a specific date.
    • Each object may include fields such as:
      • date: The date for which the constituent list applies.
      • constituents: An array of symbols representing the companies included in the index on that date.

Example Output:

[
  {
    "date": "2023-01-01",
    "constituents": ["AAPL", "MSFT", "GOOGL", ...]
  },
  {
    "date": "2022-01-01",
    "constituents": ["AAPL", "MSFT", "AMZN", ...]
  }
]

Note: The actual field names and structure depend on the Finnhub.io API response.

Dependencies

  • Finnhub.io API Key: You must provide valid Finnhub credentials in n8n (API key required).
  • n8n Configuration: Ensure the Finnhub credential is set up in your n8n instance.

Troubleshooting

  • Invalid or Missing API Key: If the API key is missing or invalid, you may receive authentication errors. Make sure your Finnhub credentials are correctly configured in n8n.
  • Incorrect Symbol: Providing an incorrect or unsupported index symbol may result in empty results or an error message from the API.
  • Premium Endpoint: This operation is marked as [PREMIUM]; ensure your Finnhub account has access to premium endpoints.
  • Rate Limits: Exceeding Finnhub's rate limits can cause temporary blocks or errors. Monitor your usage if making frequent requests.

Links and References

Discussion