% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/download_data_fred.R
\name{download_data_fred}
\alias{download_data_fred}
\title{Download and Process Data from FRED}
\usage{
download_data_fred(series, start_date = NULL, end_date = NULL)
}
\arguments{
\item{series}{A character vector specifying the FRED series ID(s) to
download.}

\item{start_date}{Optional. A character string or Date object in
"YYYY-MM-DD" format specifying the start date for the data. If not
provided, the full dataset is returned.}

\item{end_date}{Optional. A character string or Date object in
"YYYY-MM-DD" format specifying the end date for the data. If not
provided, the full dataset is returned.}
}
\value{
A tibble containing the processed data with three columns:
\describe{
\item{date}{The date corresponding to the data point.}
\item{value}{The value of the data series at that date.}
\item{series}{The FRED series ID corresponding to the data.}
}
}
\description{
Downloads a specified data series from the Federal Reserve Economic Data
(FRED) website, processes the data, and returns it as a tibble.
}
\details{
Constructs the URL based on the provided FRED series ID, performs an HTTP
GET request to download the data in CSV format, and processes it to a tidy
tibble format. The resulting tibble includes the date, value, and the series
ID.

This approach is inspired by \code{quantmod::getSymbolsFRED()} which uses a
different wrapper around the same FRED download data site. If you want to
systematically download FRED data via API, please consider using the \code{fredr}
package.
}
\examples{
\donttest{
  download_data_fred("CPIAUCNS")
  download_data_fred(c("GDP", "CPIAUCNS"), "2010-01-01", "2010-12-31")
}

}
\seealso{
Other download functions: 
\code{\link{download_data}()},
\code{\link{download_data_constituents}()},
\code{\link{download_data_factors_ff}()},
\code{\link{download_data_factors_q}()},
\code{\link{download_data_huggingface}()},
\code{\link{download_data_macro_predictors}()},
\code{\link{download_data_osap}()},
\code{\link{download_data_risk_free}()},
\code{\link{download_data_stock_prices}()}
}
\concept{download functions}
