EIA

EIA ELEC API

Access to Electricity Data

Operations 21

GET /v2/electricity/facility-fuel/facet/{facet_id}
GET /v2/electricity/electric-power-operational-data/facet/{facet_id}
GET /v2/electricity/operating-generator-capacity/facet/{facet_id}
GET /v2/electricity/retail-sales/facet/{facet_id}
GET /v2/electricity Class ElectricityController
GET /v2/electricity/facility-fuel
GET /v2/electricity/facility-fuel/facet
GET /v2/electricity/facility-fuel/data
POST /v2/electricity/facility-fuel/data Class FacilityFuelController
GET /v2/electricity/electric-power-operational-data
GET /v2/electricity/electric-power-operational-data/facet
GET /v2/electricity/electric-power-operational-data/data
POST /v2/electricity/electric-power-operational-data/data Return Electricity electric-power-operational Data
GET /v2/electricity/operating-generator-capacity
GET /v2/electricity/operating-generator-capacity/facet
GET /v2/electricity/operating-generator-capacity/data
POST /v2/electricity/operating-generator-capacity/data Return Electricity operating-generator-capacity Data
GET /v2/electricity/retail-sales
GET /v2/electricity/retail-sales/facet
GET /v2/electricity/retail-sales/data
POST /v2/electricity/retail-sales/data Return Electricity retail-sales Data

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/eia-elec-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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. See our Privacy Policy and Terms.

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

OpenAPI Specification

eia-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](https://www.eia.gov/opendata/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/](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'
  /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'
  /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'
  /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'
  /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'
  /v2/electricity/facility-fuel:
    get:
      tags:
      - ELEC
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/responses/final-route'
  /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'
  /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'
    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'
  /v2/electricity/electric-power-operational-data:
    get:
      tags:
      - ELEC
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/responses/final-route'
  /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'
  /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'
    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'
  /v2/electricity/operating-generator-capacity:
    get:
      tags:
      - ELEC
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/responses/final-route'
  /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'
  /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'
    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'
  /v2/electricity/retail-sales:
    get:
      tags:
      - ELEC
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/responses/final-route'
  /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'
  /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'
    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'
components:
  responses:
    route:
      description: List of API data sets
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RouteResponseContainer'
    facets:
      description: List of facet options
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/FacetOptionListContainer'
    final-route:
      description: List of API data sets
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/FinalRouteResponseContainer'
    facet:
      description: Facet details
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/FacetDetailsContainer'
    data:
      description: API Data
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DataResponseContainer'
  schemas:
    DataResponseContainer:
      properties:
        apiVersion:
          type: string
        request:
          $ref: '#/components/schemas/RouteRequest'
        response:
          $ref: '#/components/schemas/DataResponse'
      type: object
    FacetDetails:
      properties:
        totalFacets:
          type: integer
        facets:
          type: array
          items:
            $ref: '#/components/schemas/Facet'
      type: object
    FacetDetailsContainer:
      properties:
        apiVersion:
          type: string
        request:
          $ref: '#/components/schemas/RouteRequest'
        response:
          $ref: '#/components/schemas/FacetDetails'
      type: object
    Frequency:
      properties:
        id:
          type: string
        description:
          type: string
        format:
          type: string
        query:
          type: string
      type: object
    RouteResponseContainer:
      properties:
        apiVersion:
          type: string
        request:
          $ref: '#/components/schemas/RouteRequest'
        response:
          $ref: '#/components/schemas/RouteResponse'
      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
    FacetOptionListContainer:
      properties:
        apiVersion:
          type: string
        request:
          $ref: '#/components/schemas/RouteRequest'
        response:
          $ref: '#/components/schemas/FacetOptionList'
      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
    DataResponse:
      properties:
        data: {}
        dateFormat:
          type: string
        description:
          type: string
        frequency:
          type: string
        total:
          type: integer
      type: object
    Sort:
      properties:
        column:
          type: string
        direction:
          type: string
      type: object
    FacetMetaData:
      properties:
        id:
          type: string
        description:
          type: string
      type: object
    RouteResponse:
      properties:
        response:
          $ref: '#/components/schemas/Routes'
        request:
          $ref: '#/components/schemas/RouteRequest'
      type: object
    Routes:
      properties:
        routes:
          type: array
          items:
            type: string
        id:
          type: string
        name:
          type: string
        description:
          type: string
      type: object
    FinalRouteResponseContainer:
      properties:
        apiVersion:
          type: string
        request:
          $ref: '#/components/schemas/RouteRequest'
        response:
          $ref: '#/components/schemas/FinalRouteResponse'
      type: object
    FacetOptionList:
      properties:
        totalFacetOptions:
          type: integer
        facetOptions:
          type: array
          items:
            type: string
      type: object
    Facet:
      properties:
        id:
          type: string
        name:
          type: string
        alias:
          type: string
      type: object
    RouteRequest:
      properties:
        command:
          type: array
          items:
            type: string
        params: {}
      type: object
    FinalRouteResponse:
      properties:
        response:
          $ref: '#/components/schemas/FinalRoute'
        request:
          $ref: '#/components/schemas/RouteRequest'
      type: object
  parameters:
    end:
      name: end
      in: query
      description: End date to filter by
      required: false
      schema:
        type: string
    facets:
      name: facets
      in: query
      description: Facets to filter by
      required: false
      schema:
        type: object
    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
    data:
      name: data
      in: query
      description: Data columns to filter by
      required: false
      schema:
        type: array
        items:
          type: string
    offset:
      name: offset
      in: query
      description: Offset of returned data
      required: false
      schema:
        type: integer
    start:
      name: start
      in: query
      description: Start date to filter by
      required: false
      schema:
        type: string
    frequency:
      name: frequency
      in: query
      description: Frequency 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'
  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