powered by
This function can pull time series from the ALFRED database: https://alfred.stlouisfed.org. Downloading different vintages for performing real-time analysis is provided.
get_alfred_series( series_id, series_name = NULL, observation_start = NULL, observation_end = NULL, realtime_start = NULL, realtime_end = NULL, api_key = NULL )
FRED times series ID.
Choose a name for the series column in output. Default: series_id.
Date of first observation in "yyyy-mm-dd" format. Default: Earliest observation available.
Date of last observation in "yyyy-mm-dd" format. Default: Last observation available.
Date of first real time period in "yyyy-mm-dd" format. Default: First vintage date available.
Date of last real time period in "yyyy-mm-dd" format. Default: Last vintage date available.
You can supply your own apikey obtained via https://fredaccount.stlouisfed.org/login/secure/) if you want to run a large batch of requests. Otherwise you might run into query limits of the API.
FRED time series IDs can be found on the respective site in ALFRED, e.g. https://alfred.stlouisfed.org/series?seid=CPIAUCSL.
if (FALSE) { get_alfred_series("INDPRO", "indpro") } if (FALSE) { get_alfred_series("INDPRO", "indpro", realtime_start = "2008-10-31", realtime_end = "2009-10-31") }
Run the code above in your browser using DataLab