Department of Energy NG API

Access to Natural Gas Data

GitHub OpenAPI

Operations 7

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/natural-gas/{route1}/{route2} Get natural gas data for two route levels · Get natural gas by route1 by route2 #
Ask an LLM
“Can I pull natural gas data for a specific pair of route levels?”
“What does the data look like for two sub-routes?”
Tell an agent
Get natural gas data for route {route1} by route {route2}.
Pull the {route1}/{route2} natural gas data.
GET /v2/natural-gas/{route1} Explore a top-level natural gas sub-route · Get natural gas by route1 #
Ask an LLM
“What lives directly under a first-level natural gas route?”
“Can I browse the next level of natural gas data below a single route?”
Tell an agent
Show what sits under the natural gas category {route1}.
Browse the first-level natural gas sub-route {route1} on its own.
GET /v2/natural-gas/{route1}/{route2}/facet/{facet_id} Get natural gas data for a route and facet · Get natural gas by route1 by route2 facet by facet id #
Ask an LLM
“How do I get a natural gas data series for one route and one facet?”
“Which data points belong to a specific facet of a natural gas route?”
Tell an agent
Get natural gas data for route {route1} facet {facet_id} at {route2}.
Pull the {facet_id} data series for {route1} under {route2}.
GET /v2/natural-gas/{route1}/{route2}/facet List natural gas facets for a route pair · Get natural gas by route1 by route2 facet #
Ask an LLM
“What facets break down natural gas data for a pair of routes?”
“Can I see available facet IDs for a natural gas route pair?”
Tell an agent
List facets for natural gas route {route1} route {route2}.
Show the available facet IDs for {route1} and {route2}.
GET /v2/natural-gas/{route1}/{route2}/data Get natural gas data for a route pair · Get natural gas by route1 by route2 data #
Ask an LLM
“How do I pull natural gas data for a pair of routes over a date range?”
“Can I filter a route-pair data series by frequency and sort it?”
Tell an agent
Get natural gas data for route {route1} route {route2} from {start} to {end}.
Pull {route1}-{route2} gas data filtered to {frequency}, sorted by {sort}.
POST /v2/natural-gas/{route1}/{route2}/data Query natural gas data with a POST body · Return Natural Gas Data #
Ask an LLM
“How do I query natural gas data for a route pair with a POST body?”
“Can I include a data list and facets in a natural gas query?”
Tell an agent
Query natural gas data for route {route1} route {route2} with {data}.
POST {data} and facets {facets} for {route1}/{route2} natural gas data.
GET /v2/natural-gas List natural gas data routes · Get natural gas #
Ask an LLM
“What route levels are available for natural gas data?”
“Can I get a list of natural gas data endpoints?”
Tell an agent
List all natural gas data routes.
Show the natural gas data endpoints.

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-ng-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-ng-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: EIA APIv2 NG 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: NG
  description: Access to Natural Gas Data
paths:
  /v2/natural-gas/{route1}/{route2}:
    parameters:
    - $ref: '#/components/parameters/route1'
    - $ref: '#/components/parameters/route2'
    get:
      tags:
      - NG
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/responses/final-route'
      summary: Get natural gas by route1 by route2
      x-summary-source: derived
      operationId: getV2NaturalGasByRoute1ByRoute2
      x-operation-id-source: derived
  /v2/natural-gas/{route1}:
    parameters:
    - $ref: '#/components/parameters/route1'
    get:
      tags:
      - NG
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/responses/route'
      summary: Get natural gas by route1
      x-summary-source: derived
      operationId: getV2NaturalGasByRoute1
      x-operation-id-source: derived
  /v2/natural-gas/{route1}/{route2}/facet/{facet_id}:
    parameters:
    - $ref: '#/components/parameters/route1'
    - $ref: '#/components/parameters/route2'
    - $ref: '#/components/parameters/facetId'
    get:
      tags:
      - NG
      responses:
        '400':
          description: Invalid input
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/responses/facet'
      summary: Get natural gas by route1 by route2 facet by facet id
      x-summary-source: derived
      operationId: getV2NaturalGasByRoute1ByRoute2FacetByFacetId
      x-operation-id-source: derived
  /v2/natural-gas/{route1}/{route2}/facet:
    parameters:
    - $ref: '#/components/parameters/route1'
    - $ref: '#/components/parameters/route2'
    get:
      tags:
      - NG
      responses:
        '400':
          description: Invalid input
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/responses/facets'
      summary: Get natural gas by route1 by route2 facet
      x-summary-source: derived
      operationId: getV2NaturalGasByRoute1ByRoute2Facet
      x-operation-id-source: derived
  /v2/natural-gas/{route1}/{route2}/data:
    parameters:
    - $ref: '#/components/parameters/route1'
    - $ref: '#/components/parameters/route2'
    get:
      tags:
      - NG
      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:
        '405':
          description: Invalid input
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/responses/data'
      summary: Get natural gas by route1 by route2 data
      x-summary-source: derived
      operationId: getV2NaturalGasByRoute1ByRoute2Data
      x-operation-id-source: derived
    post:
      tags:
      - NG
      summary: Return Natural Gas Data
      requestBody:
        $ref: '#/components/requestBodies/dataParams'
      responses:
        '405':
          description: Invalid input
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/responses/data'
      operationId: postV2NaturalGasByRoute1ByRoute2Data
      x-operation-id-source: derived
  /v2/natural-gas:
    get:
      tags:
      - NG
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/responses/route'
      summary: Get natural gas
      x-summary-source: derived
      operationId: getV2NaturalGas
      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'
    route2:
      name: route2
      in: path
      description: Second level Sub route
      required: true
      schema:
        type: string
    route1:
      name: route1
      in: path
      description: First level Sub route
      required: true
      schema:
        type: string
    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