fred_set_key: Set the FRED API key

View source: R/auth.R

fred_set_keyR Documentation

Set the FRED API key

Description

Sets the API key used to authenticate requests to the FRED API. The key persists for the current R session. Alternatively, set the FRED_API_KEY environment variable in your .Renviron file.

Usage

fred_set_key(key)

Arguments

key

Character. A 32-character FRED API key.

Details

Register for a free API key at https://fredaccount.stlouisfed.org/apikeys.

Value

Invisible NULL.

See Also

Other configuration: clear_cache(), fred_get_key(), fred_request()

Examples


op <- options(fred.cache_dir = tempdir())
fred_set_key("your_api_key_here")
options(op)


fred documentation built on March 19, 2026, 5:09 p.m.