Function Resource

UnitedStatesCoalProduction

Give coal production amounts for regions in the United States

ResourceFunction["UnitedStatesCoalProduction"][region,key]

gives a time series for coal production in region, using API key from U.S. Energy Information Administration.

Details and Options

An API key can be obtained from: https://www.eia.gov/opendata/register.php.
Regions are specified with codes documented by the API: https://www.eia.gov/opendata/qb.php?category=717278.
A region can be a state, in which case the code is the two-letter state abbreviation.
Coal production quantities are reported in short tons.

Examples

Basic Examples

Coal production in the United States for 2001—2018:

In[1]:=
ts = ResourceFunction[ "https://www.wolframcloud.com/obj/arnoudb/DeployedResources/\
Function/UnitedStatesCoalProduction"]["US", key]
Out[1]=

Average coal production over the time series:

In[2]:=
Mean[ts]
Out[2]=

Minimum and maximum coal production over the time series:

In[3]:=
MinMax[ts]
Out[3]=

Time series plot for the coal production:

In[4]:=
DateListPlot[ts]
Out[4]=

Coal production for the northern and southern Appalachian regions:

In[5]:=
DateListPlot[ ResourceFunction[ "https://www.wolframcloud.com/obj/arnoudb/DeployedResources/\
Function/UnitedStatesCoalProduction"][#, key] & /@ {"APN", "APS"}, PlotLegends -> {"Northern Appalachia", "Southern Appalachia"}]
Out[5]=

Coal production for Texas, Kentucky, and Illinois:

In[6]:=
DateListPlot[ ResourceFunction[ "https://www.wolframcloud.com/obj/arnoudb/DeployedResources/\
Function/UnitedStatesCoalProduction"][#, key] & /@ {"TX", "KY", "IL"}, PlotLegends -> {"Texas", "Kentucky", "Illinois"}]
Out[6]=