FORGEBOX Enterprise 🚀 - Take your ColdFusion (CFML) Development to Modern Times! Learn More...

cfStocky

v0.1.2 Modules

cfStocky

cfmlbadges cfmlbadges Adobe CF11 Compatible Adobe CF2016 Compatible Lucee 5 compatible

A CFML wrapper for the Financial Modeling Prep API. Get stock prices and company fundamentals via a simple, clean API.

Bitbucket Pipelines build status

Getting Started

  1. Install this module - box install cfstocky
  2. OPTIONAL: Configure base api URL (if changed) via moduleSettings.cfstocky.baseURL in config/Coldbox.cfc:
moduleSettings = {
	cfStocky : {
		baseURL : "https://financialmodelingprep.com/api/v3/"
	}
}
  1. Inject the cfstocky service:
property name="stocky" inject="Stocky@cfStocky";

API Methods

  • Most API methods require a ticker symbol ( like MSFT or GM) as the first argument.
  • Each API method returns a HyperResponse object from hyper. You can call .getData(), .getStatusCode(), .isSuccess(), .isError(), and .json() to return JSON de-serialized as a struct.

Get Company Profile

var data = Stocky.getCompanyProfile( "MSFT" ).json();

https://financialmodelingprep.com/developer/docs/companies-key-stats-free-api/

Financial Statements

https://financialmodelingprep.com/developer/docs/financial-statement-free-api/

Get Income Statement

var data = Stocky.getIncomeStatement( "MSFT" ).json();

https://financialmodelingprep.com/developer/docs/financial-statement-free-api/#Income-Statement

Get Balance Sheet

var data = Stocky.getBalanceSheet( "MSFT" ).json();

https://financialmodelingprep.com/developer/docs/financial-statement-free-api/#Balance-Sheet-Statement

Get Cash Flow Statement

var data = Stocky.getCashFlow( "MSFT" ).json();

https://financialmodelingprep.com/developer/docs/financial-statement-free-api/#Cash-Flow-Statement

Get Financial Ratios

var data = Stocky.getFinancialRatios( "MSFT" ).json();

https://financialmodelingprep.com/developer/docs/financial-ratio-free-api/

Get Financial Ratios

var data = Stocky.getFinancialRatios( "MSFT" ).json();

https://financialmodelingprep.com/developer/docs/financial-ratio-free-api/

Get Enterprise Value

var data = Stocky.getEnterpriseValue( "MSFT" ).json();

https://financialmodelingprep.com/developer/docs/company-enterprise-value-api/

Get Key Metrics

var data = Stocky.getKeyMetrics( "MSFT" ).json();

https://financialmodelingprep.com/developer/docs/company-key-metrics-api/

Get Financial Growth

var data = Stocky.getFinancialGrowth( "MSFT" ).json();

https://financialmodelingprep.com/developer/docs/company-enterprise-value-api/

Get Company Rating

var data = Stocky.getCompanyRating( "MSFT" ).json();

https://financialmodelingprep.com/developer/docs/companies-rating-free-api/

Discounted Cash Flow

Get Discounted Cash Flow

var data = Stocky.getDiscountedCashFlow( "MSFT" ).json();

https://financialmodelingprep.com/developer/docs/companies-dcf-reports-free-api/#DCF

Get Historical Discounted Cash Flow

var data = Stocky.getHistoricalDiscountedCashFlow( "MSFT" ).json();

https://financialmodelingprep.com/developer/docs/companies-dcf-reports-free-api/#Historical-DCF

Stock Prices

Get Stock Real Time Price

var data = Stocky.getRealtimePrice( "MSFT" ).json();

https://financialmodelingprep.com/developer/docs/realtime-stock-quote-api/#Stock-Realtime-Price

Get Price List for All Stocks

var data = Stocky.getRealtimePrice().json();

https://financialmodelingprep.com/developer/docs/realtime-stock-quote-api/#Stock-Price-list

Get All Stock Symbols

var data = Stocky.getStockSymbols().json();

https://financialmodelingprep.com/developer/docs/stock-market-quote-free-api/

Stock Market

Get All Major Stock Indexes

var data = Stocky.getMajorIndexPriceList().json();

https://financialmodelingprep.com/developer/docs/indexes-in-stock-market-free-api/#Majors-Indexes-List

Get Single Index Price

var data = Stocky.getMajorIndexPriceList( ".DJI" ).json();

https://financialmodelingprep.com/developer/docs/indexes-in-stock-market-free-api/#Majors-Indexes-List

Get Most Active Stocks

var data = Stocky.getActiveStocks().json();

https://financialmodelingprep.com/developer/docs/most-actives-stock-market-data-free-api/

Get Most Gainer Stocks

var data = Stocky.getMostGainedStocks().json();

https://financialmodelingprep.com/developer/docs/most-gainers-stock-market-data-free-api/

Get Most Loser Stocks

var data = Stocky.getMostLostStocks().json();

https://financialmodelingprep.com/developer/docs/most-losers-stock-market-data-free-api/

Get NYSE Market Hours

Find out if the markets are open or closed today.

var data = Stocky.getNYSEMarketHours().json();

https://financialmodelingprep.com/developer/docs/is-the-market-open/

Get NYSE Market Hours

Find out if the markets are open or closed today.

var data = Stocky.getNYSEMarketHours().json();

Get Sector Performance

See the change in performance for each market sector.

var data = Stocky.getSectorPerformanceList().json();

https://financialmodelingprep.com/developer/docs/is-the-market-open/

TODO

  • Add method for batch request stock historical price API
  • Add methods for historical price API
  • Add methods for batch request realtime price API
  • Add methods for cryptocurrencies and forex APIs
  • Improve documentation with response data screenshots or data tables.

The Good News

For all have sinned, and come short of the glory of God (Romans 3:23)

But God commendeth his love toward us, in that, while we were yet sinners, Christ died for us. (Romans 5:8)

That if thou shalt confess with thy mouth the Lord Jesus, and shalt believe in thine heart that God hath raised him from the dead, thou shalt be saved. (Romans 10:9)

$ box install cfstocky

No collaborators yet.
   
  • {{ getFullDate("2019-10-12T10:29:35Z") }}
  • {{ getFullDate("2019-10-15T10:55:13Z") }}
  • 3,137
  • 2,104