@finazon/finazon-grpc-node
v1.2.1
Published
Finazon gRPC client library for Node.js
Downloads
3
Readme
Finazon Node.js gRPC Client
This is the official Node.js library for Finazon, offering access to:
- Lists of datasets, publishers, markets, and tickers.
- Market data: ticker snapshots, time series, trades, and technical indicators.
- Data from specific datasets such as Benzinga, Binance, Crypto, Forex, SEC, and SIP.
- Full compatibility with both JavaScript and TypeScript.
🔑 API key is essential. If you haven't got one yet, sign up here.
Installation requirements
Ensure you have Node.js v18.0.0 or later. We recommend the latest LTS version. Use nvm (macOS/Linux) or nvm-windows for Node version management across projects.
Using npm
npm install @finazon/finazon-grpc-node --save
Using yarn
yarn add @finazon/finazon-grpc-node
🔗 View the package on npm.
Quick start
1. Set up a new project
mkdir hello-finazon && cd hello-finazon
npm init -y
npm install --save-dev @finazon/finazon-grpc-node
2. Create hello-world.js
script
const { GetTimeSeriesRequest } = require('@finazon/finazon-grpc-node/time_series_pb');
const { TimeSeriesService } = require('@finazon/finazon-grpc-node/time_series_service');
const API_KEY = 'your_api_key';
const service = new TimeSeriesService(API_KEY);
const request = new GetTimeSeriesRequest();
request.setDataset('sip_non_pro');
request.setTicker('AAPL');
service.getTimeSeries(request, (err, value) => {
if (err) {
console.error(err);
return;
}
console.log(JSON.stringify(value.toObject(), null, 2));
});
3. Input your API key
Replace 'your_api_key'
with your actual key.
4. Run the example
node hello-world.js
📝 Expected output:
{
"resultList": [
{
"timestamp": 1698438120,
"open": 167.85,
"close": 167.83,
"high": 167.91,
"low": 167.83,
"volume": 2020
},
{
"timestamp": 1698436740,
"open": 168.095,
"close": 168.22,
"high": 168.34,
"low": 168.06,
"volume": 7874313
},
// ...
{
"timestamp": 1698435060,
"open": 168.07,
"close": 167.965,
"high": 168.1,
"low": 167.96,
"volume": 131572
}
]
}
👀 Check the full example and other examples here
RPC support
The following table outlines the supported rpc calls: |Service |rpc |Description | |-----------------------|---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------| | ApiUsageService | getApiUsage | Get a list of products with quota limit/usage | | BenzingaService | getDividentsCalendar | Returns the dividends calendar from Benzinga | | BenzingaService | getEarningsCalendar | Returns the earnings calendar from Benzinga | | BenzingaService | getNews | Returns the news articles from Benzinga | | BenzingaService | getIPO | Returns IPO data from Benzinga | | BinanceService | getTimeSeries | Get time series data without technical indicators | | CryptoService | getTimeSeries | Get time series data for any given ticker | | DatasetsService | getDatasets | Get a list of all datasets available at Finazon. | | ExchangeService | getMarketsCrypto | Returns a list of supported crypto markets | | ExchangeService | getMarketsStocks | Returns a list of supported stock markets | | ForexService | getTimeSeries | Get time series data for any given ticker | | PublisherService | getPublishers | Get a list of all publishers available at Finazon. | | SecService | getFilings | Real-time and historical access to all forms, filings, and exhibits directly from the SEC's EDGAR system. | | SipService | getTrades | Returns detailed information on trades executed through the Securities Information Processor (SIP) | | SipService | getMarketCenter | Returns a list of market centers | | SnapshotService | getSnapshot | This endpoint returns a combination of different data points, such as daily performance, last quote, last trade, minute data, and previous day performance. | | TickersService | findTickersStocks | This API call returns an array of stocks tickers available at Finazon Data API. This list is updated daily. | | TickersService | findTickersCrypto | This API call returns an array of crypto tickers available at Finazon Data API. This list is updated daily. | | TickersService | findTickersForex | This API call returns an array of forex tickers available at Finazon Data API. This list is updated daily. | | TickersService | findTickersUS | This API call returns an array of US tickers available at Finazon Data API. This list is updated daily. | | TimeSeriesService | getTimeSeries | Get time series data without technical indicators | | TimeSeriesService | getTimeSeriesAtr | Get time series data for ATR technical indicator. | | TimeSeriesService | getTimeSeriesBBands | Get time series data for BBands technical indicator. | | TimeSeriesService | getTimeSeriesIchimoku | Get time series data for Ichimoku technical indicator. | | TimeSeriesService | getTimeSeriesMa | Get time series data for Ma technical indicator. | | TimeSeriesService | getTimeSeriesMacd | Get time series data for Macd technical indicator. | | TimeSeriesService | getTimeSeriesObv | Get time series data for Obv technical indicator. | | TimeSeriesService | getTimeSeriesRsi | Get time series data for Rsi technical indicator. | | TimeSeriesService | getTimeSeriesSar | Get time series data for Sar technical indicator. | | TimeSeriesService | getTimeSeriesStoch | Get time series data for Stoch technical indicator. | | TradeService | getTrades | Returns general information on executed trades |
Here's how you can import client
and request
objects:
const { ServiceNameService } = require('@finazon/finazon-grpc-node/service_name_service');
const { RpcNameRequest } = require('@finazon/finazon-grpc-node/service_name_pb');
// ...
const service = new ServiceNameService(API_KEY);
const request = new RpcNameRequest();
service.rpcName(request, (err, value) => {});
Documentation
Delve deeper with our official documentation.
Examples
Explore practical scenarios in the examples directory.
Support
- 🌐 Visit our contact page.
- 🛠 Or our support center.
Stay updated
Contributing
- Fork and clone:
$ git clone https://github.com/finazon-io/finazon-grpc-node.git
. - Branch out:
$ cd finazon-grpc-node && git checkout -b my-feature
. - Commit changes and test.
- Push your branch and open a pull request with a comprehensive description.
For more guidance on contributing, see the GitHub Docs on GitHub.
License
This project is licensed under the MIT License. See the LICENSE.txt
file in this repository for more details.