| Title: | Flexible Client for the 'Financial Modeling Prep' API |
|---|---|
| Description: | Provides a flexible interface to the 'Financial Modeling Prep' API <https://site.financialmodelingprep.com/developer/docs>. The package supports all available endpoints and parameters, enabling R users to interact with a wide range of financial data. |
| Authors: | Christoph Scheuch [aut, cre, cph] (ORCID: <https://orcid.org/0009-0004-0423-6819>) |
| Maintainer: | Christoph Scheuch <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.0.1.9000 |
| Built: | 2026-05-09 08:36:22 UTC |
| Source: | https://github.com/tidy-finance/r-fmpapi |
This function fetches financial data from the FMP API, including balance sheet statements, income statements, cash flow statements, historical market data, stock lists, and company profiles.
fmp_get( resource, symbol = NULL, params = list(), api_version = "stable", snake_case = TRUE )fmp_get( resource, symbol = NULL, params = list(), api_version = "stable", snake_case = TRUE )
resource |
A string indicating the API resource to query. Examples
include |
symbol |
A string specifying the stock ticker symbol (optional). |
params |
List of additional arguments to customize the query (optional). |
api_version |
A string specifying the version of the FMP API to use.
Defaults to |
snake_case |
A boolean indicating whether column names are converted
to snake_case. Defaults to |
A data frame containing the processed financial data.
## Not run: # Get available balance sheet statements fmp_get( resource = "balance-sheet-statement", symbol = "AAPL" ) # Get last income statements fmp_get( resource = "income-statement", symbol = "AAPL", params = list(limit = 1) ) # Get annual cash flow statements fmp_get( resource = "cash-flow-statement", symbol = "AAPL", params = list(period = "annual") ) # Get historical market capitalization fmp_get( resource = "historical-market-capitalization", symbol = "UNH", params = list(from = "2023-12-01", to = "2023-12-31") ) # Get stock list fmp_get( resource = "stock/list" ) # Get company profile fmp_get( resource = "profile", symbol = "AAPL" ) # Search for stock information fmp_get( resource = "search", params = list(query = "AAP") ) # Get data with original column names fmp_get( resource = "profile", symbol = "AAPL", snake_case = FALSE ) ## End(Not run)## Not run: # Get available balance sheet statements fmp_get( resource = "balance-sheet-statement", symbol = "AAPL" ) # Get last income statements fmp_get( resource = "income-statement", symbol = "AAPL", params = list(limit = 1) ) # Get annual cash flow statements fmp_get( resource = "cash-flow-statement", symbol = "AAPL", params = list(period = "annual") ) # Get historical market capitalization fmp_get( resource = "historical-market-capitalization", symbol = "UNH", params = list(from = "2023-12-01", to = "2023-12-31") ) # Get stock list fmp_get( resource = "stock/list" ) # Get company profile fmp_get( resource = "profile", symbol = "AAPL" ) # Search for stock information fmp_get( resource = "search", params = list(query = "AAP") ) # Get data with original column names fmp_get( resource = "profile", symbol = "AAPL", snake_case = FALSE ) ## End(Not run)
This function prompts the user to input their Financial Modeling Prep (FMP)
API key and saves it to a .Renviron file, either in the project directory
or the home directory. It also gives the user the option to add .Renviron
to .gitignore for security purposes.
fmp_set_api_key()fmp_set_api_key()
Invisibly returns TRUE after saving the key or aborting the
operation. The function will read the .Renviron file after saving,
allowing the environment variables to be immediately available. A restart of
the R session is recommended.
fmp_set_api_key()fmp_set_api_key()