Title: | R Access to the 'FMP Cloud' and 'Financial Modeling Prep' API |
---|---|
Description: | Use R to access to the 'FMP Cloud' API <https://fmpcloud.io/> and 'Financial Modeling Prep' API <https://financialmodelingprep.com/developer/docs/>. Data available includes stock prices, market indexes, company fundamentals, 13F holdings data, and much more. A valid API token must be set to enable functions. |
Authors: | Anthony Balentine [aut, cre] |
Maintainer: | Anthony Balentine <[email protected]> |
License: | GPL-3 |
Version: | 0.1.6 |
Built: | 2025-02-04 05:25:25 UTC |
Source: | https://github.com/altanalytics/fmpcloudr |
Ciks are unique IDs for each company that files a 13F. This function returns a list of each unique cik that FMP Cloud has available.
fmpc_13f_cik_list()
fmpc_13f_cik_list()
cik list
## Not run: # Function can work without a valid API token fmpc_set_token() # defaults to 'demo' fmpc_13f_cik_list() ## End(Not run)
## Not run: # Function can work without a valid API token fmpc_set_token() # defaults to 'demo' fmpc_13f_cik_list() ## End(Not run)
Ciks are unique IDs for each company that files a 13F. This function returns the name of the company associated with one or more ciks
fmpc_13f_cik_name(cik = "0001067983")
fmpc_13f_cik_name(cik = "0001067983")
cik |
a valid cik |
company name associated with cik
## Not run: # Function can work without a valid API token fmpc_set_token() # defaults to 'demo' fmpc_13f_cik_name(cik = '0001067983') ## End(Not run)
## Not run: # Function can work without a valid API token fmpc_set_token() # defaults to 'demo' fmpc_13f_cik_name(cik = '0001067983') ## End(Not run)
Ciks are unique IDs for each company that files a 13F. This function allows search queries to identify and search for specific companies.
fmpc_13f_cik_search(query = "Berkshire")
fmpc_13f_cik_search(query = "Berkshire")
query |
a search string to find asset managers by name |
cik list
## Not run: # Function can work without a valid API token fmpc_set_token() # defaults to 'demo' fmpc_13f_cik_search('Berkshire') # Must set a valid API token fmpc_set_token('FMPAPIKEY') fmpc_13f_cik_search('Morgan') ## End(Not run)
## Not run: # Function can work without a valid API token fmpc_set_token() # defaults to 'demo' fmpc_13f_cik_search('Berkshire') # Must set a valid API token fmpc_set_token('FMPAPIKEY') fmpc_13f_cik_search('Morgan') ## End(Not run)
13F shows the holdings of an asset manager as of a specific date
fmpc_13f_data(cik = "0001067983", date = "2019-12-31")
fmpc_13f_data(cik = "0001067983", date = "2019-12-31")
cik |
one or more valid ciks from |
date |
one or more quarter end dates (yyyy-03-31, yyyy-06-30, yyyy-09-30, yyyy-12-31) |
13F holdings
## Not run: # Berkshire can be run using the demo fmpc_set_token() fmpc_13f_data('0001067983', '2020-03-31') # Must set a valid API token fmpc_set_token('FMPAPIKEY') goldmanCik = fmpc_13f_cik_search('golman') fmpc_13f_data(cik = goldmanCik$cik, date = c('2020-03-31','2020-06-30')) ## End(Not run)
## Not run: # Berkshire can be run using the demo fmpc_set_token() fmpc_13f_data('0001067983', '2020-03-31') # Must set a valid API token fmpc_set_token('FMPAPIKEY') goldmanCik = fmpc_13f_cik_search('golman') fmpc_13f_data(cik = goldmanCik$cik, date = c('2020-03-31','2020-06-30')) ## End(Not run)
Analyst details for one or more securities includes earnings estimates, earnings surprises, stock grade, analyst recommendations, and company press releases
fmpc_analyst_outlook( symbols = c("AAPL"), outlook = c("surprise", "grade", "estimate", "recommend", "press"), limit = 100 )
fmpc_analyst_outlook( symbols = c("AAPL"), outlook = c("surprise", "grade", "estimate", "recommend", "press"), limit = 100 )
symbols |
one or more symbols from the FMP available list that can be
found using |
outlook |
can be one of: 'surprise' for earnings surprise, 'grade' for stock grade', 'estimateAnnl' for analysts annual estimates, 'estimateQtr' for analysts quarterly estimate, 'recommend' for analyst recommendations, and 'press' for company press releases |
limit |
limit results for each ticker |
data frame of ratings data
## Not run: # Demo can pull AAPL fmpc_set_token() fmpc_analyst_outlook('AAPL') # For multiple symbols, set a valid API Token fmpc_set_token('FMPAPIKEY') fmpc_analyst_outlook(c('AAPL','MSFT','SPY')) ## End(Not run)
## Not run: # Demo can pull AAPL fmpc_set_token() fmpc_analyst_outlook('AAPL') # For multiple symbols, set a valid API Token fmpc_set_token('FMPAPIKEY') fmpc_analyst_outlook(c('AAPL','MSFT','SPY')) ## End(Not run)
Calendar dates related to Economic data, IPOs, dividends, earnings, and splits
fmpc_calendar_events( calendar = "economic", startDate = Sys.Date() - 180, endDate = Sys.Date() )
fmpc_calendar_events( calendar = "economic", startDate = Sys.Date() - 180, endDate = Sys.Date() )
calendar |
indicate which calendar to view. Options include 'ipo', 'stock_split', 'stock_dividend', 'earning',or 'economic' |
startDate |
filter start date in yyyy-mm-dd format. |
endDate |
filter end date in yyyy-mm-dd format. |
calendar events
## Not run: # Must set a valid API token fmpc_set_token('FMPAPIKEY') fmpc_calendar_events('stock_split') fmpc_calendar_events('economic') ## End(Not run)
## Not run: # Must set a valid API token fmpc_set_token('FMPAPIKEY') fmpc_calendar_events('stock_split') fmpc_calendar_events('economic') ## End(Not run)
Provides raw data from Commitment of Traders report
fmpc_cots_data( cots_sym = "all", type = c("report", "analysis"), startDate = Sys.Date() - 30, endDate = Sys.Date() )
fmpc_cots_data( cots_sym = "all", type = c("report", "analysis"), startDate = Sys.Date() - 30, endDate = Sys.Date() )
cots_sym |
COTS symbol that can be found in
|
type |
'report' is the raw data, 'analysis' is analysis of raw reports |
startDate |
filter start date in yyyy-mm-dd format. |
endDate |
filter end date in yyyy-mm-dd format. |
a data frame of cots data
## Not run: # Must set a valid API token fmpc_set_token('FMPAPIKEY') fmpc_cots_data() fmpc_cots_data('gc','analysis') ## End(Not run)
## Not run: # Must set a valid API token fmpc_set_token('FMPAPIKEY') fmpc_cots_data() fmpc_cots_data('gc','analysis') ## End(Not run)
Provides a list of all the symbols available on the Commitment of Traders data pull
fmpc_cots_symbols()
fmpc_cots_symbols()
a data frame of cots symbols with descriptions
## Not run: # Must set a valid API token fmpc_set_token('FMPAPIKEY') fmpc_cots_symbols() ## End(Not run)
## Not run: # Must set a valid API token fmpc_set_token('FMPAPIKEY') fmpc_cots_symbols() ## End(Not run)
Use a cusip to search a company and ticker
fmpc_cusip_search(cusip = "000360206")
fmpc_cusip_search(cusip = "000360206")
cusip |
a valid cusip |
a data frame of symbol, cusip, and company
## Not run: # Demo offers AAON as an example fmpc_set_token() fmpc_cusip_search('000360206') ## End(Not run)
## Not run: # Demo offers AAON as an example fmpc_set_token() fmpc_cusip_search('000360206') ## End(Not run)
Full transcript of earnings call
fmpc_earning_call_transcript(symbols = c("AAPL"), quarter = 2, year = 2020)
fmpc_earning_call_transcript(symbols = c("AAPL"), quarter = 2, year = 2020)
symbols |
one or more symbols from the FMP available list that can be
found using |
quarter |
earnings year quarter |
year |
earnings call year |
earnings call transcript in data frame
## Not run: # Demo can pull AAPL fmpc_set_token() fmpc_earning_call_transcript('AAPL',quarter = 1, year = 2019) # For multiple symbols, set a valid API Token fmpc_set_token('FMPAPIKEY') fmpc_earning_call_transcript(c('AAPL','MSFT','SPY')) ## End(Not run)
## Not run: # Demo can pull AAPL fmpc_set_token() fmpc_earning_call_transcript('AAPL',quarter = 1, year = 2019) # For multiple symbols, set a valid API Token fmpc_set_token('FMPAPIKEY') fmpc_earning_call_transcript(c('AAPL','MSFT','SPY')) ## End(Not run)
Shows the economic events that can be fed into
fmpc_economic_results
fmpc_economic_events()
fmpc_economic_events()
economic metrics
## Not run: # Function can work without a valid API token fmpc_set_token('FMPAPIKEY') fmpc_economic_events() ## End(Not run)
## Not run: # Function can work without a valid API token fmpc_set_token('FMPAPIKEY') fmpc_economic_events() ## End(Not run)
Shows the results of the economic events from
fmpc_economic_events
fmpc_economic_results( event = "adpEmploymentChange", country = "US", startDate = Sys.Date() - 180, endDate = Sys.Date() )
fmpc_economic_results( event = "adpEmploymentChange", country = "US", startDate = Sys.Date() - 180, endDate = Sys.Date() )
event |
an economic event from |
country |
a country from |
startDate |
filter start date in yyyy-mm-dd format. |
endDate |
filter end date in yyyy-mm-dd format. |
calendar events
## Not run: # Must set a valid API token fmpc_set_token('FMPAPIKEY') Events = fmpc_economic_events() fmpc_economic_results() # Italy three month interbank rate fmpc_economic_results(event = Events[100,1], country = Events[100,2]) # Consumer credit - RS fmpc_economic_results(event = Events[1000,1], country = Events[1000,2]) ## End(Not run)
## Not run: # Must set a valid API token fmpc_set_token('FMPAPIKEY') Events = fmpc_economic_events() fmpc_economic_results() # Italy three month interbank rate fmpc_economic_results(event = Events[100,1], country = Events[100,2]) # Consumer credit - RS fmpc_economic_results(event = Events[1000,1], country = Events[1000,2]) ## End(Not run)
Provides a list of all ETFs
fmpc_etf_list()
fmpc_etf_list()
a data frame of ETFs
## Not run: # Must set a valid API token fmpc_set_token('FMPAPIKEY') fmpc_etf_list() ## End(Not run)
## Not run: # Must set a valid API token fmpc_set_token('FMPAPIKEY') fmpc_etf_list() ## End(Not run)
Pull balance sheet, income statement, or cash flow statement for one or more tickers. Can elect to see data quarterly or annually and view growth
fmpc_financial_bs_is_cf( symbols = "AAPL", statement = c("income", "balance", "cashflow"), quarterly = TRUE, growth = FALSE, SECReported = FALSE, limit = 100 )
fmpc_financial_bs_is_cf( symbols = "AAPL", statement = c("income", "balance", "cashflow"), quarterly = TRUE, growth = FALSE, SECReported = FALSE, limit = 100 )
symbols |
one or more publicly traded companies domestic or international |
statement |
indicate the statement to view. Can be 'income', 'balance', or 'cashflow' |
quarterly |
TRUE/FALSE whether the statement should be shown quarterly or annually |
growth |
TRUE/FALSE whether the growth statement should be shown |
SECReported |
TRUE/FALSE whether to display the information as it was reported to the SEC. Only one symbol can be passed if this is set to TRUE. Growth must also be set to FALSE. International stocks should not be passed. |
limit |
limit the result for each ticker |
returns balance sheet, income statement, or cash flow
## Not run: # Setting API key to 'demo' allows for AAPL only fmpc_set_token() fmpc_financial_bs_is_cf() fmpc_financial_bs_is_cf('AAPL',statement = 'balance', quarterly = FALSE, growth = FALSE, SECReported = TRUE, limit = 10) # Must set a valid API token fmpc_set_token('FMPAPIKEY') fmpc_financial_bs_is_cf(c('AAPL','MSFT','TSLA')) symbols = c('AAPL','MSFT','BAC') Bal = fmpc_financial_bs_is_cf(symbols,statement = 'balance') BalG = fmpc_financial_bs_is_cf(symbols,statement = 'balance', growth = FALSE) IS = fmpc_financial_bs_is_cf(symbols,statement = 'income') ISa = fmpc_financial_bs_is_cf(symbols,statement = 'income', quarterly = FALSE) cf = fmpc_financial_bs_is_cf(symbols,statement = 'cashflow') cfsec = fmpc_financial_bs_is_cf(symbols,statement = 'cashflow', SECReported = TRUE) # International tickers work fmpc_financial_bs_is_cf('RY.TO',statement = 'balance', quarterly = TRUE, growth = TRUE, SECReported = FALSE, limit = 10) ## End(Not run)
## Not run: # Setting API key to 'demo' allows for AAPL only fmpc_set_token() fmpc_financial_bs_is_cf() fmpc_financial_bs_is_cf('AAPL',statement = 'balance', quarterly = FALSE, growth = FALSE, SECReported = TRUE, limit = 10) # Must set a valid API token fmpc_set_token('FMPAPIKEY') fmpc_financial_bs_is_cf(c('AAPL','MSFT','TSLA')) symbols = c('AAPL','MSFT','BAC') Bal = fmpc_financial_bs_is_cf(symbols,statement = 'balance') BalG = fmpc_financial_bs_is_cf(symbols,statement = 'balance', growth = FALSE) IS = fmpc_financial_bs_is_cf(symbols,statement = 'income') ISa = fmpc_financial_bs_is_cf(symbols,statement = 'income', quarterly = FALSE) cf = fmpc_financial_bs_is_cf(symbols,statement = 'cashflow') cfsec = fmpc_financial_bs_is_cf(symbols,statement = 'cashflow', SECReported = TRUE) # International tickers work fmpc_financial_bs_is_cf('RY.TO',statement = 'balance', quarterly = TRUE, growth = TRUE, SECReported = FALSE, limit = 10) ## End(Not run)
Pull Discounted Cash Flow Value for one or more securities
fmpc_financial_dcfv( symbols = c("AAPL"), period = c("current", "daily", "quarterly", "annually"), limit = 100 )
fmpc_financial_dcfv( symbols = c("AAPL"), period = c("current", "daily", "quarterly", "annually"), limit = 100 )
symbols |
one or more publicly traded companies domestic or international |
period |
period for discounted cash flow - current, daily, quarterly, annually |
limit |
limit the result for each ticker |
data frame of discounted cash flow
## Not run: # Demo can pull AAPL fmpc_set_token() fmpc_financial_dcfv('AAPL') # For multiple symbols, set a valid API Token fmpc_set_token('FMPAPIKEY') fmpc_financial_dcfv(c('AAPL','MSFT','SPY'), period = 'quarterly') ## End(Not run)
## Not run: # Demo can pull AAPL fmpc_set_token() fmpc_financial_dcfv('AAPL') # For multiple symbols, set a valid API Token fmpc_set_token('FMPAPIKEY') fmpc_financial_dcfv(c('AAPL','MSFT','SPY'), period = 'quarterly') ## End(Not run)
Pull finance ratios, enterprise value, key metrics, and financial growth
fmpc_financial_metrics( symbols = "AAPL", metric = c("ratios", "key", "ev", "growth"), quarterly = TRUE, trailingTwelve = FALSE, limit = 100 )
fmpc_financial_metrics( symbols = "AAPL", metric = c("ratios", "key", "ev", "growth"), quarterly = TRUE, trailingTwelve = FALSE, limit = 100 )
symbols |
one or more publicly traded companies domestic or international |
metric |
indicate the statement to view. Can be 'income', 'balance', or 'cashflow' |
quarterly |
TRUE/FALSE whether the statement should be shown quarterly or annually |
trailingTwelve |
TRUE/FALSE whether finance ratios should show as trailing 12 months. Only available for finance ratios. |
limit |
limit the result for each ticker |
data frame of financial metrics
## Not run: # Setting API key to 'demo' allows for AAPL only fmpc_set_token() fmpc_financial_metrics() fmpc_financial_metrics('AAPL',metric = 'ratios', quarterly = FALSE, trailingTwelve = FALSE, limit = 10) # Must set a valid API token fmpc_set_token('FMPAPIKEY') fmpc_financial_metrics(c('AAPL','MSFT','TSLA')) # International tickers work fmpc_financial_metrics('RY.TO',metric = 'key', quarterly = TRUE, trailingTwelve = TRUE, limit = 10) ## End(Not run)
## Not run: # Setting API key to 'demo' allows for AAPL only fmpc_set_token() fmpc_financial_metrics() fmpc_financial_metrics('AAPL',metric = 'ratios', quarterly = FALSE, trailingTwelve = FALSE, limit = 10) # Must set a valid API token fmpc_set_token('FMPAPIKEY') fmpc_financial_metrics(c('AAPL','MSFT','TSLA')) # International tickers work fmpc_financial_metrics('RY.TO',metric = 'key', quarterly = TRUE, trailingTwelve = TRUE, limit = 10) ## End(Not run)
Get location to download ZIP file for all symbols. This function will not download the file. Use a 'wget' command or enter the link into a browser.
fmpc_financial_zip()
fmpc_financial_zip()
a data frame of symbols with zip file location
## Not run: # Must set a valid API token fmpc_set_token('FMPAPIKEY') fmpc_financial_zip() ## End(Not run)
## Not run: # Must set a valid API token fmpc_set_token('FMPAPIKEY') fmpc_financial_zip() ## End(Not run)
FMP helper function that takes a URL, appends the API Token, makes a GET call, and parses the data
fmpc_get_url(URL, api_version = "3")
fmpc_get_url(URL, api_version = "3")
URL |
The URL to pull specific data from FMP Cloud. Search parameters should be included, but not the API key. Start with the URL after 'api/v3' |
api_version |
The API version of the URL. FMP is constantly updating their API and new URLs may be under anew version |
This function is a helper in most other fmpcloudr functions, so does not need to be used by the end user. That being said, FMP is always adding data with new URLs. If this package does not have a URL available on FMP, this function can be used to simplify the GET call. Pass the URL appearing after 'api/v3' with the search parameters entered, but do not include the API token
list output of data set
## Not run: # Set the FMP Token. The DEMO token has VERY limited access. fmpc_set_token('demo') # Pull price history for Apple AppleHist = fmpc_get_url('historical-price-full/AAPL?serietype=line&') ## End(Not run)
## Not run: # Set the FMP Token. The DEMO token has VERY limited access. fmpc_set_token('demo') # Pull price history for Apple AppleHist = fmpc_get_url('historical-price-full/AAPL?serietype=line&') ## End(Not run)
Shows mutual funds holding a list of symbols provided. Not currently available for ETFs
fmpc_held_by_mfs(symbols = c("AAPL"))
fmpc_held_by_mfs(symbols = c("AAPL"))
symbols |
one or more symbols from the FMP available list that can be
found using |
This differs from fmpc_holdings_etf
which allows a search by
ETF to see detail on what the ETF is holding.
data frame of mutual funds holding specified security
## Not run: # Demo can pull AAPL fmpc_set_token() fmpc_held_by_mfs('AAPL') # For multiple symbols, set a valid API Token fmpc_set_token('FMPAPIKEY') fmpc_held_by_mfs(c('AAPL','MSFT','GOOGL')) ## End(Not run)
## Not run: # Demo can pull AAPL fmpc_set_token() fmpc_held_by_mfs('AAPL') # For multiple symbols, set a valid API Token fmpc_set_token('FMPAPIKEY') fmpc_held_by_mfs(c('AAPL','MSFT','GOOGL')) ## End(Not run)
Shows holdings data for one or more ETFs provided. Either individual holdings, sector weightings, or country weightings.
fmpc_holdings_etf(etfs = c("SPY"), holding = c("symbol", "sector", "country"))
fmpc_holdings_etf(etfs = c("SPY"), holding = c("symbol", "sector", "country"))
etfs |
one or more valid ETFs. |
holding |
holding type can be other individual symbols, the sector breakdown, or the country breakdown. Valid inputs include 'symbol', 'sector', 'country' |
This differs from fmpc_held_by_mfs
which allows a search by
symbol to see the mutual funds holding the specified symbol(s). This function
searches by ETF and shows the holding of the ETF
data frame of mutual fund holdings
## Not run: # For multiple symbols, set a valid API Token fmpc_set_token('FMPAPIKEY') fmpc_holdings_etf(c('VOO','SPY'), holding = 'symbol') fmpc_holdings_etf(c('VOO','SPY'), holding = 'country') fmpc_holdings_etf(c('VOO','SPY'), holding = 'sector') ## End(Not run)
## Not run: # For multiple symbols, set a valid API Token fmpc_set_token('FMPAPIKEY') fmpc_holdings_etf(c('VOO','SPY'), holding = 'symbol') fmpc_holdings_etf(c('VOO','SPY'), holding = 'country') fmpc_holdings_etf(c('VOO','SPY'), holding = 'sector') ## End(Not run)
Pulls back current day market hours and holidays for 2019 going forward
fmpc_market_hours()
fmpc_market_hours()
an object of class list containing two data frames for market hours and holidays
## Not run: # Must set a valid API token fmpc_set_token('FMPAPIKEY') fmpc_market_hours() ## End(Not run)
## Not run: # Must set a valid API token fmpc_set_token('FMPAPIKEY') fmpc_market_hours() ## End(Not run)
Returns 10,000 or more symbols for a specific date. This generates one API call for each date. Dates must be entered one at a time.
fmpc_price_batch_eod(priceDate = Sys.Date() - 1)
fmpc_price_batch_eod(priceDate = Sys.Date() - 1)
priceDate |
price date to pull all securities. Use format yyyy-mm-dd |
data frame of a single days prices
## Not run: fmpc_set_token('FMPAPIKEY') allSymbs = fmpc_price_batch_eod('2020-06-24') ## End(Not run)
## Not run: fmpc_set_token('FMPAPIKEY') allSymbs = fmpc_price_batch_eod('2020-06-24') ## End(Not run)
Last traded price with additional price metrics such as 50D and 200D avg price, volume, shares outstanding, and more. This does NOT include a quote, such as bid/ask detail.
fmpc_price_current(symbols = c("AAPL"))
fmpc_price_current(symbols = c("AAPL"))
symbols |
one or more symbols from the FMP available list that can be
found using |
data frame of current price details
## Not run: # Setting API key to 'demo' allows for AAPL only fmpc_set_token() fmpc_price_current('AAPL') # For multiple symbols, set a valid API Token fmpc_set_token('FMPAPIKEY') fmpc_price_current(c('AAPL', 'MSFT', 'TSLA', 'SPY', 'BTCUSD', 'JPYUSD', '^SP500TR')) ## End(Not run)
## Not run: # Setting API key to 'demo' allows for AAPL only fmpc_set_token() fmpc_price_current('AAPL') # For multiple symbols, set a valid API Token fmpc_set_token('FMPAPIKEY') fmpc_price_current(c('AAPL', 'MSFT', 'TSLA', 'SPY', 'BTCUSD', 'JPYUSD', '^SP500TR')) ## End(Not run)
Use a valid API Token to pull all foreign exchange quotes which includes
Bid/Ask. Set API token using fmpc_set_token
.
fmpc_price_forex()
fmpc_price_forex()
a data frame of forex with quotes
## Not run: # Must set a valid API token fmpc_set_token('FMPAPIKEY') fmpc_price_forex() ## End(Not run)
## Not run: # Must set a valid API token fmpc_set_token('FMPAPIKEY') fmpc_price_forex() ## End(Not run)
Enter a market to get last traded price with additional price metrics such as 50D and 200D avg price, volume, shares outstanding, etc. This does NOT include a quote, such as bid/ask detail. Each market will return multiple responses, but only one API call as made per market.
fmpc_price_full_market(market = "etf")
fmpc_price_full_market(market = "etf")
market |
Select a market to get current price for all securities: 'etf','commodity','euronext','nyse','amex','tsx','index','mutual_fund', 'nasdaq','crypto','forex'. Select a single market. |
data frame of current price
## Not run: fmpc_set_token('FMPAPIKEY') fmpc_price_full_market('index') fmpc_price_full_market('forex') fmpc_price_full_market() # Default is to 'etf' ## End(Not run)
## Not run: fmpc_set_token('FMPAPIKEY') fmpc_price_full_market('index') fmpc_price_full_market('forex') fmpc_price_full_market() # Default is to 'etf' ## End(Not run)
End of Day price history includes open, high, low, close, adjClose, volume,
vwap, and more. Symbol can include equity, mutual fund, index, currency, crypto,
or any other symbol that can be found in fmpc_symbols_by_market
.
fmpc_price_history( symbols = "AAPL", startDate = Sys.Date() - 30, endDate = Sys.Date() )
fmpc_price_history( symbols = "AAPL", startDate = Sys.Date() - 30, endDate = Sys.Date() )
symbols |
one or more symbols from the FMP available list that can be
found using |
startDate |
filter start date in yyyy-mm-dd format. |
endDate |
filter end date in yyyy-mm-dd format. |
a data frame of price history
Each symbol is a separate API call. If the API token has monthly limits, this should be considered before making a bulk request
## Not run: # Default sets token to 'demo' which allows for AAPL only fmpc_set_token() fmpc_price_history('AAPL') # For multiple symbols, set a valid API Token # Crypto, equity, currency, and index can all be entered in the same request fmpc_set_token('FMPAPIKEY') fmpc_price_history(c('AAPL','MSFT','SPY','^SP500TR','JPYUSD','BTCUSD')) ## End(Not run)
## Not run: # Default sets token to 'demo' which allows for AAPL only fmpc_set_token() fmpc_price_history('AAPL') # For multiple symbols, set a valid API Token # Crypto, equity, currency, and index can all be entered in the same request fmpc_set_token('FMPAPIKEY') fmpc_price_history(c('AAPL','MSFT','SPY','^SP500TR','JPYUSD','BTCUSD')) ## End(Not run)
Pulls End of Day prices, splits, and dividends for a list of symbols. Symbol
can include equity, mutual fund, index, currency, crypto, or any other symbol
that can be found in fmpc_symbols_by_market
.
fmpc_price_history_spldiv( symbols = "AAPL", startDate = Sys.Date() - 360, endDate = Sys.Date() )
fmpc_price_history_spldiv( symbols = "AAPL", startDate = Sys.Date() - 360, endDate = Sys.Date() )
symbols |
one or more symbols from the FMP available list that can be
found using |
startDate |
filter start date in yyyy-mm-dd format. |
endDate |
filter end date in yyyy-mm-dd format. |
Uses functions fmpc_price_history
,
fmpc_security_dividends
, and fmpc_security_splits
to aggregate split, dividend, and pricing data into a single data frame.
Warnings may be generated that split data or dividend data was not returned.
Results will still show in this function if price_history data is available.
a data frame of pricing, split, and dividend history
Each symbol is THREE separate API calls. If the API token has monthly limits, this should be considered before making a bulk request. Large Symbol requests will also take time because of the buffer time between API calls.
## Not run: # Setting API key to 'demo' allows for AAPL only fmpc_set_token() fmpc_price_history_spldiv('AAPL') # For multiple symbols, set a valid API Token fmpc_set_token('FMPAPIKEY') # Index, currency, and crypto will return data even without splits/divs fmpc_price_history_spldiv(c('AAPL','MSFT','SPY','^SP500TR','JPYUSD','BTCUSD')) ## End(Not run)
## Not run: # Setting API key to 'demo' allows for AAPL only fmpc_set_token() fmpc_price_history_spldiv('AAPL') # For multiple symbols, set a valid API Token fmpc_set_token('FMPAPIKEY') # Index, currency, and crypto will return data even without splits/divs fmpc_price_history_spldiv(c('AAPL','MSFT','SPY','^SP500TR','JPYUSD','BTCUSD')) ## End(Not run)
Intraday includes open, high, low, close, for each time segment. The amount
of history available is based on the freq set. Smaller time intervals
frequency will pull back less history. Symbol can include equity, mutual
fund, index, currency, crypto, or any other symbol that can be found in
fmpc_symbols_by_market
. Available history is limited by the
increment size.
fmpc_price_intraday( symbols = "AAPL", startDate = Sys.Date() - 30, endDate = Sys.Date(), freq = c("1min", "5min", "15min", "30min", "1hour") )
fmpc_price_intraday( symbols = "AAPL", startDate = Sys.Date() - 30, endDate = Sys.Date(), freq = c("1min", "5min", "15min", "30min", "1hour") )
symbols |
one or more symbols from the FMP available list that can be
found using |
startDate |
filter start date in yyyy-mm-dd format. |
endDate |
filter end date in yyyy-mm-dd format. |
freq |
the frequency of which to pull intraday prices. Options can be '1min','5min','15min','30min','1hour' |
a data frame of intraday prices
Each symbol is a separate API call. If the API token has monthly limits, this should be considered before making a bulk request
## Not run: # Setting API key to 'demo' allows for AAPL only fmpc_set_token() # Freq of1hour will return about 2 months of data fmpc_price_intraday('AAPL', freq = '5min') # For multiple symbols, set a valid API Token fmpc_set_token('FMPAPIKEY') fmpc_price_intraday(symbols = c('AAPL','MSFT','SPY','^SP500TR','JPYUSD','BTCUSD'), startDate = '2020-01-01', freq = '1hour') ## End(Not run)
## Not run: # Setting API key to 'demo' allows for AAPL only fmpc_set_token() # Freq of1hour will return about 2 months of data fmpc_price_intraday('AAPL', freq = '5min') # For multiple symbols, set a valid API Token fmpc_set_token('FMPAPIKEY') fmpc_price_intraday(symbols = c('AAPL','MSFT','SPY','^SP500TR','JPYUSD','BTCUSD'), startDate = '2020-01-01', freq = '1hour') ## End(Not run)
RSS feed of latest submissions to SEC that includes 6-k, 10-Q, 13F
fmpc_rss_sec(limit = 100)
fmpc_rss_sec(limit = 100)
limit |
limit output to a specific number of results |
a data frame of title, data, link to submission, cik, and submission type
## Not run: # Demo offers AAON as an example fmpc_set_token() fmpc_rss_sec() ## End(Not run)
## Not run: # Demo offers AAON as an example fmpc_set_token() fmpc_rss_sec() ## End(Not run)
Shows companies that have been delisted
fmpc_security_delisted(limit = 100)
fmpc_security_delisted(limit = 100)
limit |
set limit of results returned |
data frame of delisted companies
## Not run: # Must set a valid API token fmpc_set_token('FMPAPIKEY') fmpc_security_delisted() ## End(Not run)
## Not run: # Must set a valid API token fmpc_set_token('FMPAPIKEY') fmpc_security_delisted() ## End(Not run)
Pulls dividends for a list of securities. Data includes dividend, adjusted dividend, payment date, record date, and declaration date
fmpc_security_dividends( symbols = "AAPL", startDate = Sys.Date() - 360, endDate = Sys.Date() )
fmpc_security_dividends( symbols = "AAPL", startDate = Sys.Date() - 360, endDate = Sys.Date() )
symbols |
one or more symbols from the FMP available list that can be
found using |
startDate |
filter start date in yyyy-mm-dd format. |
endDate |
filter end date in yyyy-mm-dd format. |
a data frame of dividend history that includes payment date, record date, and declaration date
Each symbol is a separate API call. If the API token has monthly limits, this should be considered before making a bulk request
## Not run: # Setting API key to DEMO allows for AAPL only fmpc_set_token() fmpc_security_dividends('AAPL') # For multiple symbols, set a valid API Token fmpc_set_token('FMPAPIKEY') fmpc_security_dividends(c('AAPL','MSFT','SPY'), startDate = '2010-01-01') ## End(Not run)
## Not run: # Setting API key to DEMO allows for AAPL only fmpc_set_token() fmpc_security_dividends('AAPL') # For multiple symbols, set a valid API Token fmpc_set_token('FMPAPIKEY') fmpc_security_dividends(c('AAPL','MSFT','SPY'), startDate = '2010-01-01') ## End(Not run)
Shows top gainers, bottom losers, and most active for the current trading day
fmpc_security_gla(gla = c("gainers", "losers", "actives"))
fmpc_security_gla(gla = c("gainers", "losers", "actives"))
gla |
options include 'gainers','losers', and 'active' |
securities with details for current trading day
## Not run: # Must set a valid API token fmpc_set_token('FMPAPIKEY') fmpc_security_gla('gainers') fmpc_security_gla('losers') fmpc_security_gla('actives') ## End(Not run)
## Not run: # Must set a valid API token fmpc_set_token('FMPAPIKEY') fmpc_security_gla('gainers') fmpc_security_gla('losers') fmpc_security_gla('actives') ## End(Not run)
Provides current and historical market cap for one or more securities
fmpc_security_mrktcap(symbols = c("AAPL"), limit = 100)
fmpc_security_mrktcap(symbols = c("AAPL"), limit = 100)
symbols |
one or more symbols from the FMP available list that can be
found using |
limit |
limit results for each ticker |
data frame of ratings data
## Not run: # Demo can pull AAPL fmpc_set_token() fmpc_security_mrktcap('AAPL') # For multiple symbols, set a valid API Token fmpc_set_token('FMPAPIKEY') fmpc_security_mrktcap(c('AAPL','MSFT','SPY')) ## End(Not run)
## Not run: # Demo can pull AAPL fmpc_set_token() fmpc_security_mrktcap('AAPL') # For multiple symbols, set a valid API Token fmpc_set_token('FMPAPIKEY') fmpc_security_mrktcap(c('AAPL','MSFT','SPY')) ## End(Not run)
Provides current and historical News. Can enter securities to pull news for specific securities
fmpc_security_news(symbols = NULL, limit = 100)
fmpc_security_news(symbols = NULL, limit = 100)
symbols |
one or more symbols. Use NULL for general latest news |
limit |
limit results for each ticker |
data frame of news for tickers
## Not run: # For multiple symbols, set a valid API Token fmpc_set_token('FMPAPIKEY') fmpc_security_news(c('AAPL','MSFT','SPY')) fmpc_security_news() ## End(Not run)
## Not run: # For multiple symbols, set a valid API Token fmpc_set_token('FMPAPIKEY') fmpc_security_news(c('AAPL','MSFT','SPY')) fmpc_security_news() ## End(Not run)
Provides pricing, market cap, dividend, company description, CEO, number of employees, and more for one or more symbols
fmpc_security_profile(symbols = c("AAPL"))
fmpc_security_profile(symbols = c("AAPL"))
symbols |
one or more symbols from the FMP available list that can be
found using |
data frame of descriptive information
## Not run: # Demo can pull AAPL fmpc_set_token() fmpc_security_profile('AAPL') # For multiple symbols, set a valid API Token fmpc_set_token('FMPAPIKEY') fmpc_security_profile(c('AAPL','MSFT','SPY')) ## End(Not run)
## Not run: # Demo can pull AAPL fmpc_set_token() fmpc_security_profile('AAPL') # For multiple symbols, set a valid API Token fmpc_set_token('FMPAPIKEY') fmpc_security_profile(c('AAPL','MSFT','SPY')) ## End(Not run)
Provides current and historical rating for one or more securities
fmpc_security_ratings(symbols = c("AAPL"), limit = 100)
fmpc_security_ratings(symbols = c("AAPL"), limit = 100)
symbols |
one or more symbols from the FMP available list that can be
found using |
limit |
limit results for each ticker |
data frame of ratings data
## Not run: # Demo can pull AAPL fmpc_set_token() fmpc_security_ratings('AAPL') # For multiple symbols, set a valid API Token fmpc_set_token('FMPAPIKEY') fmpc_security_ratings(c('AAPL','MSFT','SPY')) ## End(Not run)
## Not run: # Demo can pull AAPL fmpc_set_token() fmpc_security_ratings('AAPL') # For multiple symbols, set a valid API Token fmpc_set_token('FMPAPIKEY') fmpc_security_ratings(c('AAPL','MSFT','SPY')) ## End(Not run)
Filter for stocks based on numerous criteria.
fmpc_security_screener( limit = 100, mrktCapAbove = NULL, mrktCapBelow = NULL, betaAbove = NULL, betaBelow = NULL, dividendAbove = NULL, dividendBelow = NULL, volumeAbove = NULL, volumeBelow = NULL, sector = NULL, industry = NULL )
fmpc_security_screener( limit = 100, mrktCapAbove = NULL, mrktCapBelow = NULL, betaAbove = NULL, betaBelow = NULL, dividendAbove = NULL, dividendBelow = NULL, volumeAbove = NULL, volumeBelow = NULL, sector = NULL, industry = NULL )
limit |
limit output to a certain amount or rows |
mrktCapAbove |
integer - market cap greater than |
mrktCapBelow |
integer - market cap less than |
betaAbove |
double - beta greater than |
betaBelow |
double - beta less than |
dividendAbove |
double - dividend greater than |
dividendBelow |
double - dividend less than |
volumeAbove |
integer - volume in shares greater than |
volumeBelow |
integer - volume in shares less than |
sector |
indicate a sector. Documentation is unclear of options. 'tech' is the example used |
industry |
indicate an industry. Documentation is unclear of options. 'Software' is the example used |
This function will temporarily modify options(scipen=999).
a list of securities based on criteria supplied
## Not run: # Must set a valid API token fmpc_set_token('FMPAPIKEY') fmpc_security_screener() # Default pulls a list of 100 with no filters # Search for market cap above a billion, # that trades at least a million shares with a dividend under 1 fmpc_security_screener(mrktCapAbove = 1e9, dividendBelow = 1, volumeAbove = 1e6) ## End(Not run)
## Not run: # Must set a valid API token fmpc_set_token('FMPAPIKEY') fmpc_security_screener() # Default pulls a list of 100 with no filters # Search for market cap above a billion, # that trades at least a million shares with a dividend under 1 fmpc_security_screener(mrktCapAbove = 1e9, dividendBelow = 1, volumeAbove = 1e6) ## End(Not run)
For each day, the return for a sector will be pulled
fmpc_security_sector(days = 25)
fmpc_security_sector(days = 25)
days |
number of trading days to pull returns from current day. For example, 20 will pull the last 20 trading days, about one month of data. |
data frame of sectors and daily returns
## Not run: fmpc_set_token('FMPAPIKEY') allSymbs = fmpc_security_sector(30) ## End(Not run)
## Not run: fmpc_set_token('FMPAPIKEY') allSymbs = fmpc_security_sector(30) ## End(Not run)
Pulls stock split history for one or more securities
fmpc_security_splits( symbols = "AAPL", startDate = Sys.Date() - 3600, endDate = Sys.Date() )
fmpc_security_splits( symbols = "AAPL", startDate = Sys.Date() - 3600, endDate = Sys.Date() )
symbols |
one or more symbols from the FMP available list that can be
found using |
startDate |
filter start date in yyyy-mm-dd format. |
endDate |
filter end date in yyyy-mm-dd format. |
a data frame of split history
Each symbol is a separate API call. If the API token has monthly limits, this should be considered before making a bulk request
## Not run: # Setting API key to DEMO allows for AAPL only fmpc_set_token() fmpc_security_splits('AAPL') # For multiple symbols, set a valid API Token fmpc_set_token('FMPAPIKEY') fmpc_security_splits(c('AAPL','TSLA'), startDate = '2020-01-01') ## End(Not run)
## Not run: # Setting API key to DEMO allows for AAPL only fmpc_set_token() fmpc_security_splits('AAPL') # For multiple symbols, set a valid API Token fmpc_set_token('FMPAPIKEY') fmpc_security_splits(c('AAPL','TSLA'), startDate = '2020-01-01') ## End(Not run)
Pull Technical Indicators for a set of symbols over a specific number of periods set by the frequency
fmpc_security_tech_indic( symbols = "AAPL", indicator = c("SMA", "EMA", "WMA", "DEMA", "TEMA", "williams", "RSI", "ADX", "standardDeviation"), freq = c("daily", "1min", "5min", "15min", "30min", "1hour", "4hour"), period = 10 )
fmpc_security_tech_indic( symbols = "AAPL", indicator = c("SMA", "EMA", "WMA", "DEMA", "TEMA", "williams", "RSI", "ADX", "standardDeviation"), freq = c("daily", "1min", "5min", "15min", "30min", "1hour", "4hour"), period = 10 )
symbols |
one or more symbols from the FMP available list that can be
found using |
indicator |
'SMA', 'EMA', 'WMA', 'DEMA', 'TEMA', 'williams', 'RSI', 'ADX', 'standardDeviation' |
freq |
the frequency of which to pull intraday data. Options are '1min', '5min', '15min', '30min', '1hour' |
period |
Number of periods over which to calculate the technical indicator |
Technical indicators include: 'SMA', 'EMA', 'WMA', 'DEMA', 'TEMA', 'williams', 'RSI', 'ADX', 'standardDeviation'
technical indicator in a data frame
## Not run: # Setting API key to DEMO allows for AAPL only fmpc_set_token() fmpc_security_tech_indic('AAPL') fmpc_security_tech_indic('AAPL', indicator = 'standardDeviation') fmpc_security_tech_indic('AAPL', 'sma') # For multiple symbols, set a valid API Token fmpc_set_token('FMPAPIKEY') fmpc_security_tech_indic(c('AAPL','MSFT','SPY'), indicator = 'RSI', freq = '15min', period = 25) ## End(Not run)
## Not run: # Setting API key to DEMO allows for AAPL only fmpc_set_token() fmpc_security_tech_indic('AAPL') fmpc_security_tech_indic('AAPL', indicator = 'standardDeviation') fmpc_security_tech_indic('AAPL', 'sma') # For multiple symbols, set a valid API Token fmpc_set_token('FMPAPIKEY') fmpc_security_tech_indic(c('AAPL','MSFT','SPY'), indicator = 'RSI', freq = '15min', period = 25) ## End(Not run)
Pass a valid FMP API Token to enable all other functions
fmpc_set_token(APIToken = "demo", timeBtwnReq = 0.1, noBulkWarn = FALSE)
fmpc_set_token(APIToken = "demo", timeBtwnReq = 0.1, noBulkWarn = FALSE)
APIToken |
a valid API Token from FMP Cloud |
timeBtwnReq |
Time between API calls in seconds. FMP Cloud may limit API call frequency depending on the package subscription. Use this to set a time between API calls. The default is .1 to limit calls to no more than 10 per second. |
noBulkWarn |
Boolean of TRUE or FALSE. When making large API calls, an initial warning will be given to make sure the user wants to make bulk requests. If the user has a FREE FMP API a bulk request may be undesirable. Each symbol requested for many functions will be a unique API request. Use this parameter to silence this warning. |
In order to use the FMP Cloud API, an account must be created at FMP Cloud. There is a free account option that but sets a cap at 250 calls. There are different subscription levels. To use this package, the free subscription can be used up to the limit.
Please note that most functions will make an individual API call for each symbol passed. If running a function on multiple symbols, be aware this could quickly hit API call limits. When running in an interactive environment, a warning will appear asking to confirm running bulk requests. This can be suppressed for a session using the options. You can also suppress when using the option noBulkWarn = TRUE in this function. When running in a non interactive environment like CRON, the bulk request will be processed without a warning regardless.
## Not run: # Set the FMP Token. The DEMO token has VERY limited access. fmpc_set_token('demo', timeBtwnReq = 0, noBulkWarn = TRUE) ## End(Not run)
## Not run: # Set the FMP Token. The DEMO token has VERY limited access. fmpc_set_token('demo', timeBtwnReq = 0, noBulkWarn = TRUE) ## End(Not run)
Enter search string to pull back matching symbols or companies
fmpc_symbol_search(query = "apple inc", limit = 10)
fmpc_symbol_search(query = "apple inc", limit = 10)
query |
a search string,for example 'tech' |
limit |
limit the results to a certain number |
list of symbols and companies that meet the search criteria
## Not run: # Function can work without a valid API token fmpc_set_token() # defaults to 'demo' fmpc_symbol_search('apple') fmpc_symbol_search('tech', 100) ## End(Not run)
## Not run: # Function can work without a valid API token fmpc_set_token() # defaults to 'demo' fmpc_symbol_search('apple') fmpc_symbol_search('tech', 100) ## End(Not run)
Use a valid API Token to pull all symbols that have a profile on FMP Cloud.
Pull the profile using fmpc_security_profile
. Set API
token using fmpc_set_token
.
fmpc_symbols_available()
fmpc_symbols_available()
a data frame of symbols with descriptions
## Not run: # Must set a valid API token fmpc_set_token('FMPAPIKEY') fmpc_symbols_available() ## End(Not run)
## Not run: # Must set a valid API token fmpc_set_token('FMPAPIKEY') fmpc_symbols_available() ## End(Not run)
Pulls all symbols available on FMP Cloud that has historical pricing data. Markets can include equities, mutual funds, commodities, indexes, and more.
fmpc_symbols_by_market(market = "all")
fmpc_symbols_by_market(market = "all")
market |
select one or more markets to pull available symbols. options include: 'all', 'etf', 'commodity', 'euronext', 'nyse',' amex', 'tsx', 'index', 'mutual_fund', 'nasdaq', 'crypto', 'forex' |
a data frame of pricing, split, and dividend history
Running 'all' generates 11 API calls
## Not run: # A valid token must be set to use this function fmpc_set_token('FMPAPIKEY') fmpc_symbols_by_market(market = c('index','commodity')) fmpc_symbols_by_market() # default will pull all markets ## End(Not run)
## Not run: # A valid token must be set to use this function fmpc_set_token('FMPAPIKEY') fmpc_symbols_by_market(market = c('index','commodity')) fmpc_symbols_by_market() # default will pull all markets ## End(Not run)
Shows current or historical companies in the S&P 500, Nasdaq, or Dow Jones
fmpc_symbols_index( period = c("current", "historical"), index = c("sp500", "nasdaq", "dowjones") )
fmpc_symbols_index( period = c("current", "historical"), index = c("sp500", "nasdaq", "dowjones") )
period |
'current' for current list, 'historical' for a list of companies that have been added and the ones that were replaced |
index |
indicate the index to pull for: sp500, dowjones, nasdaq |
data frame of constituents
## Not run: # Must set a valid API token fmpc_set_token('FMPAPIKEY') fmpc_symbols_index() fmpc_symbols_index('historical','nasdaq') ## End(Not run)
## Not run: # Must set a valid API token fmpc_set_token('FMPAPIKEY') fmpc_symbols_index() fmpc_symbols_index('historical','nasdaq') ## End(Not run)