Get data descriptions and metadata from the EIA API
eia_metadata(api_path = NULL, api_key)
A string, the API category/route path following the API endpoint (i.e., 'https://api.eia.gov/v2/') If set to NULL (default) or as empty string "" it returns the main categories available on the API. The path can be found on the EIA API dashboard, for more details see https://www.eia.gov/opendata/browser/
A string, EIA API key, see https://www.eia.gov/opendata/ for registration to the API service
a list object with the series description and metadata
The function enables to explore the different data categories and available routes inline with the API dashboard (https://www.eia.gov/opendata/browser/)
if (FALSE) {
electricity_metadata <- eia_metadata(api_key = Sys.getenv("eia_key"),
api_path = "electricity")
electricity_metadata$response$description
electricity_metadata$response$id
electricity_metadata$response$name
electricity_metadata$response$routes
}