get_tickers {yfinancer} | R Documentation |
Get Ticker Objects
Description
Creates one or more ticker objects for accessing data for ticker symbols. This function handles both single and multiple ticker symbols and validates the provided ticker symbols.
Usage
get_tickers(..., proxy = NULL)
Arguments
... |
One or more ticker symbols as separate arguments (e.g., "AAPL", "MSFT") |
proxy |
Optional proxy settings |
Value
For a single symbol: A list containing ticker data and methods with class "yf_ticker" For multiple symbols: A list containing multiple ticker objects with class "yf_tickers"
Rate Limiting
Yahoo Finance does not provide official API documentation or rate limits. Based on community observations, there are approximate limits of a few hundred requests per day from a single IP address before throttling may occur. When working with multiple tickers, consider:
Batching requests when possible
Adding delays between requests using
Sys.sleep()
Caching results for frequently accessed tickers
Using the batch functions (e.g.,
get_tickers_history()
) instead of individual calls
Examples
## Not run:
# Get a single ticker
apple <- get_tickers("AAPL")
# Get historical data for a single ticker
apple_history <- get_history(apple)
# Get company information for a single ticker
apple_info <- get_info(apple)
# Get multiple tickers
tech_tickers <- get_tickers("AAPL", "MSFT", "GOOG")
# Get information for multiple tickers
tech_info <- get_tickers_info(tech_tickers)
# Get historical data for multiple tickers
tech_history <- get_tickers_history(tech_tickers, period = "1y")
## End(Not run)