---
title: "Calculate Scope 2 CO₂e for a ZIP + kWh, location-based and market-based"
method: POST
path: "/api/calculate"
---

# Calculate Scope 2 CO₂e for a ZIP + kWh, location-based and market-based

`POST /api/calculate`

## Request

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

candidates[].co2e_kg is location-based (eGRID). candidates[].market_based.co2e_kg applies the Green-e residual mix to kWh not covered by contractual instruments (renewable_kwh).

## Request body

- object
  - `zip` string, required
  - `kwh` number, required
  - `year` '2023' | '2024': eGRID edition (default 2023); market-based needs 2023
  - `renewable_kwh` number: kWh covered by RECs, PPAs or green tariffs (market-based method). Default 0, max kwh.

## Response `200`

CO₂e calculation result (location- and market-based)

## Other responses

- `400`: Missing or invalid fields, malformed ZIP, invalid year, or unknown fields (e.g. "unit"; kwh is always kWh)
- `404`: Well-formed ZIP with no eGRID subregion (PO box, unique ZIP)

---

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