Finnhub.io icon

Finnhub.io

Consume Finnhub.io API

Overview

The Finnhub.io node for n8n enables users to interact with the Finnhub API, specifically targeting alternative financial data. When configured with the "Alternative" resource and the "USA Spending" operation, this node retrieves U.S. government spending data related to a specified company symbol within a given date range. This is useful for analysts, researchers, or businesses interested in tracking federal spending associated with particular companies.

Practical examples:

  • A financial analyst wants to monitor how much the U.S. government has spent on contracts with a specific company (e.g., GME) over the past year.
  • A compliance officer needs to audit government-related transactions for a portfolio of companies.
  • A journalist investigates trends in federal spending towards certain industries or firms.

Properties

Name Type Meaning
Symbol String Company symbol (e.g., "GME") to filter USA spending data.
From Date DateTime Start date for the spending data query (inclusive).
To Date DateTime End date for the spending data query (inclusive).

Output

The node outputs a JSON object (or array of objects) containing U.S. government spending data related to the specified company symbol within the provided date range. The exact structure depends on the Finnhub API response, but typically includes fields such as:

  • date: The date of the transaction or spending record.
  • amount: The amount spent by the government.
  • agency: The government agency responsible for the spending.
  • description: Description or purpose of the spending.
  • symbol: The company symbol queried.

Note: The output may include additional metadata or fields as provided by the Finnhub API.

Dependencies

  • External Service: Requires access to the Finnhub.io API.
  • API Key: You must provide a valid Finnhub API key via n8n credentials (credential type: finnhub).
  • n8n Configuration: No special configuration beyond setting up the Finnhub credential.

Troubleshooting

Common Issues:

  • Invalid or missing API key: If the Finnhub credential is not set up correctly, the node will fail to authenticate.
  • Incorrect symbol: Using an invalid or unsupported company symbol may result in empty results or errors.
  • Date range issues: Providing a future date or an inverted date range (fromDate after toDate) may yield no data or errors.

Error Messages & Resolutions:

  • 401 Unauthorized / Invalid API key: Ensure your Finnhub API key is correct and active in n8n credentials.
  • 400 Bad Request: Check that all required properties (Symbol, From Date, To Date) are provided and formatted correctly.
  • No data found: Verify the symbol and date range; try broadening the range or checking the symbol's validity.

Links and References

Discussion