---
title: "Get energy usage intervals"
method: GET
path: "/intervals"
tags: ["Usage"]
---

# Get energy usage intervals

`GET /intervals`

Get a list of interval objects corresponding to energy usage and green house gas emissions for a given energy account in a specific time range. Emissions data is currently only available for PG&E and SCE.

The type of energy intervals (gas vs. electric) is specified in the `type` query param. Information on whether this account has electricity and/or gas data is found in the `available_meter_type` field of the `Account` object, which can be queried via `/accounts`. Gas data is currently only available for PG&E.

Timestamp is in epoch time, usage is in units specified by the unit for that account (otherwise kWh or therms if no unit is specified), and emissions is in kgCO2e (kg of carbon dioxide equivalent).

If neither start_date nor end_date are provided, response will include usage data for the last two months.

If start_date is included but end_date is not, response will include usage data for two months starting at start_date.

If end_date is included but start_date is not, response will include usage data for two months ending at end_date.

Note that this endpoint was previously named '/accounts/{account_id}/intervals', which is still live.

## Query parameters

- `account_id` string, required
- `type` 'ELECTRIC' | 'GAS'
- `start_date` integer
- `end_date` integer

## Headers

- `Authorization` string, required
- `Pelm-Client-Id` string, required
- `Pelm-Secret` string, required

## Response `200`

Successful operation

- object
  - `utility` string — Full name of utility
  - `account` Account
    - `id` string
    - `account_number` string
    - `address` string
    - `available_meter_types` MeterType[] — The types of meters available for this account. This defines what kind of intervals you can query for this account via `/intervals`.
    - `usage_unit` string — Unit for electricity usage. https://pelm.readme.io/reference/unit-codes
    - `gas_usage_unit` string — Unit for gas usage. Omitted if account does not have a gas meter. https://pelm.readme.io/reference/unit-codes
    - `ghg_emissions_unit` string — Unit for greenhouse gas emissions. https://pelm.readme.io/reference/unit-codes
  - `intervals` Interval[]
    - `start` integer — The start time of interval in UNIX time
    - `end` integer — The end time of interval in UNIX time
    - `usage` number — The net electricity or gas usage during this time period. The unit is kWh for electricity usage and therms for gas usage.
    - `consumption` number — The amount of electricity consumed in kWh during this time period. Always null for gas intervals. Availability varies by Utility and Account.
    - `generation` number — The amount of electricity generated in kWh during this time period. Always null for gas intervals. Availability varies by Utility and Account.
    - `ghg_emissions` number — The green house gases emitted by this user in kgCO2e (kg of carbon dioxide equivalent). This data is currently only available for PG&E users. Emissions are calculated by taking CAISO data of emission rate at the given time multiplied by the electricity usage.

## Other responses

- `400` — Client error
- `401` — Unauthorized
- `402` — Quota reached
- `403` — Permission denied
- `500` — Server error

---

[API](https://skmtc.net/pelm/apis/pelm-api.md) · [All operations](https://skmtc.net/pelm/apis/pelm-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pelm/pelm-api/revisions/99451cd0e777/schema)
