---
title: "Rank 2-25 candidate sites on grid carbon, retail $/kWh and cleanest daily window"
method: POST
path: "/api/compare"
---

# Rank 2-25 candidate sites on grid carbon, retail $/kWh and cleanest daily window

`POST /api/compare`

## Request

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

## Request body

- object
  - `zips` string[], required
  - `annual_kwh` number: Optional; adds annual tCO2e and cost per site
  - `sector` 'COM' | 'IND' | 'RES' | 'ALL' | 'Commercial' | 'Industrial' | 'Residential'
  - `duration` integer: Cleanest-window length in hours

## Response `200`

Sites with factors, rates, cleanest window and rank_carbon / rank_cost / rank_combined

## Other responses

- `400`: Fewer than 2 or more than 25 ZIPs, or invalid input
- `429`: Rate limit reached while fetching per-site data (compare costs about 1 + sites + states + BAs requests)

---

[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)
