---
title: "Cleanest contiguous N-hour window of the day to run a flexible load (EIA-930, last ~7 days)"
method: GET
path: "/api/cleanest-hours"
---

# Cleanest contiguous N-hour window of the day to run a flexible load (EIA-930, last ~7 days)

`GET /api/cleanest-hours`

## Request

- Base URL: `https://emission-factors.com`
- URL: `https://emission-factors.com/api/cleanest-hours`
- Auth: none declared

## Query parameters

- `zip` string
- `ba` string
- `duration` integer
- `between` string

## Response `200`

cleanest_window and dirtiest_window (UTC and the ZIP's local time), savings %, hours ranked. For a nearly carbon-free or flat grid both windows are null and no_window_reason says why.

## Other responses

- `400`: Invalid duration or input
- `404`: ZIP not covered by EIA-930 (AK, HI, PR)
- `503`: EIA-930 API temporarily unavailable; retry (Retry-After header)

---

[API](https://skmtc.dev/emission-factors/apis/emission-factors-com-api.md) · [All operations](https://skmtc.dev/emission-factors/apis/emission-factors-com-api/llms.txt) · [OpenAPI document](https://skmtc.dev/emission-factors/apis/emission-factors-com-api/revisions/6a306ef2044a?raw)
