RamiKrispin / EIAapi

Supporting tools for the Applied Time Series Analysis and Forecasting book
https://ramikrispin.github.io/EIAapi/
Other
8 stars 1 forks source link

get_metadata function #7

Open RamiKrispin opened 10 months ago

RamiKrispin commented 10 months ago

Function to pull series metadata, for example: https://api.eia.gov/v2/electricity/rto/region-sub-ba-data?api_key=API_KEY

{
  "response": {
    "id": "region-sub-ba-data",
    "name": "Hourly Demand by Subregion",
    "description": "Hourly demand by balancing authority subregion.  \n    Source: Form EIA-930\n    Product: Hourly Electric Grid Monitor",
    "frequency": [
      {
        "id": "hourly",
        "alias": "hourly (UTC)",
        "description": "One data point for each hour in UTC time.",
        "query": "H",
        "format": "YYYY-MM-DD"T"HH24"
      },
      {
        "id": "local-hourly",
        "alias": "hourly (Local Time Zone)",
        "description": "One data point for each hour in local time.",
        "query": "LH",
        "format": "YYYY-MM-DD"T"HH24TZH"
      }
    ],
    "facets": [
      {
        "id": "subba",
        "description": "Subregion"
      },
      {
        "id": "parent",
        "description": "Balancing Authority"
      }
    ],
    "data": {
      "value": {
        "aggregation-method": "SUM",
        "alias": "Demand",
        "units": "megawatthours"
      }
    },
    "startPeriod": "2018-06-19T05",
    "endPeriod": "2023-08-11T07",
    "defaultDateFormat": "YYYY-MM-DD"T"HH24",
    "defaultFrequency": "hourly"
  },
  "request": {
    "command": "/v2/electricity/rto/region-sub-ba-data/",
    "params": {
      "api_key": "API_KEY"
    }
  },
  "apiVersion": "2.1.4"
}