API reference · v1
Build on Kenya's official emission factors.
A REST API over HTTPS that returns JSON. Every factor comes with its source document, page, file fingerprint and release, and every estimate with a citation your report can paste.
https://mizani-api.fly.dev- JSON over HTTPS
- OpenAPI 3.1
- Exact decimal strings
- RFC 9457 errors
- Immutable releases
Start
Overview
Mizani Carbon publishes versioned, source-traceable emission factors for Kenya: grid electricity (EPRA's official values for every period it has published), fuels and refrigerants. The API serves them precomputed; nothing is calculated from a PDF on request.
- Look up the factor valid on any date, with every gas and its provenance.
- Estimate emissions for one amount or a batch of up to 1,000 lines.
- Download a whole release as CSV or XLSX, and verify it against its published fingerprint.
The current release is 2026.1. See the changelog for what changed in each release.
{
"status": "ok",
"latest_release": "2026.1"
}Start
Quickstart
- Try a public call. Factor lookups for the latest release need no key: request Kenya's grid factor for a date and read its value, source and page.
- Get a key. Sign in with your email and create one on your dashboard. It's shown once; keep it in an environment variable such as
MIZANI_API_KEY. - Estimate. Send an amount, its unit and the date of the activity. You get kg of each gas, kg CO₂e on your GWP basis, and the citation to paste under your number.
Prefer clicking? The playground runs every call live and writes the code for you.
curl "https://mizani-api.fly.dev/v1/factors/ke.electricity.grid.location_based?date=2025-07-01"curl -X POST "https://mizani-api.fly.dev/v1/estimate" \
-H "Authorization: Bearer $MIZANI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"factor_key": "ke.fuel.diesel.stationary",
"amount": "1200",
"unit": "litre",
"date": "2025-07-01",
"gwp": "ar6"
}'Start
Authentication
Send your key as a bearer token. Keys start with mzn_live_.
| Call | Without a key | With a key |
|---|---|---|
| Factors, downloads, proofs | Latest release | Any release |
| Releases, sources, health | Yes | Yes |
| Estimates and batches | 401 | Yes |
| Rate limit per minute | 30 per address | 60 (free), 600 (pilot) |
- An account holds up to 5 active keys. Use one per app or environment, so you can revoke one without touching the others.
- Only a hash of each key is stored: a lost key can't be shown again. Revoke it on your dashboard and create another; revocation takes effect on the next request.
- Keep keys on servers. Don't ship one in a web page or mobile app; call the API from your backend instead.
Authorization: Bearer $MIZANI_API_KEYConcepts
Factor keys
Each factor has a stable key: region.sector.name.variant, for example ke.fuel.diesel.stationary. Keys never change between releases, so you can store them.
ke.is Kenya.global.marks values that don't depend on the country, such as refrigerants' global warming potentials.- A key can have several activity units (a fuel per litre and per kg). Each is its own row, with the same key.
- Search by prefix:
GET /v1/factors?key_prefix=ke.fuel.
The live catalogue for release 2026.1 is on the right: 20 keys.
Electricity
ke.electricity.grid.location_basedKenya grid electricity, location-based · per kWh
Fuels
ke.fuel.charcoal.stationaryCharcoal · per kgke.fuel.diesel.mobileDiesel, road vehicles · per kg, litreke.fuel.diesel.stationaryDiesel, stationary combustion · per kg, litreke.fuel.firewood.stationaryFirewood · per kgke.fuel.kerosene.stationaryKerosene, stationary combustion · per kg, litreke.fuel.lpg.mobileLPG, road vehicles · per kg, litreke.fuel.lpg.stationaryLPG, stationary combustion · per kg, litreke.fuel.petrol.mobile_ldv_1995_or_laterPetrol, light-duty vehicles from 1995 · per kg, litreke.fuel.petrol.mobile_oxidation_catalystPetrol, road vehicles with oxidation catalyst · per kg, litreke.fuel.petrol.mobile_uncontrolledPetrol, road vehicles without emission control · per kg, litreke.fuel.petrol.stationaryPetrol, stationary combustion · per kg, litre
Refrigerants
global.refrigerant.r134aRefrigerant R-134A, released · per kgglobal.refrigerant.r22Refrigerant R-22, released · per kgglobal.refrigerant.r290Refrigerant R-290, released · per kgglobal.refrigerant.r32Refrigerant R-32, released · per kgglobal.refrigerant.r404aRefrigerant R-404A, released · per kgglobal.refrigerant.r407cRefrigerant R-407C, released · per kgglobal.refrigerant.r410aRefrigerant R-410A, released · per kgglobal.refrigerant.r744Refrigerant R-744, released · per kg
Concepts
Dates and periods
Every row is valid for a half-open period [period.start, period.end): the start day is included, the end day is not. Ask for a date and you get the row whose period covers it.
- EPRA publishes Kenya's grid factor for July–December and for each financial year, so some dates are covered twice. The API returns the shortest period covering the date: the more specific figure.
- Default factors that don't change with time (IPCC fuel defaults) run to
9999-12-31and cover any date. datedefaults to today. If no published period covers a date, you get404 no-factor-for-date, never a guess.
Concepts
Gases and GWP
Values are kg of each gas per activity unit. CO₂, CH₄, N₂O and HFCs are kept separate, so you can apply your own GWP set or report gases individually.
co2euses the IPCC's AR6 global warming potentials by default; passgwp=ar5for AR5.nullmeans not reported, never zero. Kenya's grid factor is published by EPRA as CO₂ only, so itsco2eis null: useco2(orgases_kg.co2in an estimate).- Biogenic CO₂ (from wood fuels) is reported in
biogenic_co2and is never included inco2e.
Concepts
Units
An estimate converts your amount to the factor's activity unit within the same dimension: MWh to kWh, t to kg, m3 to litre.
It never converts across dimensions. Asking for diesel in kWh returns 422 unit-mismatch rather than a silent assumption about energy content.
| Measures | Units |
|---|---|
| Energy | kWhMWhGWh |
| Mass | gkgttonne |
| Volume | mllLlitreliterm3 |
Concepts
Exact numbers
Numbers are decimal strings, exactly as the source prints them, so nothing is lost to floating point. Parse them with a decimal type if you do arithmetic.
Send amount as a string too. A JSON number is accepted, but one written with an exponent (1e3) is refused, because it can't be read exactly.
from decimal import Decimal
import requests
r = requests.get("https://mizani-api.fly.dev/v1/factors/ke.electricity.grid.location_based")
row = r.json()["factors"][0]
co2 = Decimal(row["values"]["co2"]) # exact, as releasedConcepts
Releases
Factors are published in releases named YYYY.N. A published release never changes: the database refuses edits.
- Calls use the latest release unless you pass
release. Pin a release in a finished report so its numbers never move. - A correction ships as a new release. The new row's
supersedes_idpoints to the row it replaces, and the changelog says why. - Each release has a fingerprint (a Merkle root over its CSV) so anyone can check a download: see Verify a release.
Concepts
Provenance and citations
Every row carries its paper trail in provenance:
sources[]: publisher, title, URL, the date we retrieved it, the file's SHA-256, its licence note, and thepages(or spreadsheet cells) where the inputs appear.script_pathandgit_commit: the code that produced the value, and the exact version of it.citation: one sentence naming all of the above. Paste it under the number in your report.
Endpoints
Reference
Every public endpoint, generated from the API's OpenAPI document. Examples on the right are live responses from the API, shortened where lists are long.
GET/v1/healthPublic
Health
Service health and the latest published release.
Response fields
| Field | Description |
|---|---|
status | |
latest_release | e.g. "2026.1" |
Responses
- 200The API and its database are up
- 503The database can't be reached
curl "https://mizani-api.fly.dev/v1/health"{
"status": "ok",
"latest_release": "2026.1"
}GET/v1/factorsPublic · key optional
Search factors
List factors in a release.
Filter by region, sector, key prefix, the date a factor is valid on, and release (default: latest).
| Parameter | Description |
|---|---|
region | e.g. "KE" |
sector | Electricity, fuels or refrigerants. e.g. "fuel" |
key_prefix | e.g. ke.fuel. for every Kenyan fuel. e.g. "ke.fuel." |
date | Only factors whose period covers this day. e.g. "2025-09-15" |
release | e.g. "2026.1" |
gwp | Global warming potentials for CO₂e: IPCC AR6 (default) or AR5. Default "ar6". e.g. "ar6" |
page | Starts at 1. Default 1. e.g. 1 |
per_page | 1 to 200 rows. Default 50. 1 to 200. e.g. 50 |
Response fields
| Field | Description |
|---|---|
release | e.g. "2026.1" |
page | |
per_page | |
total | |
factors | |
factors[] | Stable id of this row in this release |
factors[] | e.g. "ke.fuel.diesel.stationary" |
factors[] | e.g. "2026.1" |
factors[] | e.g. "KE" |
factors[] | e.g. "fuel" |
factors[] | Values are kg per this unit e.g. "litre" |
factors[] | |
factors[] | Half-open validity period [start, end) |
factors[] | |
factors[] | |
factors[] | e.g. 2025 |
factors[] | |
factors[] | kg of each gas per activity unit. null means not reported, not zero. |
factors[] | |
factors[] | |
factors[] | |
factors[] | |
factors[] | On the requested GWP basis; null when the source doesn't support it |
factors[] | Reported separately; never included in co2e |
factors[] | |
factors[] | |
factors[] | |
factors[] | |
factors[] | |
factors[] | |
factors[] | e.g. "pipeline/extract/epra.ts;pipeline/build.ts" |
factors[] | e.g. "0123456789abcdef0123456789abcdef01234567" |
factors[] | |
factors[] | A sentence a report can paste e.g. "ke.fuel.diesel.stationary per litre; derived from …; Mizani Carbon release 2026.1, factor 7b1c…" |
Responses
- 200A page of factors
- 400Invalid query
- 401Missing, unknown or revoked API key
- 404Unknown release
- 429Rate limit exceeded; see Retry-After
- 503No published release yet
curl "https://mizani-api.fly.dev/v1/factors?sector=fuel&per_page=5"{
"release": "2026.1",
"page": 1,
"per_page": 5,
"total": 20,
"factors": [
{
"id": "4c5f28df-6de6-477a-a975-f3be0f1e9699",
"factor_key": "ke.fuel.charcoal.stationary",
"release": "2026.1",
"region": "KE",
"sector": "fuel",
"activity_unit": "kg",
"method": "derived",
"period": {
"start": "1990-01-01",
"end": "9999-01-01"
},
"data_year": 2006,
"gwp": "ar6",
"values": {
"co2": null,
"ch4": "0.0059",
"n2o": "0.0000295",
"hfc": null,
"co2e": "0.1673535",
"biogenic_co2": "3.304"
},
"quality_rating": null,
"uncertainty": {
"low": null,
"high": null
},
"provenance": {
"sources": [
{
"id": "ipcc-2006-v2-ch1",
"publisher": "Intergovernmental Panel on Climate Change (IPCC), Task Force on National Greenhouse Gas Inventories",
"title": "2006 IPCC Guidelines for National Greenhouse Gas Inventories, Volume 2: Energy, Chapter 1: Introduction",
"url": "https://www.ipcc-nggip.iges.or.jp/public/2006gl/pdf/2_Volume2/V2_1_Ch1_Introduction.pdf",
"retrieved_on": "2026-09-27",
"sha256": "e391cd4676d0891cd77f67d3bd76e0e6775386b468ce5ce7ebe2311a6ea1ac45",
"license_note": "IPCC publication. Values cited with table and page; check IPCC copyright terms before republishing the document itself.",
"pages": [
"19",
"24"
]
},
{
"id": "ipcc-2006-v2-ch2",
"publisher": "Intergovernmental Panel on Climate Change (IPCC), Task Force on National Greenhouse Gas Inventories",
"title": "2006 IPCC Guidelines for National Greenhouse Gas Inventories, Volume 2: Energy, Chapter 2: Stationary Combustion (corrected April 2007)",
"url": "https://www.ipcc-nggip.iges.or.jp/public/2006gl/pdf/2_Volume2/V2_2_Ch2_Stationary_Combustion.pdf",
"retrieved_on": "2026-09-27",
"sha256": "a25d9f96d7672df391b328de79d4cfd812c07fe79d5cf4a30d23d82d8f02985b",
"license_note": "IPCC publication. Values cited with table and page; check IPCC copyright terms before republishing the document itself.",
"pages": [
"21"
]
},
"… 3 more"
],
"script_path": "pipeline/compute/fuels.ts;pipeline/build.ts",
"git_commit": "011197720f8f7ea61d6d0fb4046245bac58f7b62"
},
"supersedes_id": null,
"citation": "ke.fuel.charcoal.stationary per kg; derived from Intergovernmental Panel on Climate Change (IPCC), Task Force on National Greenhouse Gas Inventories, 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Volume 2…"
},
{
"id": "c7ebc6b1-b3e0-40d9-9155-be3b8a177421",
"factor_key": "ke.fuel.diesel.mobile",
"release": "2026.1",
"region": "KE",
"sector": "fuel",
"activity_unit": "kg",
"method": "derived",
"period": {
"start": "1990-01-01",
"end": "9999-01-01"
},
"data_year": 2006,
"gwp": "ar6",
"values": {
"co2": "3.1863",
"ch4": "0.0001677",
"n2o": "0.0001677",
"hfc": null,
"co2e": "3.23707956",
"biogenic_co2": null
},
"quality_rating": null,
"uncertainty": {
"low": null,
"high": null
},
"provenance": {
"sources": [
{
"id": "ipcc-2006-v2-ch1",
"publisher": "Intergovernmental Panel on Climate Change (IPCC), Task Force on National Greenhouse Gas Inventories",
"title": "2006 IPCC Guidelines for National Greenhouse Gas Inventories, Volume 2: Energy, Chapter 1: Introduction",
"url": "https://www.ipcc-nggip.iges.or.jp/public/2006gl/pdf/2_Volume2/V2_1_Ch1_Introduction.pdf",
"retrieved_on": "2026-09-27",
"sha256": "e391cd4676d0891cd77f67d3bd76e0e6775386b468ce5ce7ebe2311a6ea1ac45",
"license_note": "IPCC publication. Values cited with table and page; check IPCC copyright terms before republishing the document itself.",
"pages": [
"18",
"23"
]
},
{
"id": "ipcc-2006-v2-ch3",
"publisher": "Intergovernmental Panel on Climate Change (IPCC), Task Force on National Greenhouse Gas Inventories",
"title": "2006 IPCC Guidelines for National Greenhouse Gas Inventories, Volume 2: Energy, Chapter 3: Mobile Combustion (corrected June 2010 and June 2019)",
"url": "https://www.ipcc-nggip.iges.or.jp/public/2006gl/pdf/2_Volume2/V2_3_Ch3_Mobile_Combustion.pdf",
"retrieved_on": "2026-09-27",
"sha256": "b0b7d96d5ac90ecf359cdb74e932448cfba041c6cec0e1dc24f2def444508c30",
"license_note": "IPCC publication. Values cited with table and page; check IPCC copyright terms before republishing the document itself.",
"pages": [
"21"
]
},
"… 3 more"
],
"script_path": "pipeline/compute/fuels.ts;pipeline/build.ts",
"git_commit": "011197720f8f7ea61d6d0fb4046245bac58f7b62"
},
"supersedes_id": null,
"citation": "ke.fuel.diesel.mobile per kg; derived from Intergovernmental Panel on Climate Change (IPCC), Task Force on National Greenhouse Gas Inventories, 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Volume 2: Ener…"
},
"… 3 more"
]
}GET/v1/factors/{factor_key}Public · key optional
Look up a factor
The factor valid on a date, with full provenance.
Returns one row per activity unit. Where published periods overlap (EPRA's July–December and financial-year values), the shortest period covering the date is returned.
| Parameter | Description |
|---|---|
factor_key | Which factor. Start typing to search. e.g. "ke.electricity.grid.location_based" |
date | Defaults to today e.g. "2025-09-15" |
gwp | Global warming potentials for CO₂e: IPCC AR6 (default) or AR5. Default "ar6". e.g. "ar6" |
release | Leave empty for the latest release. e.g. "2026.1" |
Response fields
| Field | Description |
|---|---|
factor_key | e.g. "ke.electricity.grid.location_based" |
release | |
date | |
gwp | |
factors | One row per activity unit (e.g. kg and litre) |
factors[] | Stable id of this row in this release |
factors[] | e.g. "ke.fuel.diesel.stationary" |
factors[] | e.g. "2026.1" |
factors[] | e.g. "KE" |
factors[] | e.g. "fuel" |
factors[] | Values are kg per this unit e.g. "litre" |
factors[] | |
factors[] | Half-open validity period [start, end) |
factors[] | |
factors[] | |
factors[] | e.g. 2025 |
factors[] | |
factors[] | kg of each gas per activity unit. null means not reported, not zero. |
factors[] | |
factors[] | |
factors[] | |
factors[] | |
factors[] | On the requested GWP basis; null when the source doesn't support it |
factors[] | Reported separately; never included in co2e |
factors[] | |
factors[] | |
factors[] | |
factors[] | |
factors[] | |
factors[] | |
factors[] | e.g. "pipeline/extract/epra.ts;pipeline/build.ts" |
factors[] | e.g. "0123456789abcdef0123456789abcdef01234567" |
factors[] | |
factors[] | A sentence a report can paste e.g. "ke.fuel.diesel.stationary per litre; derived from …; Mizani Carbon release 2026.1, factor 7b1c…" |
Responses
- 200The applicable factor rows
- 400Invalid query
- 401Missing, unknown or revoked API key
- 404Unknown factor or release, or no period covers the date
- 429Rate limit exceeded; see Retry-After
- 503No published release yet
curl "https://mizani-api.fly.dev/v1/factors/ke.electricity.grid.location_based?date=2025-07-01"{
"factor_key": "ke.electricity.grid.location_based",
"release": "2026.1",
"date": "2025-07-01",
"gwp": "ar6",
"factors": [
{
"id": "7c0df840-e25e-4936-959e-e3b16b24d8c0",
"factor_key": "ke.electricity.grid.location_based",
"release": "2026.1",
"region": "KE",
"sector": "electricity",
"activity_unit": "kWh",
"method": "official",
"period": {
"start": "2025-07-01",
"end": "2026-01-01"
},
"data_year": 2025,
"gwp": "ar6",
"values": {
"co2": "0.05792",
"ch4": null,
"n2o": null,
"hfc": null,
"co2e": null,
"biogenic_co2": null
},
"quality_rating": null,
"uncertainty": {
"low": null,
"high": null
},
"provenance": {
"sources": [
{
"id": "epra-biannual-fy2025-26",
"publisher": "Energy and Petroleum Regulatory Authority (EPRA)",
"title": "Biannual Energy & Petroleum Statistics Report, Financial Year 2025/2026 (July–December 2025)",
"url": "https://www.epra.go.ke/sites/default/files/2026-03/Biannual%20Statistics%20Report%202025-2026.pdf",
"retrieved_on": "2026-09-27",
"sha256": "bc4964f425bc043af7b93e79f099984b170e1da1482d80956715270766242daf",
"license_note": "Reuse terms for commercial redistribution not yet confirmed (D-008).",
"pages": [
"25"
]
}
],
"script_path": "pipeline/extract/epra.ts;pipeline/build.ts",
"git_commit": "011197720f8f7ea61d6d0fb4046245bac58f7b62"
},
"supersedes_id": null,
"citation": "ke.electricity.grid.location_based per kWh, July–December 2025; official value from Energy and Petroleum Regulatory Authority (EPRA), Biannual Energy & Petroleum Statistics Report, Financial Year 2025/2026 (July–December…"
}
]
}POST/v1/estimateAPI key
Estimate emissions
Emissions for an amount of activity.
Multiplies the amount by the released factor valid on the date. Returns kg CO2e on the chosen GWP basis, each gas, biogenic CO2 separately, the factor used, and a citation to paste into a report.
| Field | Description |
|---|---|
factor_key | e.g. "ke.fuel.diesel.stationary" |
amount | Non-negative decimal; a string keeps it exact e.g. "100" |
unit | e.g. kWh, MWh, kg, t, litre, m3 e.g. "litre" |
date | Date the activity happened e.g. "2025-09-15" |
gwp | Default "ar6". e.g. "ar6" |
release | Defaults to the latest release |
Response fields
| Field | Description |
|---|---|
factor_key | |
amount | e.g. "100" |
unit | e.g. "litre" |
date | |
gwp | |
co2e_kg | null when the factor has no CO2e on this basis; see notes |
gases_kg | |
gases_kg | |
gases_kg | |
gases_kg | |
gases_kg | |
biogenic_co2_kg | Reported separately; not in co2e_kg |
notes | |
factor | |
factor | Stable id of this row in this release |
factor | e.g. "ke.fuel.diesel.stationary" |
factor | e.g. "2026.1" |
factor | e.g. "KE" |
factor | e.g. "fuel" |
factor | Values are kg per this unit e.g. "litre" |
factor | |
factor | Half-open validity period [start, end) |
factor | |
factor | |
factor | e.g. 2025 |
factor | |
factor | kg of each gas per activity unit. null means not reported, not zero. |
factor | |
factor | |
factor | |
factor | |
factor | On the requested GWP basis; null when the source doesn't support it |
factor | Reported separately; never included in co2e |
factor | |
factor | |
factor | |
factor | |
factor | |
factor | |
factor | e.g. "pipeline/extract/epra.ts;pipeline/build.ts" |
factor | e.g. "0123456789abcdef0123456789abcdef01234567" |
factor | |
factor | A sentence a report can paste e.g. "ke.fuel.diesel.stationary per litre; derived from …; Mizani Carbon release 2026.1, factor 7b1c…" |
citation | e.g. "ke.fuel.diesel.stationary per litre; sources: … ; Mizani Carbon release 2026.1, factor 7b1c…" |
Responses
- 200The estimate
- 400Invalid request
- 401Missing, unknown or revoked API key
- 404Unknown factor or release, or no period covers the date
- 422The unit doesn't match the factor's activity unit
- 429Rate limit exceeded; see Retry-After
- 503No published release yet
curl -X POST "https://mizani-api.fly.dev/v1/estimate" \
-H "Authorization: Bearer $MIZANI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"factor_key": "ke.fuel.diesel.stationary",
"amount": "1200",
"unit": "litre",
"date": "2025-07-01",
"gwp": "ar6"
}'Needs a key, so there's no live example here. Every field is listed on the left; run it in the playground with your key.
Try it in the playgroundPOST/v1/estimate/batchAPI key
Estimate a batch
Up to 1,000 estimates in one call.
Each item succeeds or fails on its own; results keep the request order.
| Field | Description |
|---|---|
items | Up to 1,000 items. |
items[] | e.g. "ke.fuel.diesel.stationary" |
items[] | Non-negative decimal; a string keeps it exact e.g. "100" |
items[] | e.g. kWh, MWh, kg, t, litre, m3 e.g. "litre" |
items[] | Date the activity happened e.g. "2025-09-15" |
items[] | Default "ar6". e.g. "ar6" |
items[] | Defaults to the latest release |
Response fields
| Field | Description |
|---|---|
results |
Responses
- 200One result or problem per item
- 400Invalid request, or more than 1,000 items
- 401Missing, unknown or revoked API key
- 429Rate limit exceeded; see Retry-After
- 503No published release yet
curl -X POST "https://mizani-api.fly.dev/v1/estimate/batch" \
-H "Authorization: Bearer $MIZANI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"items": [
{
"factor_key": "ke.electricity.grid.location_based",
"amount": "18.5",
"unit": "MWh",
"date": "2025-07-01"
},
{
"factor_key": "ke.fuel.diesel.stationary",
"amount": "1200",
"unit": "litre",
"date": "2025-07-01"
},
{
"factor_key": "ke.fuel.lpg.stationary",
"amount": "340",
"unit": "kg",
"date": "2025-07-01"
}
]
}'Needs a key, so there's no live example here. Every field is listed on the left; run it in the playground with your key.
Try it in the playgroundGET/v1/releasesPublic · key optional
List releases
Published releases, newest first.
Response fields
| Field | Description |
|---|---|
releases | |
releases[] | e.g. "2026.1" |
releases[] | e.g. "2026-10-01T09:00:00.000Z" |
releases[] |
Responses
- 200Releases
- 401Missing, unknown or revoked API key
- 429Rate limit exceeded; see Retry-After
curl "https://mizani-api.fly.dev/v1/releases"{
"releases": [
{
"version": "2026.1",
"published_at": "2026-09-29T11:31:36.267Z",
"factor_count": 34
}
]
}GET/v1/releases/{version}Public · key optional
Get a release
A release with its changelog.
| Parameter | Description |
|---|---|
version | A published release, e.g. 2026.1. e.g. "2026.1" |
Response fields
| Field | Description |
|---|---|
version | e.g. "2026.1" |
published_at | e.g. "2026-10-01T09:00:00.000Z" |
factor_count | |
changelog_md | e.g. "# Release 2026.1\n\n…" |
downloads | The release as CSV and XLSX. Empty for releases published before downloads existed. |
downloads[] | |
downloads[] | e.g. "mizani-2026.1.csv" |
downloads[] | e.g. "text/csv; charset=utf-8" |
downloads[] | |
downloads[] | SHA-256 of the file, to check a download |
downloads[] | e.g. "/v1/releases/2026.1/download?format=csv" |
fingerprint | Null for releases published before fingerprints existed |
fingerprint | |
fingerprint | Merkle root over the rows of the CSV download; recompute it from the file (see /docs, Verify a release) |
fingerprint | One leaf per CSV row |
attestations | Public-chain attestations of the fingerprint, if any |
attestations[] | |
attestations[] | |
attestations[] | |
attestations[] | |
attestations[] | |
attestations[] | |
attestations[] | |
attestations[] | |
attestations[] | The attestation on easscan.org |
Responses
- 200The release
- 401Missing, unknown or revoked API key
- 404No such published release
- 429Rate limit exceeded; see Retry-After
curl "https://mizani-api.fly.dev/v1/releases/2026.1"{
"version": "2026.1",
"published_at": "2026-09-29T11:31:36.267Z",
"factor_count": 34,
"changelog_md": "# Release 2026.1\n\nBuilt from commit `011197720f8f7ea61d6d0fb4046245bac58f7b62`. Compared with no earlier release: 34 added, 0 changed, 0 unchanged, 0 withdrawn.\n\n## Added\n\n- `global.refrigerant.r134a (kg) [1990-01-01, 99…",
"fingerprint": {
"algorithm": "mizani-merkle-sha256-v1",
"merkle_root": "a1dd2701be1386f8e64f7fc1b7e07594d1344f68be7fc989059474c20f8861b3",
"leaves": 34
},
"attestations": [
{
"network": "base-sepolia",
"chain_id": 84532,
"schema_uid": "0xb21ddb71f31690489dca765600de71b816ab50635f1464aaef9687bc7dbcdd65",
"attestation_uid": "0xd55f3f0b8c5db98745cdfb7bc687aae5eb82890bff354d14fae559f0b782201e",
"tx_hash": "0x448311ed106cbc00b746f2d4c7ee0b0851e0aadf02c87dd9b96953940757c3b4",
"attester": "0x44b0b1c531e4b72c9c5f638d7096ed574846237b",
"merkle_root": "a1dd2701be1386f8e64f7fc1b7e07594d1344f68be7fc989059474c20f8861b3",
"attested_at": "2026-09-29T17:57:22.530Z",
"explorer_url": "https://base-sepolia.easscan.org/attestation/view/0xd55f3f0b8c5db98745cdfb7bc687aae5eb82890bff354d14fae559f0b782201e"
}
],
"downloads": [
{
"format": "csv",
"filename": "mizani-2026.1.csv",
"media_type": "text/csv; charset=utf-8",
"bytes": 44003,
"sha256": "9dc3853cd5b14150c608e2133956ebea935e5aaff8a4876c2a33071e54e45cdc",
"url": "/v1/releases/2026.1/download?format=csv"
},
{
"format": "xlsx",
"filename": "mizani-2026.1.xlsx",
"media_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"bytes": 18360,
"sha256": "f43ea86128bb83715fa87936cf45afcbb737ccdb46496123dc4592b5d8375a56",
"url": "/v1/releases/2026.1/download?format=xlsx"
}
]
}GET/v1/releases/{version}/downloadPublic · key optional
Download a release
Download a release as CSV or XLSX.
Every factor in the release with its provenance and citation. The XLSX adds README, Sources and Changelog sheets. Public for the latest release; older releases need a key. The ETag is the file's SHA-256.
| Parameter | Description |
|---|---|
version | A published release, e.g. 2026.1. e.g. "2026.1" |
format | CSV (default) or XLSX with README, Sources and Changelog sheets. Default "csv". e.g. "csv" |
Responses
- 200The file
- 400Invalid query
- 401Missing, unknown or revoked API key
- 404No such published release, or it has no downloads
- 429Rate limit exceeded; see Retry-After
curl "https://mizani-api.fly.dev/v1/releases/2026.1/download?format=csv"id,release,factor_key,region,sector,activity_unit,co2,ch4,n2o,hfc,co2e_ar6,co2e_ar5,biogenic_co2,method,period_start,period_end,data_year,quality_rating,uncertainty_low,uncertainty_high,source_ids,source_pages,script_path,git_commit,supersedes_id,citation
c2f3fb9e-1f11-40bd-9312-7aef54809ae5,2026.1,global.refrigerant.r134a,GLOBAL,refrigerant,kg,,,,1,1530,1300,,derived,1990-01-01,9999-01-01,2021,,,,ipcc-ar5-wg1-ch8;ipcc-ar6-wg1-ch7-sm,74;17,pipeline/compute/refrigerants.ts;pipeline/build.ts,011197720f8f7ea61d6d0fb4046245bac58f7b62,,"global.refrigerant.r134a per kg; derived from Intergovernmental Panel on Climate Change (IPCC), Working Group I, Climate Change 2013: The Physical Science Basis (AR5 WGI), Chapter 8: Anthropogenic and Natural Radiative Forcing; Intergovernmental Panel on Climate Change (IPCC), Working Group I, Climate Change 2021: The Physical Science Basis (AR6 WGI), Chapter 7 Supplementary Material: The Earth’s Energy Budget, Climate Feedbacks, and Climate Sensitivity; Mizani Carbon release 2026.1, factor c2f3fb9e-1f11-40bd-9312-7aef54809ae5"
c3567a4d-12a9-4d4e-896d-f4ec42d9f554,2026.1,global.refrigerant.r22,GLOBAL,refrigerant,kg,,,,,1960,1760,,derived,1990-01-01,9999-01-01,2021,,,,ipcc-ar5-wg1-ch8;ipcc-ar6-wg1-ch7-sm,73;16,pipeline/compute/refrigerants.ts;pipeline/build.ts,011197720f8f7ea61d6d0fb4046245bac58f7b62,,"global.refrigerant.r22 per kg; derived from Intergovernmental Panel on Climate Change (IPCC), Working Group I, Climate Change 2013: The Physical Science Basis (AR5 WGI), Chapter 8: Anthropogenic and Natural Radiative Forcing; Intergovernmental Panel on Climate Change (IPCC), Working Group I, Climate Change 2021: The Physical Science Basis (AR6 WGI), Chapter 7 Supplementary Material: The Earth’s Energy Budget, Climate Feedbacks, and Climate Sensitivity; Mizani Carbon release 2026.1, factor c3567a4d-12a9-4d4e-896d-f4ec42d9f554"GET/v1/releases/{version}/proof/{factor_id}Public · key optional
Prove a factor
Prove a factor belongs to a release.
A Merkle inclusion proof from the factor's CSV row to the release fingerprint. Hash the leaf, apply each step, and compare with merkle_root (and with the on-chain attestation, if there is one). Public for the latest release; older releases need a key.
| Parameter | Description |
|---|---|
version | A published release, e.g. 2026.1. e.g. "2026.1" |
factor_id | The id of a factor row (a UUID), as returned by a lookup. |
Response fields
| Field | Description |
|---|---|
release | |
factor_id | |
algorithm | |
leaf_index | |
leaf_count | |
leaf | The exact text hashed: the factor's CSV row as a JSON array of strings |
leaf_hash | |
proof | |
proof[] | left: SHA-256(0x01 || sibling || current); right: SHA-256(0x01 || current || sibling) |
proof[] | |
merkle_root |
Responses
- 200The proof
- 400Invalid factor id
- 401Missing, unknown or revoked API key
- 404No such release or factor, or the release has no fingerprint
- 429Rate limit exceeded; see Retry-After
curl "https://mizani-api.fly.dev/v1/releases/2026.1/proof/7c0df840-e25e-4936-959e-e3b16b24d8c0"{
"release": "2026.1",
"factor_id": "7c0df840-e25e-4936-959e-e3b16b24d8c0",
"algorithm": "mizani-merkle-sha256-v1",
"leaf_index": 13,
"leaf_count": 34,
"leaf": "[\"7c0df840-e25e-4936-959e-e3b16b24d8c0\",\"2026.1\",\"ke.electricity.grid.location_based\",\"KE\",\"electricity\",\"kWh\",\"0.05792\",\"\",\"\",\"\",\"\",\"\",\"\",\"official\",\"2025-07-01\",\"2026-01-01\",\"2025\",\"\",\"\",\"\",\"epra-biannual-fy2025-26\",\"2…",
"leaf_hash": "c56a82ade423dada169fc7a00e1fa7822c16b734425bd791ab7d27de6f36b845",
"proof": [
{
"position": "left",
"hash": "09c4e743d3363a9b538d065144ee87b2466a890c3dff08d81c0e02da90c5cc82"
},
{
"position": "right",
"hash": "edfcfdbf102ad171b91ad100d831afa3fd68380489ef178310e31cf62e4c54bd"
},
"… 4 more"
],
"merkle_root": "a1dd2701be1386f8e64f7fc1b7e07594d1344f68be7fc989059474c20f8861b3"
}GET/v1/sources/{id}Public · key optional
Get a source
A source document: publisher, title, URL, retrieval date and SHA-256.
| Parameter | Description |
|---|---|
id | As cited in a factor's provenance. e.g. "epra-biannual-fy2025-26" |
Response fields
| Field | Description |
|---|---|
id | e.g. "epra-biannual-fy2025-26" |
publisher | e.g. "Energy and Petroleum Regulatory Authority (EPRA)" |
title | |
url | e.g. "https://www.epra.go.ke/sites/default/files/example.pdf" |
retrieved_on | |
sha256 | SHA-256 of the file as downloaded |
license_note |
Responses
- 200The source
- 401Missing, unknown or revoked API key
- 404No such source
- 429Rate limit exceeded; see Retry-After
curl "https://mizani-api.fly.dev/v1/sources/epra-biannual-fy2025-26"{
"id": "epra-biannual-fy2025-26",
"publisher": "Energy and Petroleum Regulatory Authority (EPRA)",
"title": "Biannual Energy & Petroleum Statistics Report, Financial Year 2025/2026 (July–December 2025)",
"url": "https://www.epra.go.ke/sites/default/files/2026-03/Biannual%20Statistics%20Report%202025-2026.pdf",
"retrieved_on": "2026-09-27",
"sha256": "bc4964f425bc043af7b93e79f099984b170e1da1482d80956715270766242daf",
"license_note": "Reuse terms for commercial redistribution not yet confirmed (D-008)."
}Guides
Errors
Errors use RFC 9457 problem details (application/problem+json): a type you can match on, a title, the HTTP status, a detail for people, and for invalid requests an errors list naming each field. Each type resolves to its description, e.g. /problems/unit-mismatch.
| Status | Type | Meaning |
|---|---|---|
| 400 | invalid-request | A parameter or body field is missing or malformed. errors lists each one. |
| 401 | unauthorized | Send Authorization: Bearer mzn_live_… with an active key. |
| 404 | not-found | The route, factor, release or source doesn't exist. |
| 404 | no-factor-for-date | The factor exists, but no published period covers the requested date. |
| 409 | too-many-keys | An account can hold a limited number of active keys. Revoke one you no longer use. |
| 413 | payload-too-large | The body is over the size limit. Split a large batch into several calls. |
| 422 | unit-mismatch | The amount's unit measures something different from the factor's activity unit (for example energy vs mass). Units are never converted across dimensions. |
| 429 | rate-limited | The key or client exceeded its per-minute limit. Retry after the Retry-After seconds. |
| 500 | internal-error | An unexpected error. It has been logged. |
| 503 | no-published-release | The database has no published release yet. |
| 503 | service-unavailable | The API can't reach its database. Try again shortly. |
{
"type": "/problems/unit-mismatch",
"title": "Unit doesn't match the factor",
"status": 422,
"detail": "ke.fuel.diesel.stationary is per kg or per litre; kWh is an energy unit.",
"instance": "/v1/estimate"
}Guides
Rate limits
Limits are per minute, per key (or per address without one):
- Without a key: 30. Free keys: 60. Pilot keys: 600.
- Every response says where you are:
RateLimit-Limit,RateLimit-RemainingandRateLimit-Reset(seconds until the window resets). - Over the limit you get
429 rate-limitedwithRetry-After. Wait that many seconds, then retry. - Many lines? One batch call of up to 1,000 lines counts once. Request bodies can be up to 512 kB.
import time, requests
def get(url, **kw):
for attempt in range(5):
r = requests.get(url, **kw)
if r.status_code != 429:
r.raise_for_status()
return r.json()
time.sleep(int(r.headers.get("Retry-After", "1")))
raise RuntimeError("still rate limited")Guides
Pagination
GET /v1/factors is paged: page starts at 1 and per_page takes 1 to 200 (default 50). Each response gives page, per_page and total, so you know when to stop.
import requests
rows, page = [], 1
while True:
r = requests.get("https://mizani-api.fly.dev/v1/factors",
params={"per_page": 200, "page": page}).json()
rows += r["factors"]
if page * r["per_page"] >= r["total"]:
break
page += 1Guides
Caching
- A release never changes, so data read with an explicit
releasecan be cached for as long as you like. - Data from the latest release changes only when a new release is published: checking once a day is plenty.
GET /v1/healthnames the latest release cheaply. - A download's
ETagis the file's SHA-256, the same hash listed on the release.
Guides
Versioning
Two things are versioned separately. Releases version the data (2026.1, 2026.2, …). The /v1 prefix versions the API itself.
Within v1, fields may be added, but existing fields keep their names and meaning. Anything that would break a client comes as a new version, announced on the changelog first.
Guides
Verify a release
You don't have to trust us that a release is unchanged. Each release has a fingerprint: a Merkle root over the rows of its CSV download, published with the release and, once attested, on a public blockchain (the Ethereum Attestation Service on Base). The attestation holds only fingerprints and file hashes, never factor values.
- Leaf: SHA-256 of the byte
0x00followed by the row's values as a compact JSON array of strings, in the CSV's column order (UTF-8). - Node: SHA-256 of
0x01, then the left child, then the right child. Leaves are in the file's row order; an unpaired last node moves up a level unchanged. - Compare the root with
fingerprint.merkle_rootfromGET /v1/releases/{version}. To check one factor without the file,GET /v1/releases/{version}/proof/{factor_id}returns its row and the sibling hashes up to the root.
Or drop the file into the browser verifier, which runs these checks and the attestation's in your browser.
import csv, hashlib, json, sys
def sha(*parts):
return hashlib.sha256(b"".join(parts)).digest()
with open(sys.argv[1], newline="", encoding="utf-8") as f:
header, *rows = list(csv.reader(f))
level = [sha(b"\x00", json.dumps(r, separators=(",", ":"), ensure_ascii=False).encode("utf-8"))
for r in rows]
while len(level) > 1:
level = [sha(b"\x01", level[i], level[i + 1]) if i + 1 < len(level) else level[i]
for i in range(0, len(level), 2)]
print(level[0].hex()) # compare with the release's fingerprintGuides
Google Sheets
=MIZANI(factor_key, amount, unit, date) returns kg CO₂e, and =MIZANI_CITE(factor_key, date, [unit]) returns the citation.
- An optional fifth argument picks one gas:
co2,ch4,n2o,hfcorbiogenic_co2. The grid factor is CO₂ only, so use"co2"for electricity. A sixth argument,"ar5", switches the GWP basis. - Ranges fill a whole column in one call. If a row fails, the range shows the error and its row number, so a total never silently leaves a row out.
- Mizani Carbon › Pin to a release keeps a report's numbers fixed when a new release is published.
Install: Extensions › Apps Script, replace Code.gs and appsscript.json with the Mizani Carbon script and manifest (pilot customers get both from us), reload, then set the API address to https://mizani-api.fly.dev and your key from the Mizani Carbon menu. The key is readable by anyone who can edit the spreadsheet: give a shared sheet its own key.
=MIZANI("ke.fuel.diesel.stationary", B2, "litre", C2)
=MIZANI("ke.electricity.grid.location_based", B3, "kWh", C3, "co2")
=MIZANI(A2:A500, B2:B500, C2:C500, D2:D500)
=MIZANI_CITE("ke.fuel.diesel.stationary", C2, "litre")Guides
AI agents (MCP)
The Mizani Carbon MCP server gives an agent three read-only tools: search_factors finds factors by words such as “diesel” or “paraffin”, get_factor returns a factor with its sources, pages and citation, and estimate turns an amount into kg of each gas and kg CO₂e. Every answer carries the citation, so the agent quotes a source instead of guessing.
It runs on Node 22.18 or later. Lookups work without a key; estimate needs one. It isn't on npm yet: pilot customers get it from us.
claude mcp add --transport stdio \
--env MIZANI_API_KEY=mzn_live_… \
--env MIZANI_API_URL=https://mizani-api.fly.dev \
mizani -- node /path/to/mizani/mcp/bin/mizani-mcp.tsGuides
Pay per call
Not available yet. Paying per call with a stablecoin (x402) stays switched off until a legal review of Kenya's virtual-asset rules is complete, and will start on a test network.