Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

finage

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

finage

A simple NodeJS library for interfacing with the Finage financial data API.

  • 1.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

node-finage example workflow

Introduction

This is a simple Node package that facilitates interaction with Finage's financial data REST API. The library has full support for functionality across all financial data available via Finage, including:

  • Stocks (US, LSE, MOEX and Canada)
  • Funds (Indices and ETF)
  • Crypto
  • Forex
  • Fundamentals

Dependencies

LibraryVersion
axios^0.24.0

Installation

For versions of npm ^5.0.0 run npm i finage
For other versions run npm i finage -S
Or else clone the repo and from the root directory and run npm i

Configuration

A valid Finage API key is required in order to set up the client.
This can be achieved with the following:

import Finage from 'finage';

const client = new Finage({ apiKey: 'API_KEY' });

It is advisable to store your api key as an environment variable and pass that to the Finage constructor if you are going to share your code anywhere.

Using the Package

This package is in-line with the official Finage documentation. As such all methods, where necessary, require certain params that must be passed for a successful request and optional queries that alter how the data is presented. These must be passed as objects to a method when making a call.
For example, to get the last quote of the symbol AAPL with a nanosecond timestamp:

const res = await client.stocks.us.lastQuote({ 
    params: { symbol: 'AAPL' }, queries: { ts: 'ns' } 
  })

PLEASE NOTE: When a method requires multiple params, the order-of-insertion matters and must follow the order outlined in the official documentation. This is because the ordering of string-based keys is preserved since ES2015, and this is used to construct the URL for API endpoints.

Class Structure

Finage   
│
└───bonds
│   │   lastRate()
│   
└───crypto
│   │   lastTrade()
│   │   lastQuote()
│   │   aggregates()
│   │   prevClose()
│   │   marketDepth()
│   │   historicalMarketDepth()
│   │   priceChange()
│   │   marketCap()
│
└───forex
|   |   lastQuote()
|   |   lastTrade()
|   |   tickData()
|   |   aggregates()
|   |   prevClose()
|   |   converter()
|
└───funds
|   |
|   └───index
|   |   |   lastPrice()
|   |   |   aggregates
|   |   |   prevClose()
|   |
|   └───etf
|   |   |   lastPrice()
|   |   |   aggregates
|   |   |   prevClose()
|
└───fundamentals
|   |   symbols()
|   |   calendar()
|   |   stockMarketDetails()
|   |   indicators()
|   |   mostActiveUs()
|   |   topGainersUs()
|   |   topLosersUs()
|   |   sectorPerformance()
|   |
|   └───market
|   |    |    status()
|   |    |    search()
|   |
|   └───country
|   |    |    status()
|   |    |    search()
|   |
|   └───forex
|   |    |    status()
|   |    |    search()
|   |
|   └───crypto
|   |    |    status()
|   |    |    search()
|   |    |    detailedLastPrice()
|   |
|   └───index
|   |    |    status()
|   |
|   └───funds
|   |    |
|   |    └─── holders
|   |    |    |   institutional()
|   |    |    |   mutual()
|   |    |    |   etf()
|   |    |    
|   |    |    etfSectorWeightings()
|   |    |    secRssFeed()
|   |    
|   └───statements
|   |    |    cashFlow()
|   |    |    balanceSheet()
|   |    |    income()
|   |    
|   └───news
|   |    |    market()
|   |    |    forex()
|   |    |    crypto()
|
└───stocks
|   |   
|   └───us
|   |   |     lastQuote()
|   |   |     lastQuoteMulti()
|   |   |     lastTrade()
|   |   |     lastTradeMulti()
|   |   |     endOfDay()
|   |   |     orderBook()
|   |   |     aggregates()
|   |   |     prevClose()
|   |   
|   └───lse
|   |   |     lastPrice()
|   |   |     aggregates()
|   |   
|   └───canada
|   |   |     lastPrice()
|   |   |     aggregates()
|   |   
|   └───moex
|   |   |     lastPrice()
|   |   |     aggregates()


Keywords

FAQs

Package last updated on 28 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc