The Tiingo API provides a large feed of historical data at the daily (and weekly, monthly, or annual) level.
riingo_prices( ticker, start_date = NULL, end_date = NULL, resample_frequency = "daily" )
ticker | One or more tickers to download data for from Tiingo. Can be a stock, mutual fund, or ETF. A character vector. |
---|---|
start_date | The first date to download data for.
A character in the form YYYY-MM-DD, or a |
end_date | The last date to download data for.
A character in the form YYYY-MM-DD, or a |
resample_frequency | For Tiingo data, a character specified as one of:
For IEX data, a character specified at the For Crypto data, a character specified at the |
Multiple downloads are done sequentially, meaning that downloading 5 tickers costs 5 requests against your usage limits. Sadly Tiingo does not support batch downloads at the moment.
Tiingo supplied documentation regarding the resample frequency:
daily: Values returned as daily periods, with a holiday calendar
weekly: Values returned as weekly data, with days ending on Friday
monthly: Values returned as monthly data, with days ending on the last standard business day (Mon-Fri) of each month
annually: Values returned as annual data, with days ending on the last standard business day (Mon-Fri) of each year
Note, that if you choose a value in-between the resample period for weekly, monthly, and daily, the start date rolls back to consider the entire period. For example, if you choose to resample weekly, but your "start_date" parameter is set to Wednesday of that week, the start_date will be adjusted to Monday, so the entire week is captured. Another example is if you send a start_date mid-month, we roll back the start_date to the beginning of the month.
Similarly, if you provide an end_date, and it's midway through the period, we roll-forward the date to capture the whole period. In the above example, if the end date is set to a wednesday with a weekly resample, the end date is rolled forward to the Friday of that week.