Learn R Programming

fred (version 0.3.1)

fred_request: Make a raw request to the FRED API

Description

Low-level function that sends a request to any FRED API endpoint and returns the parsed JSON as a list. Most users should use the higher-level functions such as fred_series() or fred_search().

Usage

fred_request(endpoint, ...)

Value

A list parsed from the JSON response.

Arguments

endpoint

Character. The API endpoint path (e.g. "series/observations").

...

Named parameters passed as query string arguments to the API.

See Also

Other configuration: clear_cache(), fred_cache_info(), fred_get_key(), fred_set_key()

Examples

Run this code
# \donttest{
op <- options(fred.cache_dir = tempdir())
try({
  fred_request("series", series_id = "GDP")
})
options(op)
# }

Run the code above in your browser using DataLab