Financial Modeling Prep
This module is a node wrapper for the free Financial Modeling Prep API. This node application implements almost all aspects of the FMP API.
About FinancialModelingPrep
The FMP API offers different types of data ranging from stock prices and historical data to financial statements and market performance. The complete API documentation is available here.
This API is perfect for someone who loves to dabble with financial data as a hobby and incorporate it into other projects.
I have no affiliation with FinancialModelingPrep and its web API development.
Installation
npm install --save financialmodelingprep
Usage
To use this module first create an account with FinancialModelingPrep and retrieve your API key.
const fmp = require('financialmodelingprep')(apikey)
fmp.stock('aapl').quote().then(response => console.log(response));
fmp.stock(['AAPL', 'MSFT']).quote().then(response => console.log(response));
fmp.market.sector_performance().then(response => console.log(response));
fmp.forex('USD', 'EUR').rate().then(response => console.log(response));
Keep in mind most of the web API breakdown and routes closely follow the structure of the node functions.
API Documentation
Stock
Accessed through fmp.stock({ticker}).{method_name}*
profile()
quote()
rating()
current_price()
history({start_date, end_date, limit, type} = {})
dividend_history({start_date, end_date, limit, type} = {})
split_history({start_date, end_date, limit, type} = {})
financial.income(period = 'annual')
financial.balancesheet(period = 'annual')
financial.cashflow(period = 'annual')
financial.metrics(period = 'annual')
financial.growth(period = 'annual')
financial.ratios()
* The stock
parameter can either be pased as a string or an array of market tickers. These tickers can be found either by running search based on corporation name.
Market
Accessed through fmp.market.{method_name}
most_active()
most_gainer()
most_loser()
sector_performance()
trading_hours()
index.list()
index.quote(stock = 'all')*
index.history(stock, { start_date, end_date, data_type, limit } = {})*
* The stock
parameter can either be pased as a string or an array of market tickers. These tickers can be found either by running search based on corporation name or through the list
function
Search
Accessed through fmp.search()
search(keywords, limit = 10, exchange)
ETF
Accessed through `fmp.etf.{method_name}
list()
quote(stock = 'all')*
history(stock, { start_date, end_date, data_type, limit } = {})*
dividend_history(stock, { start_date, end_date, data_type, limit } = {})*
split_history(stock, { start_date, end_date, data_type, limit } = {})*
* The stock
parameter can either be pased as a string or an array of market tickers. These tickers can be found either by running search based on corporation name or through the list
function
Mutual Funds
Accessed through fmp.mutualfund.{method_name}
list()
quote(stock = 'all')*
history(stock, { start_date, end_date, data_type, limit } = {})*
dividend_history(stock, { start_date, end_date, data_type, limit } = {})*
split_history(stock, { start_date, end_date, data_type, limit } = {})*
* The stock
parameter can either be pased as a string or an array of market tickers. These tickers can be found either by running search based on corporation name or through the list
function
Cryptocurrency
Accessed through fmp.crypto.{method_name}
list()
quote(stock = 'all')*
history(stock, { start_date, end_date, data_type, limit } = {})*
* The stock
parameter can either be pased as a string or an array of market tickers. Also, the parameter appends USD
to the crypto ticker passed to provide the value in US dollars so if you need to query data in a different currency I would suggest using the forex command and manually convert it to the desired currency.
Commodities
Accessed through fmp.commodities.{method_name}
list()
quote(stock = 'all')*
history(stock, { start_date, end_date, data_type, limit } = {})*
* The stock
parameter can either be pased as a string or an array of market tickers. These tickers can be found either by running search based on corporation name or through the list
function
Forex
Accessed through fmp.forex({from_ticker}, {to_ticker}).{method_name}
rate()
history({ start_date, end_date, data_type, limit } = {})
Contributing
Contributions are welcome! The purpose of this npm package is to create a node wrapper that closely aligns to the free financial API provided by Financial Modeling Prep. If there are any features that are vital and I may have forgotten, feel free to open an issue or complete it by opening a pull request.
Before you open any pull requests, make sure the code structure follows the function calls provided above and the test suite passes, which can be checked by running npm test
. If possible try to keep the coverage of your code at ~100% to ensure future regression stability.
Contact