eia_series_category_query: Get category names for selected EIA series ID.

Description Usage Arguments Details Author(s) Examples

Description

This function requests and returns data from the EIA API.

Usage

1
2
eia_series_category_query(series_id, api_key, format = "json",
  simplify = TRUE)

Arguments

series_id

A case-sensitive string consisting of letters, numbers, dashes ("-") and periods (".") that uniquely identifies an EIA series. unique numerical ID of the EIA data category to fetch.

api_key

Required. A valid API key is required and may be obtained from EIA registration page (see details).

format

API return format. Valid values are 'xml' or 'json'. Default is for API to return JSON formatted output. Note that it is also necessary to set simplify = FALSE to access 'xml' or 'json' formatted output.

simplify

Logical. If TRUE, the function returns data in a data frame. If FALSE, function returns data in specified output format.

Details

# Download category data from the EIA API

Users of the EIA API are required to obtain an API Key from the EIA Open Data registration page (https://www.eia.gov/opendata/register.php). A valid email address is required as part of the registration process.

Note that the number of series in a single request is limited to 100.

Author(s)

David Mitchell <david.pk.mitchell@gmail.com>

Examples

1
2
3
  
    eia_cat <- eia_series_category_query(series_id="ELEC.GEN.ALL-AK-99.A", api_key = "Your API Key")
  

mitcda/eiastats documentation built on May 8, 2019, 12:48 p.m.