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.

Base URLhttps://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.

GET /v1/health, live
{
  "status": "ok",
  "latest_release": "2026.1"
}

Start

Quickstart

  1. 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.
  2. 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.
  3. 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_.

What needs a key
CallWithout a keyWith a key
Factors, downloads, proofsLatest releaseAny release
Releases, sources, healthYesYes
Estimates and batches401Yes
Rate limit per minute30 per address60 (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.
Every keyed request
Authorization: Bearer $MIZANI_API_KEY

Concepts

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

Fuels

Refrigerants

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-31 and cover any date.
  • date defaults to today. If no published period covers a date, you get 404 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.

  • co2e uses the IPCC's AR6 global warming potentials by default; pass gwp=ar5 for AR5.
  • null means not reported, never zero. Kenya's grid factor is published by EPRA as CO₂ only, so its co2e is null: use co2 (or gases_kg.co2 in an estimate).
  • Biogenic CO₂ (from wood fuels) is reported in biogenic_co2 and is never included in co2e.

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.

Units an estimate accepts
MeasuresUnits
EnergykWhMWhGWh
Massgkgttonne
VolumemllLlitreliterm3

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 released

Concepts

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_id points 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 the pages (or spreadsheet cells) where the inputs appear.
  • script_path and git_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
200 response
FieldDescription
status"ok"required
latest_releasestring | nullrequirede.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"
Live response from the API, shortened
{
  "status": "ok",
  "latest_release": "2026.1"
}
Try it in the playground

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

Parameters
ParameterDescription
regionstringquerye.g. "KE"
sectorstringqueryElectricity, fuels or refrigerants. e.g. "fuel"
key_prefixstringquerye.g. ke.fuel. for every Kenyan fuel. e.g. "ke.fuel."
datestring (date)queryOnly factors whose period covers this day. e.g. "2025-09-15"
releasestringquerye.g. "2026.1"
gwp"ar6" | "ar5"queryGlobal warming potentials for CO₂e: IPCC AR6 (default) or AR5. Default "ar6". e.g. "ar6"
pageintegerqueryStarts at 1. Default 1. e.g. 1
per_pageintegerquery1 to 200 rows. Default 50. 1 to 200. e.g. 50
Response fields
200 response
FieldDescription
releasestringrequirede.g. "2026.1"
pageintegerrequired
per_pageintegerrequired
totalintegerrequired
factorsFactor[]required
factors[].idstring (uuid)requiredStable id of this row in this release
factors[].factor_keystringrequirede.g. "ke.fuel.diesel.stationary"
factors[].releasestringrequirede.g. "2026.1"
factors[].regionstringrequirede.g. "KE"
factors[].sectorstringrequirede.g. "fuel"
factors[].activity_unitstringrequiredValues are kg per this unit e.g. "litre"
factors[].method"official" | "derived"required
factors[].periodobjectrequiredHalf-open validity period [start, end)
factors[].period.startstring (date)required
factors[].period.endstring (date)required
factors[].data_yearintegerrequirede.g. 2025
factors[].gwp"ar6" | "ar5"required
factors[].valuesobjectrequiredkg of each gas per activity unit. null means not reported, not zero.
factors[].values.co2string | nullrequired
factors[].values.ch4string | nullrequired
factors[].values.n2ostring | nullrequired
factors[].values.hfcstring | nullrequired
factors[].values.co2estring | nullrequiredOn the requested GWP basis; null when the source doesn't support it
factors[].values.biogenic_co2string | nullrequiredReported separately; never included in co2e
factors[].quality_ratinginteger | nullrequired
factors[].uncertaintyobjectrequired
factors[].uncertainty.lowstring | nullrequired
factors[].uncertainty.highstring | nullrequired
factors[].provenanceobjectrequired
factors[].provenance.sourcesCitedSource[]required
factors[].provenance.script_pathstringrequirede.g. "pipeline/extract/epra.ts;pipeline/build.ts"
factors[].provenance.git_commitstringrequirede.g. "0123456789abcdef0123456789abcdef01234567"
factors[].supersedes_idstring (uuid) | nullrequired
factors[].citationstringrequiredA 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"
Live response from the API, shortened
{
  "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"
  ]
}
Try it in the playground

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.

Parameters
ParameterDescription
factor_keystringpathrequiredWhich factor. Start typing to search. e.g. "ke.electricity.grid.location_based"
datestring (date)queryDefaults to today e.g. "2025-09-15"
gwp"ar6" | "ar5"queryGlobal warming potentials for CO₂e: IPCC AR6 (default) or AR5. Default "ar6". e.g. "ar6"
releasestringqueryLeave empty for the latest release. e.g. "2026.1"
Response fields
200 response
FieldDescription
factor_keystringrequirede.g. "ke.electricity.grid.location_based"
releasestringrequired
datestring (date)required
gwp"ar6" | "ar5"required
factorsFactor[]requiredOne row per activity unit (e.g. kg and litre)
factors[].idstring (uuid)requiredStable id of this row in this release
factors[].factor_keystringrequirede.g. "ke.fuel.diesel.stationary"
factors[].releasestringrequirede.g. "2026.1"
factors[].regionstringrequirede.g. "KE"
factors[].sectorstringrequirede.g. "fuel"
factors[].activity_unitstringrequiredValues are kg per this unit e.g. "litre"
factors[].method"official" | "derived"required
factors[].periodobjectrequiredHalf-open validity period [start, end)
factors[].period.startstring (date)required
factors[].period.endstring (date)required
factors[].data_yearintegerrequirede.g. 2025
factors[].gwp"ar6" | "ar5"required
factors[].valuesobjectrequiredkg of each gas per activity unit. null means not reported, not zero.
factors[].values.co2string | nullrequired
factors[].values.ch4string | nullrequired
factors[].values.n2ostring | nullrequired
factors[].values.hfcstring | nullrequired
factors[].values.co2estring | nullrequiredOn the requested GWP basis; null when the source doesn't support it
factors[].values.biogenic_co2string | nullrequiredReported separately; never included in co2e
factors[].quality_ratinginteger | nullrequired
factors[].uncertaintyobjectrequired
factors[].uncertainty.lowstring | nullrequired
factors[].uncertainty.highstring | nullrequired
factors[].provenanceobjectrequired
factors[].provenance.sourcesCitedSource[]required
factors[].provenance.script_pathstringrequirede.g. "pipeline/extract/epra.ts;pipeline/build.ts"
factors[].provenance.git_commitstringrequirede.g. "0123456789abcdef0123456789abcdef01234567"
factors[].supersedes_idstring (uuid) | nullrequired
factors[].citationstringrequiredA 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"
Live response from the API, shortened
{
  "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…"
    }
  ]
}
Try it in the playground

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.

Request body
FieldDescription
factor_keystringrequirede.g. "ke.fuel.diesel.stationary"
amountstring | numberrequiredNon-negative decimal; a string keeps it exact e.g. "100"
unitstringrequirede.g. kWh, MWh, kg, t, litre, m3 e.g. "litre"
datestring (date)requiredDate the activity happened e.g. "2025-09-15"
gwp"ar6" | "ar5"Default "ar6". e.g. "ar6"
releasestringDefaults to the latest release
Response fields
200 response
FieldDescription
factor_keystringrequired
amountstringrequirede.g. "100"
unitstringrequirede.g. "litre"
datestring (date)required
gwp"ar6" | "ar5"required
co2e_kgstring | nullrequirednull when the factor has no CO2e on this basis; see notes
gases_kgobjectrequired
gases_kg.co2string | nullrequired
gases_kg.ch4string | nullrequired
gases_kg.n2ostring | nullrequired
gases_kg.hfcstring | nullrequired
biogenic_co2_kgstring | nullrequiredReported separately; not in co2e_kg
notesstring[]required
factorFactorrequired
factor.idstring (uuid)requiredStable id of this row in this release
factor.factor_keystringrequirede.g. "ke.fuel.diesel.stationary"
factor.releasestringrequirede.g. "2026.1"
factor.regionstringrequirede.g. "KE"
factor.sectorstringrequirede.g. "fuel"
factor.activity_unitstringrequiredValues are kg per this unit e.g. "litre"
factor.method"official" | "derived"required
factor.periodobjectrequiredHalf-open validity period [start, end)
factor.period.startstring (date)required
factor.period.endstring (date)required
factor.data_yearintegerrequirede.g. 2025
factor.gwp"ar6" | "ar5"required
factor.valuesobjectrequiredkg of each gas per activity unit. null means not reported, not zero.
factor.values.co2string | nullrequired
factor.values.ch4string | nullrequired
factor.values.n2ostring | nullrequired
factor.values.hfcstring | nullrequired
factor.values.co2estring | nullrequiredOn the requested GWP basis; null when the source doesn't support it
factor.values.biogenic_co2string | nullrequiredReported separately; never included in co2e
factor.quality_ratinginteger | nullrequired
factor.uncertaintyobjectrequired
factor.uncertainty.lowstring | nullrequired
factor.uncertainty.highstring | nullrequired
factor.provenanceobjectrequired
factor.provenance.sourcesCitedSource[]required
factor.provenance.script_pathstringrequirede.g. "pipeline/extract/epra.ts;pipeline/build.ts"
factor.provenance.git_commitstringrequirede.g. "0123456789abcdef0123456789abcdef01234567"
factor.supersedes_idstring (uuid) | nullrequired
factor.citationstringrequiredA sentence a report can paste e.g. "ke.fuel.diesel.stationary per litre; derived from …; Mizani Carbon release 2026.1, factor 7b1c…"
citationstringrequirede.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 playground

POST/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.

Request body
FieldDescription
itemsEstimateRequest[]requiredUp to 1,000 items.
items[].factor_keystringrequirede.g. "ke.fuel.diesel.stationary"
items[].amountstring | numberrequiredNon-negative decimal; a string keeps it exact e.g. "100"
items[].unitstringrequirede.g. kWh, MWh, kg, t, litre, m3 e.g. "litre"
items[].datestring (date)requiredDate the activity happened e.g. "2025-09-15"
items[].gwp"ar6" | "ar5"Default "ar6". e.g. "ar6"
items[].releasestringDefaults to the latest release
Response fields
200 response
FieldDescription
resultsobject[]required

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 playground

GET/v1/releasesPublic · key optional

List releases

Published releases, newest first.

Response fields
200 response
FieldDescription
releasesRelease[]required
releases[].versionstringrequirede.g. "2026.1"
releases[].published_atstringrequirede.g. "2026-10-01T09:00:00.000Z"
releases[].factor_countintegerrequired

Responses

  • 200Releases
  • 401Missing, unknown or revoked API key
  • 429Rate limit exceeded; see Retry-After
curl "https://mizani-api.fly.dev/v1/releases"
Live response from the API, shortened
{
  "releases": [
    {
      "version": "2026.1",
      "published_at": "2026-09-29T11:31:36.267Z",
      "factor_count": 34
    }
  ]
}
Try it in the playground

GET/v1/releases/{version}Public · key optional

Get a release

A release with its changelog.

Parameters
ParameterDescription
versionstringpathrequiredA published release, e.g. 2026.1. e.g. "2026.1"
Response fields
200 response
FieldDescription
versionstringrequirede.g. "2026.1"
published_atstringrequirede.g. "2026-10-01T09:00:00.000Z"
factor_countintegerrequired
changelog_mdstringrequirede.g. "# Release 2026.1\n\n…"
downloadsReleaseDownload[]requiredThe release as CSV and XLSX. Empty for releases published before downloads existed.
downloads[].format"csv" | "xlsx"required
downloads[].filenamestringrequirede.g. "mizani-2026.1.csv"
downloads[].media_typestringrequirede.g. "text/csv; charset=utf-8"
downloads[].bytesintegerrequired
downloads[].sha256stringrequiredSHA-256 of the file, to check a download
downloads[].urlstringrequirede.g. "/v1/releases/2026.1/download?format=csv"
fingerprintReleaseFingerprintrequiredNull for releases published before fingerprints existed
fingerprint.algorithm"mizani-merkle-sha256-v1"required
fingerprint.merkle_rootstringrequiredMerkle root over the rows of the CSV download; recompute it from the file (see /docs, Verify a release)
fingerprint.leavesintegerrequiredOne leaf per CSV row
attestationsReleaseAttestation[]requiredPublic-chain attestations of the fingerprint, if any
attestations[].network"base-sepolia" | "sepolia" | "base"required
attestations[].chain_idintegerrequired
attestations[].schema_uidstringrequired
attestations[].attestation_uidstringrequired
attestations[].tx_hashstringrequired
attestations[].attesterstringrequired
attestations[].merkle_rootstringrequired
attestations[].attested_atstringrequired
attestations[].explorer_urlstringrequiredThe 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"
Live response from the API, shortened
{
  "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"
    }
  ]
}
Try it in the playground

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.

Parameters
ParameterDescription
versionstringpathrequiredA published release, e.g. 2026.1. e.g. "2026.1"
format"csv" | "xlsx"queryCSV (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"
Live response: the first rows of the 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"
Try it in the playground

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.

Parameters
ParameterDescription
versionstringpathrequiredA published release, e.g. 2026.1. e.g. "2026.1"
factor_idstring (uuid)pathrequiredThe id of a factor row (a UUID), as returned by a lookup.
Response fields
200 response
FieldDescription
releasestringrequired
factor_idstring (uuid)required
algorithm"mizani-merkle-sha256-v1"required
leaf_indexintegerrequired
leaf_countintegerrequired
leafstringrequiredThe exact text hashed: the factor's CSV row as a JSON array of strings
leaf_hashstringrequired
proofobject[]required
proof[].position"left" | "right"requiredleft: SHA-256(0x01 || sibling || current); right: SHA-256(0x01 || current || sibling)
proof[].hashstringrequired
merkle_rootstringrequired

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"
Live response from the API, shortened
{
  "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"
}
Try it in the playground

GET/v1/sources/{id}Public · key optional

Get a source

A source document: publisher, title, URL, retrieval date and SHA-256.

Parameters
ParameterDescription
idstringpathrequiredAs cited in a factor's provenance. e.g. "epra-biannual-fy2025-26"
Response fields
200 response
FieldDescription
idstringrequirede.g. "epra-biannual-fy2025-26"
publisherstringrequirede.g. "Energy and Petroleum Regulatory Authority (EPRA)"
titlestringrequired
urlstringrequirede.g. "https://www.epra.go.ke/sites/default/files/example.pdf"
retrieved_onstring (date)required
sha256stringrequiredSHA-256 of the file as downloaded
license_notestringrequired

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"
Live response from the API, shortened
{
  "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)."
}
Try it in the playground

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.

Problem types
StatusTypeMeaning
400invalid-requestA parameter or body field is missing or malformed. errors lists each one.
401unauthorizedSend Authorization: Bearer mzn_live_… with an active key.
404not-foundThe route, factor, release or source doesn't exist.
404no-factor-for-dateThe factor exists, but no published period covers the requested date.
409too-many-keysAn account can hold a limited number of active keys. Revoke one you no longer use.
413payload-too-largeThe body is over the size limit. Split a large batch into several calls.
422unit-mismatchThe amount's unit measures something different from the factor's activity unit (for example energy vs mass). Units are never converted across dimensions.
429rate-limitedThe key or client exceeded its per-minute limit. Retry after the Retry-After seconds.
500internal-errorAn unexpected error. It has been logged.
503no-published-releaseThe database has no published release yet.
503service-unavailableThe API can't reach its database. Try again shortly.
A problem response
{
  "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-Remaining and RateLimit-Reset (seconds until the window resets).
  • Over the limit you get 429 rate-limited with Retry-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 += 1

Guides

Caching

  • A release never changes, so data read with an explicit release can 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/health names the latest release cheaply.
  • A download's ETag is 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 0x00 followed 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_root from GET /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.

Merkle root of a download
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 fingerprint

Guides

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, hfc or biogenic_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.

Formulas
=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.ts

Guides

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.