UnitĀ Conversion

UpdatedĀ 17 Apr 2025

The unit query parameter (optional; default: empty) lets you restate an LCA metric’s functional unit (denominator) in a unit that matches your own reporting conventions.

Key ruleā€ƒOnly the denominator changes; the numerator (e.g.ā€Æā€œkg CO₂ eqā€) always stays the same.


1Ā Ā Conversion workflow

  1. Match chosen → API finds the ā€œbestā€ database record.
  2. Identify functional unit → e.g.Ā kg, m³, tĀ·km…
  3. Look‑up target unit → in the conversion map for that base unit.
  4. Compute value → divide the original value by the conversion factor.
  5. Return fields
    • metric.value – adjusted number
    • metric.unit – numerator / new denominator
    • conversion_info – human‑readable note on what happened

Example – kg → g

GET /api/metrics/search?item_name=cotton+t‑shirt&metric=Carbon+footprint&unit=g

Response (truncated):

{
  "metric": { "name": "Carbon footprint", "value": 0.0083, "unit": "kg CO2 eq / g" },
  "conversion_info": "Converted functional unit from kg to g (Ɨ10³ on denominator, value Ć·1000)"
}

2Ā Ā Supported conversions

Below is the quick reference. Left column = base unit, bullets = accepted unit= values.

Base unitMetric‑scale targetsOther‑system targets
kgmg, g, t, μg, dag, hg, q, Mglb, oz, ton (US)
MJJ, kJ, GJ, TJ, μJ, nJ, PJBTU, cal, kcal, kWh, hp·h
m³cm³, dm³, L, mL, μL, hL, ML, ccft³, in³, yd³, gal (US), pt (US), fl oz (US), bbl (oil)
m²cm², dm², mm², km², ha, a, μm²ft², in², yd², acre, mi²
mmm, cm, km, μm, nm, dm, Mm, Gm, pmin, ft, yd, mi, nmi
sms, μs, ns, min, h, d, ps, ks, y, century, millennium—
t·kmg·km, kg·km, mg·km, μg·km, kt·km, Mt·kmton·mi, lb·mi, oz·mi, ton·yd
m³·kmcm³·km, L·km, dm³·km, ML·km, m³·m, m³·Mmft³·mi, gal·mi (US), in³·mi, yd³·mi, ft³·yd
passĀ·kmpassĀ·m, passĀ·cm, passĀ·Mm, passĀ·GmpassĀ·mi, passĀ·ft, passĀ·yd, passĀ·nmi

Need a unit that’s not here? Email support.


3Ā Ā Error & fallback behaviour

  • Unsupported target → API keeps the original value/unit and sets conversion_info to explain.
  • Incompatible base → same behaviour; no HTTP error is thrown.
  • Precision → factors are applied with full float precision; rounding happens only in serialization.

5Ā Ā Quick tips

  • If no target unit is set in the request, the base unit will be provided in the response.
  • Specify only SI symbols (g, L, kWh…), case‑sensitive.
  • For mass‑distance or volume‑distance units include the dot: tĀ·km, m³·km.
  • If the num_matches parameter is ≄1 (e.g.:num_matches=3), all the matched data units will be converted to the set target unit.