get_api_key: Get and set API keys

View source: R/auth.R

get_api_keyR Documentation

Get and set API keys

Description

Get and set the API key used to make requests to the Epidata API. Without a key, requests may be subject to rate limits and other limitations.

Usage

get_api_key()

save_api_key()

Details

We recommend you register for an API key. While most endpoints are available without one, there are limits on API usage for anonymous users, including a rate limit. If you regularly request large amounts of data, please consider registering for an API key.

API keys are strings read from the environment variable DELPHI_EPIDATA_KEY. We recommend setting your key with save_api_key(), which will modify an applicable .Renviron file, which will be read in automatically when you start future R sessions (see ?Startup for details on .Renviron files). Alternatively, you can modify the environment variable at the command line before/while launching R, or inside an R session with Sys.setenv(), but these will not persist across sessions.

Once an API key is set, it is automatically used for all requests made by functions in this package.

Value

For get_api_key(), returns the current API key as a string, or "" if none is set.

References


epidatr documentation built on June 22, 2024, 9:15 a.m.