Retrieve Reference Data for Stocks from ‘twelvedata’
ref_stocks(
sym = "",
as = c("data.frame", "raw"),
exchange = "",
country = "",
type = c(NA_character_, "EQUITY", "Common", "Common Stock",
"American Depositary Receipt", "Real Estate Investment Trust (REIT)", "Unit", "GDR",
"Closed-end Fund", "ETF", "Depositary Receipt", "Preferred Stock",
"Limited Partnership", "OTHER_SECURITY_TYPE", "Warrant", "STRUCTURED_PRODUCT",
"Exchange-traded Note", "Right", "FUND", "Trust", "Index",
"Unit Of Beneficial Interest", "MUTUALFUND", "New York Registered Shares"),
apikey
)
(optional, character) A (single or vector) symbol understood by the backend as a stock symbol, foreign exchange pair, or more. See the ‘twelvedata’ documentation for details on what is covered.
(optional, character) A selector for the desired output format: one of “data.frame” (the default) or or “raw”.
(optional, character) A selection of the exchange. Default value is unset.
(optional, character) A selection of the country exchanges. Default value is unset.
(optional, character) A valid security type selection, if set it must be one of
formals(ref_stock)$type
, with NA
as default.
(optional character) An API key override, if missing a value cached from
package startup is used. The startup looks for either a file in the per-package config
directory provided by tools::R_user_dir
(for R 4.0.0 or later), or the
TWELVEDATA_API_KEY
variable.
The requested data is returned as a data.frame
object.
ref_stocks
.