Department of Energy ELEC API

Access to Electricity Data

GitHub OpenAPI

Operations 21

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /v2/electricity/facility-fuel/facet/{facet_id} Get a facility fuel facet · Get electricity facility fuel facet by facet id #
Ask an LLM
“What does a given facility fuel facet contain?”
“Can I look up one facility fuel facet by its ID?”
Tell an agent
Get facility fuel facet {facet_id}.
Show the facility fuel facet {facet_id}.
GET /v2/electricity/electric-power-operational-data/facet/{facet_id} Get a power operational data facet · Get electricity electric power operational data facet by facet id #
Ask an LLM
“What does a given electric power operational data facet contain?”
“Can I look up one power operational data facet by its ID?”
Tell an agent
Get electric power operational data facet {facet_id}.
Show the electric power operational data facet {facet_id}.
GET /v2/electricity/operating-generator-capacity/facet/{facet_id} Get a generator capacity facet · Get electricity operating generator capacity facet by facet id #
Ask an LLM
“What does a given operating generator capacity facet contain?”
“Can I look up one generator capacity facet by its ID?”
Tell an agent
Get operating generator capacity facet {facet_id}.
Show the operating generator capacity facet {facet_id}.
GET /v2/electricity/retail-sales/facet/{facet_id} Get a retail sales facet · Get electricity retail sales facet by facet id #
Ask an LLM
“What does a given retail electricity sales facet contain?”
“Can I look up one retail sales facet by its ID?”
Tell an agent
Get retail sales facet {facet_id}.
Show the retail sales facet {facet_id}.
GET /v2/electricity List electricity data sets · Class ElectricityController #
Ask an LLM
“Which electricity data sets are available?”
“What top-level electricity endpoints exist?”
Tell an agent
List electricity data sets.
Show the electricity data set endpoints.
GET /v2/electricity/facility-fuel List facility fuel data · Get electricity facility fuel #
Ask an LLM
“Which fuel types do electricity facilities use?”
“Can I get facility fuel data for a single facility?”
Tell an agent
List facility fuel data.
Show facility fuel data for one facility.
GET /v2/electricity/facility-fuel/facet List facility fuel facets · Get electricity facility fuel facet #
Ask an LLM
“What facility fuel facets are available?”
“Can I get the facility fuel facet list?”
Tell an agent
List facility fuel facets.
Show the facility fuel facet list.
GET /v2/electricity/facility-fuel/data Query facility fuel data · Get electricity facility fuel data #
Ask an LLM
“How much coal and gas did U.S. plants burn in 2023?”
“Can I filter facility fuel data by facility or fuel type?”
Tell an agent
Query facility fuel data from {start} to {end}.
Show facility fuel data for {facets}.
POST /v2/electricity/facility-fuel/data Query facility fuel data with a POST body · Class FacilityFuelController #
Ask an LLM
“Can I send facility fuel query parameters in a POST body?”
“Is there a POST form for facility fuel data?”
Tell an agent
POST facility fuel query {data} from {start} to {end}.
Send a facility fuel data request with facets {facets}.
GET /v2/electricity/electric-power-operational-data List electric power operational data · Get electricity electric power operational data #
Ask an LLM
“Which electric power plants are operating and how much are they producing?”
“Can I get electric power operational data for a single plant?”
Tell an agent
List electric power operational data.
Show electric power operational data for one plant.
GET /v2/electricity/electric-power-operational-data/facet See electricity generation facets · Get electricity electric power operational data facet #
Ask an LLM
“Which facets can I use to filter electric power operational data?”
“What generation types or regions are available for electricity generation data?”
Tell an agent
List the electricity generation facets.
Show filterable categories for electric power operational data.
GET /v2/electricity/electric-power-operational-data/data Query electric power operational data · Get electricity electric power operational data data #
Ask an LLM
“How much electricity are U.S. plants producing each day?”
“Can I filter electric power operational data by plant or date?”
Tell an agent
Query electric power operational data from {start} to {end}.
Show electric power operational data for {facets}.
POST /v2/electricity/electric-power-operational-data/data Download generation operational data · Return Electricity electric-power-operational Data #
Ask an LLM
“How much electricity is being generated and on what type of fuel?”
“Can I get generation data for a specific start and end date?”
Tell an agent
Return electricity generation data for {start} to {end}.
Download electric power operational data sorted by {sort}.
GET /v2/electricity/operating-generator-capacity List operating generator capacity · Get electricity operating generator capacity #
Ask an LLM
“What is the operating capacity of U.S. generators?”
“Can I get operating generator capacity data for a single generator?”
Tell an agent
List operating generator capacity.
Show operating generator capacity for one generator.
GET /v2/electricity/operating-generator-capacity/facet See generator capacity facets · Get electricity operating generator capacity facet #
Ask an LLM
“Which facets can I use to filter operating generator capacity?”
“What capacity data items are available for generators?”
Tell an agent
List the generator capacity facets.
Show filterable categories for generators' operating capacity data.
GET /v2/electricity/operating-generator-capacity/data Query operating generator capacity · Get electricity operating generator capacity data #
Ask an LLM
“What is the operating capacity of generators in a given year?”
“Can I filter operating generator capacity by generator or date?”
Tell an agent
Query operating generator capacity from {start} to {end}.
Show operating generator capacity for {facets}.
POST /v2/electricity/operating-generator-capacity/data Download generator capacity data · Return Electricity operating-generator-capacity Data #
Ask an LLM
“What is the nameplate capacity of operating generators?”
“Can I get generator capacity data for a particular facility or region?”
Tell an agent
Return operating generator capacity data for {start} to {end}.
Download generator capacity data sorted by {sort} with {length} records.
GET /v2/electricity/retail-sales List retail electricity sales · Get electricity retail sales #
Ask an LLM
“How much electricity do U.S. households buy each year?”
“Can I get retail electricity sales data for a single state?”
Tell an agent
List retail electricity sales.
Show retail electricity sales for one state.
GET /v2/electricity/retail-sales/facet List retail electricity sales facets · Get electricity retail sales facet #
Ask an LLM
“What retail electricity sales facets are available?”
“Can I get the retail electricity sales facet list?”
Tell an agent
List retail electricity sales facets.
Show the retail electricity sales facet list.
GET /v2/electricity/retail-sales/data Query retail electricity sales · Get electricity retail sales data #
Ask an LLM
“How much electricity do U.S. retail customers buy each month?”
“Can I filter retail electricity sales by state or date?”
Tell an agent
Query retail electricity sales from {start} to {end}.
Show retail electricity sales for {facets}.
POST /v2/electricity/retail-sales/data Get electricity retail sales data · Return Electricity retail-sales Data #
Ask an LLM
“How much electricity do US retail customers buy each month?”
“Can I get electricity retail sales data for a specific state?”
Tell an agent
Get electricity retail sales data for {start} to {end}.
Show retail electricity sales data sorted by {sort}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/doe:doe-elec-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

doe-elec-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: EIA APIv2 ELEC API
  description: Swagger UI interface for EIA's APIv2. You can also explore EIA's API using the Opendata Query Browser. For this UI, you must use your EIA `api key` to apply filters and return data. You can register for an API Key at https://www.eia.gov/opendata/
  version: 2.1.0
servers:
- url: https://api.eia.gov
security:
- api_key: []
tags:
- name: ELEC
  description: Access to Electricity Data
paths:
  /v2/electricity/facility-fuel/facet/{facet_id}:
    parameters:
    - $ref: '#/components/parameters/facetId'
    get:
      tags:
      - ELEC
      responses:
        '400':
          description: Invalid input
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/responses/facet'
      summary: Get electricity facility fuel facet by facet id
      x-summary-source: derived
      operationId: getV2ElectricityFacilityFuelFacetByFacetId
      x-operation-id-source: derived
  /v2/electricity/electric-power-operational-data/facet/{facet_id}:
    parameters:
    - $ref: '#/components/parameters/facetId'
    get:
      tags:
      - ELEC
      responses:
        '400':
          description: Invalid input
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/responses/facet'
      summary: Get electricity electric power operational data facet by facet id
      x-summary-source: derived
      operationId: getV2ElectricityElectricPowerOperationalDataFacetByFacetId
      x-operation-id-source: derived
  /v2/electricity/operating-generator-capacity/facet/{facet_id}:
    parameters:
    - $ref: '#/components/parameters/facetId'
    get:
      tags:
      - ELEC
      responses:
        '400':
          description: Invalid input
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/responses/facet'
      summary: Get electricity operating generator capacity facet by facet id
      x-summary-source: derived
      operationId: getV2ElectricityOperatingGeneratorCapacityFacetByFacetId
      x-operation-id-source: derived
  /v2/electricity/retail-sales/facet/{facet_id}:
    parameters:
    - $ref: '#/components/parameters/facetId'
    get:
      tags:
      - ELEC
      responses:
        '400':
          description: Invalid input
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/responses/facet'
      summary: Get electricity retail sales facet by facet id
      x-summary-source: derived
      operationId: getV2ElectricityRetailSalesFacetByFacetId
      x-operation-id-source: derived
  /v2/electricity:
    get:
      tags:
      - ELEC
      summary: Class ElectricityController
      description: Electricity data set top-level controller.
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/responses/route'
      operationId: getV2Electricity
      x-operation-id-source: derived
  /v2/electricity/facility-fuel:
    get:
      tags:
      - ELEC
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/responses/final-route'
      summary: Get electricity facility fuel
      x-summary-source: derived
      operationId: getV2ElectricityFacilityFuel
      x-operation-id-source: derived
  /v2/electricity/facility-fuel/facet:
    get:
      tags:
      - ELEC
      responses:
        '400':
          description: Invalid input
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/responses/facets'
      summary: Get electricity facility fuel facet
      x-summary-source: derived
      operationId: getV2ElectricityFacilityFuelFacet
      x-operation-id-source: derived
  /v2/electricity/facility-fuel/data:
    get:
      tags:
      - ELEC
      description: API data with query params
      parameters:
      - $ref: '#/components/parameters/data'
      - $ref: '#/components/parameters/facets'
      - $ref: '#/components/parameters/frequency'
      - $ref: '#/components/parameters/start'
      - $ref: '#/components/parameters/end'
      - $ref: '#/components/parameters/sort'
      - $ref: '#/components/parameters/length'
      - $ref: '#/components/parameters/offset'
      responses:
        '400':
          description: Invalid input
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/responses/data'
      summary: Get electricity facility fuel data
      x-summary-source: derived
      operationId: getV2ElectricityFacilityFuelData
      x-operation-id-source: derived
    post:
      tags:
      - ELEC
      summary: Class FacilityFuelController
      description: Electricity FacilityFuel dataset controller.
      requestBody:
        $ref: '#/components/requestBodies/dataParams'
      responses:
        '400':
          description: Invalid input
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/responses/data'
      operationId: postV2ElectricityFacilityFuelData
      x-operation-id-source: derived
  /v2/electricity/electric-power-operational-data:
    get:
      tags:
      - ELEC
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/responses/final-route'
      summary: Get electricity electric power operational data
      x-summary-source: derived
      operationId: getV2ElectricityElectricPowerOperationalData
      x-operation-id-source: derived
  /v2/electricity/electric-power-operational-data/facet:
    get:
      tags:
      - ELEC
      responses:
        '400':
          description: Invalid input
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/responses/facets'
      summary: Get electricity electric power operational data facet
      x-summary-source: derived
      operationId: getV2ElectricityElectricPowerOperationalDataFacet
      x-operation-id-source: derived
  /v2/electricity/electric-power-operational-data/data:
    get:
      tags:
      - ELEC
      description: API data with query params
      parameters:
      - $ref: '#/components/parameters/data'
      - $ref: '#/components/parameters/facets'
      - $ref: '#/components/parameters/frequency'
      - $ref: '#/components/parameters/start'
      - $ref: '#/components/parameters/end'
      - $ref: '#/components/parameters/sort'
      - $ref: '#/components/parameters/length'
      - $ref: '#/components/parameters/offset'
      responses:
        '400':
          description: Invalid input
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/responses/data'
      summary: Get electricity electric power operational data data
      x-summary-source: derived
      operationId: getV2ElectricityElectricPowerOperationalDataData
      x-operation-id-source: derived
    post:
      tags:
      - ELEC
      summary: Return Electricity electric-power-operational Data
      description: 'Class GenerationController


        Electricity generation dataset controller.'
      requestBody:
        $ref: '#/components/requestBodies/dataParams'
      responses:
        '400':
          description: Invalid input
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/responses/data'
      operationId: postV2ElectricityElectricPowerOperationalDataData
      x-operation-id-source: derived
  /v2/electricity/operating-generator-capacity:
    get:
      tags:
      - ELEC
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/responses/final-route'
      summary: Get electricity operating generator capacity
      x-summary-source: derived
      operationId: getV2ElectricityOperatingGeneratorCapacity
      x-operation-id-source: derived
  /v2/electricity/operating-generator-capacity/facet:
    get:
      tags:
      - ELEC
      responses:
        '400':
          description: Invalid input
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/responses/facets'
      summary: Get electricity operating generator capacity facet
      x-summary-source: derived
      operationId: getV2ElectricityOperatingGeneratorCapacityFacet
      x-operation-id-source: derived
  /v2/electricity/operating-generator-capacity/data:
    get:
      tags:
      - ELEC
      description: API data with query params
      parameters:
      - $ref: '#/components/parameters/data'
      - $ref: '#/components/parameters/facets'
      - $ref: '#/components/parameters/frequency'
      - $ref: '#/components/parameters/start'
      - $ref: '#/components/parameters/end'
      - $ref: '#/components/parameters/sort'
      - $ref: '#/components/parameters/length'
      - $ref: '#/components/parameters/offset'
      responses:
        '400':
          description: Invalid input
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/responses/data'
      summary: Get electricity operating generator capacity data
      x-summary-source: derived
      operationId: getV2ElectricityOperatingGeneratorCapacityData
      x-operation-id-source: derived
    post:
      tags:
      - ELEC
      summary: Return Electricity operating-generator-capacity Data
      description: 'Class GeneratorLevelCapacityController


        Electricity generation dataset controller.'
      requestBody:
        $ref: '#/components/requestBodies/dataParams'
      responses:
        '400':
          description: Invalid input
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/responses/data'
      operationId: postV2ElectricityOperatingGeneratorCapacityData
      x-operation-id-source: derived
  /v2/electricity/retail-sales:
    get:
      tags:
      - ELEC
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/responses/final-route'
      summary: Get electricity retail sales
      x-summary-source: derived
      operationId: getV2ElectricityRetailSales
      x-operation-id-source: derived
  /v2/electricity/retail-sales/facet:
    get:
      tags:
      - ELEC
      responses:
        '400':
          description: Invalid input
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/responses/facets'
      summary: Get electricity retail sales facet
      x-summary-source: derived
      operationId: getV2ElectricityRetailSalesFacet
      x-operation-id-source: derived
  /v2/electricity/retail-sales/data:
    get:
      tags:
      - ELEC
      description: API data with query params
      parameters:
      - $ref: '#/components/parameters/data'
      - $ref: '#/components/parameters/facets'
      - $ref: '#/components/parameters/frequency'
      - $ref: '#/components/parameters/start'
      - $ref: '#/components/parameters/end'
      - $ref: '#/components/parameters/sort'
      - $ref: '#/components/parameters/length'
      - $ref: '#/components/parameters/offset'
      responses:
        '400':
          description: Invalid input
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/responses/data'
      summary: Get electricity retail sales data
      x-summary-source: derived
      operationId: getV2ElectricityRetailSalesData
      x-operation-id-source: derived
    post:
      tags:
      - ELEC
      summary: Return Electricity retail-sales Data
      description: 'Class RetailSalesController


        Electricity retail sales dataset controller.'
      requestBody:
        $ref: '#/components/requestBodies/dataParams'
      responses:
        '400':
          description: Invalid input
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/responses/data'
      operationId: postV2ElectricityRetailSalesData
      x-operation-id-source: derived
components:
  schemas:
    DataResponseContainer:
      properties:
        apiVersion:
          type: string
        request:
          $ref: '#/components/schemas/RouteRequest'
        response:
          $ref: '#/components/schemas/DataResponse'
      type: object
    Frequency:
      properties:
        id:
          type: string
        description:
          type: string
        format:
          type: string
        query:
          type: string
      type: object
    FacetOptionListContainer:
      properties:
        apiVersion:
          type: string
        request:
          $ref: '#/components/schemas/RouteRequest'
        response:
          $ref: '#/components/schemas/FacetOptionList'
      type: object
    Sort:
      properties:
        column:
          type: string
        direction:
          type: string
      type: object
    FinalRoute:
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
        frequency:
          type: array
          items:
            $ref: '#/components/schemas/Frequency'
        facets:
          type: array
          items:
            $ref: '#/components/schemas/FacetMetaData'
        data: {}
        startPeriod:
          type: string
        endPeriod:
          type: string
        defaultDateFormat:
          type: string
        defaultFrequency:
          type: string
      type: object
    Facet:
      properties:
        id:
          type: string
        name:
          type: string
        alias:
          type: string
      type: object
    FacetDetailsContainer:
      properties:
        apiVersion:
          type: string
        request:
          $ref: '#/components/schemas/RouteRequest'
        response:
          $ref: '#/components/schemas/FacetDetails'
      type: object
    FinalRouteResponse:
      properties:
        response:
          $ref: '#/components/schemas/FinalRoute'
        request:
          $ref: '#/components/schemas/RouteRequest'
      type: object
    RouteRequest:
      properties:
        command:
          type: array
          items:
            type: string
        params: {}
      type: object
    FacetDetails:
      properties:
        totalFacets:
          type: integer
        facets:
          type: array
          items:
            $ref: '#/components/schemas/Facet'
      type: object
    FinalRouteResponseContainer:
      properties:
        apiVersion:
          type: string
        request:
          $ref: '#/components/schemas/RouteRequest'
        response:
          $ref: '#/components/schemas/FinalRouteResponse'
      type: object
    DataResponse:
      properties:
        data: {}
        dateFormat:
          type: string
        description:
          type: string
        frequency:
          type: string
        total:
          type: integer
      type: object
    FacetMetaData:
      properties:
        id:
          type: string
        description:
          type: string
      type: object
    FacetOptionList:
      properties:
        totalFacetOptions:
          type: integer
        facetOptions:
          type: array
          items:
            type: string
      type: object
    Routes:
      properties:
        routes:
          type: array
          items:
            type: string
        id:
          type: string
        name:
          type: string
        description:
          type: string
      type: object
    DataParams:
      properties:
        data:
          type: array
          items:
            type: string
        facets:
          type: object
        frequency:
          type: string
        start:
          type: string
        end:
          type: string
        sort:
          type: array
          items:
            $ref: '#/components/schemas/Sort'
        length:
          type: integer
        offset:
          type: integer
      type: object
    RouteResponseContainer:
      properties:
        apiVersion:
          type: string
        request:
          $ref: '#/components/schemas/RouteRequest'
        response:
          $ref: '#/components/schemas/RouteResponse'
      type: object
    RouteResponse:
      properties:
        response:
          $ref: '#/components/schemas/Routes'
        request:
          $ref: '#/components/schemas/RouteRequest'
      type: object
  responses:
    final-route:
      description: List of API data sets
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/FinalRouteResponseContainer'
    facets:
      description: List of facet options
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/FacetOptionListContainer'
    route:
      description: List of API data sets
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RouteResponseContainer'
    data:
      description: API Data
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DataResponseContainer'
    facet:
      description: Facet details
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/FacetDetailsContainer'
  parameters:
    start:
      name: start
      in: query
      description: Start date to filter by
      required: false
      schema:
        type: string
    sort:
      name: sort
      in: query
      description: How to sort returned data
      required: false
      schema:
        $ref: '#/components/schemas/Sort'
    facets:
      name: facets
      in: query
      description: Facets to filter by
      required: false
      schema:
        type: object
    frequency:
      name: frequency
      in: query
      description: Frequency to filter by
      required: false
      schema:
        type: string
    data:
      name: data
      in: query
      description: Data columns to filter by
      required: false
      schema:
        type: array
        items:
          type: string
    length:
      name: length
      in: query
      description: Max length of returned data
      required: false
      schema:
        type: integer
    facetId:
      name: facet_id
      in: path
      description: Facet ID
      required: true
      schema:
        type: string
    end:
      name: end
      in: query
      description: End date to filter by
      required: false
      schema:
        type: string
    offset:
      name: offset
      in: query
      description: Offset of returned data
      required: false
      schema:
        type: integer
  requestBodies:
    dataParams:
      description: Parameters for data call
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DataParams'
  securitySchemes:
    api_key:
      type: apiKey
      name: api_key
      in: query
externalDocs:
  description: EIA's API Technical Documentation
  url: https://www.eia.gov/opendata/documentation.php