set_fred_key: Set a FRED API Key

View source: R/register.R

set_fred_keyR Documentation

Set a FRED API Key

Description

Function used to set the default key. If included, then key arguments in FRED API calls are no longer needed. API keys can be requested at https://fred.stlouisfed.org/docs/api/api_key.html.

Usage

set_fred_key(key)

Arguments

key

32 character lower-cased alpha-numeric character string

Details

The package does not supply an API key of its own. Either register your own key with set_fred_key once per session, or pass it to each function through its key argument. Functions that need a key and cannot find one will stop with a message explaining how to obtain and register it.

The key is stored for the session in the FRED_KEY environment variable. To avoid registering it in every session, set FRED_KEY in your .Renviron file instead.

Value

NULL

Examples

set_fred_key("abcdefghijklmnopqrstuvwxyz123456")


eFRED documentation built on Oct. 22, 2026, 5:23 p.m.