npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

fmpclouds

v1.1.3

Published

This module is a node wrapper for the free [Financial Modeling Prep API](https://financialmodelingprep.com/developer/docs). This node application implements almost all aspects of the FMP API.

Downloads

6

Readme

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)

// Simple Examples

// API route: /quote/AAPL
fmp.stock('aapl').quote().then(response => console.log(response));
//API route: /quote/AAPL,MSFT
fmp.stock(['AAPL', 'MSFT']).quote().then(response => console.log(response));

// API route: /stock/sectors-performance
fmp.market.sector_performance().then(response => console.log(response));

// API route: /quote/USDEUR
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()                                                   // /profile
quote()                                                     // /quote
rating()                                                    // /company/rating
current_price()                                             // /stock/real-time-price
history({start_date, end_date, limit, type} = {})           // /historical-price-full/{ticker}?{opts}
dividend_history({start_date, end_date, limit, type} = {})  // /historical-price-full/stock_dividend/{ticker}?{opts}
split_history({start_date, end_date, limit, type} = {})     // /historical-price-full/stock_split/{ticker}?{opts}
earnings({limit} = {})                                      // /historical/earning_calendar/{ticker}?{opts}

financial.income(period = 'annual')                         // /income-statement
financial.balancesheet(period = 'annual')                   // /balance-sheet-statement
financial.cashflow(period = 'annual')                       // /cash-flow-statement
financial.metrics(period = 'annual')                        // /key-metrics
financial.growth(period = 'annual')                         // /financial-growth
financial.ratios()                                          // /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()                                                           // /stock/actives
most_gainer()                                                           // /stock/gainers
most_loser()                                                            // /stock/losers
sector_performance()                                                    // /stock/sectors-performance
trading_hours()                                                         // /is-the-market-open

index.list()                                                            // /symbol/available-indexes
index.quote(stock = 'all')*                                             // /quote
index.history(stock, { start_date, end_date, data_type, limit } = {})*  // /historical-price-full/index/{ticker}?{opts}

* 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)      // /search?{opts}

ETF

Accessed through `fmp.etf.{method_name}

list()                                                                      // /symbol/available-etfs
quote(stock = 'all')*                                                       // /quote
history(stock, { start_date, end_date, data_type, limit } = {})*            // /historical-price-full/etf/{ticker}?{opts}
dividend_history(stock, { start_date, end_date, data_type, limit } = {})*   // /historical-price-full/stock_dividend/{ticker}?{opts}
split_history(stock, { start_date, end_date, data_type, limit } = {})*      // /historical-price-full/stock_split/{ticker}?{opts}

* 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()                                                                      // /symbol/available-mutual-funds
quote(stock = 'all')*                                                       // /quote
history(stock, { start_date, end_date, data_type, limit } = {})*            // /historical-price-full/mutual_fund/{ticker}?{opts}
dividend_history(stock, { start_date, end_date, data_type, limit } = {})*   // /historical-price-full/stock_dividend/{ticker}?{opts}
split_history(stock, { start_date, end_date, data_type, limit } = {})*      // /historical-price-full/stock_split/{ticker}?{opts}

* 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()                                                                      // /symbol/available-cryptocurrencies
quote(stock = 'all')*                                                       // /quote
history(stock, { start_date, end_date, data_type, limit } = {})*            // /historical-price-full/crypto/{ticker}?{opts}

* 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()                                                                      // /symbol/available-commodities
quote(stock = 'all')*                                                       // /quote
history(stock, { start_date, end_date, data_type, limit } = {})*            // /historical-price-full/commodity/{ticker}?{opts}

* 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()                                                      // /quote
history({ start_date, end_date, data_type, limit } = {})    // /historical-price-full/{ticker}?{opts}

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