---
title: Calculate Carbon Footprint API
slug: carbon-footprint-api
url: https://apyhub.com/martin10291/service/carbon-footprint-api
provider: Martin Petrov
categories: [Model Kit, Retrieval Kit, Verification Kit]
tags: [carbon-footprint, emissions-calculation, co2e, desnz-factors, ghg-protocol]
auth: api_key
version: 1.0
service_type: sync
endpoints: 1
atoms: 100
mcp: true
---

# Calculate Carbon Footprint API

Carbon Footprint API: send flights, car trips, electricity, fuel and hotels. Get CO2e split by Scope 1, 2 and 3 from UK DESNZ factors. Free tier, no card.

## Endpoints

| Method | URL | Description | Atoms |
| --- | --- | --- | --- |
| POST | `https://api.eu.apyhub.com/martin10291/carbon-footprint-api` | What it does Calculate greenhouse gas emissions (CO2e) for business activities with the official UK… | 100 |

## Endpoint reference

### Calculate Carbon Footprint

`POST https://api.eu.apyhub.com/martin10291/carbon-footprint-api` · 100 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `mode` | body | string | no | calculate = CO2e of your activities (one result row per activity); search = find official DESNZ factors by words (e.g. 'diesel litres', 'container ship', 'hotel japan') and get their factorId; catego… |
| `year` | body | string | no | Which official DESNZ factor set to use. latest = the newest published set (2026). Use an older year to match last year's report. One of: latest, 2026, 2025, 2024, 2023. Default: `latest`. Example: `l… |
| `limit` | body | integer | no | For mode=search: maximum number of factors returned. Default: `20`. Example: `50`. |
| `query` | body | string | no | For mode=search: words that must all appear in the factor path, e.g. 'diesel litres', 'hotel japan', 'refrigerant R410A', 'waste landfill'. |
| `scope` | body | string | no | For mode=search: only factors of this GHG Protocol scope. Empty = all scopes. One of: , 1, 2, 3. |
| `activities` | body | array of object | no | List of activities (max 100). Each object has a 'type': flight {from, to (IATA codes) or distanceKm, cabin: economy\|premium_economy\|business\|first\|average, passengers, roundTrip, radiativeForcing (de… |
| `activities[].to` | body | string | no | Example: `JFK`. |
| `activities[].kwh` | body | integer | no |  |
| `activities[].from` | body | string | no | Example: `LHR`. |
| `activities[].fuel` | body | string | no |  |
| `activities[].size` | body | string | no |  |
| `activities[].type` | body | string | no | Example: `flight`. |
| `activities[].unit` | body | string | no |  |
| `activities[].cabin` | body | string | no | Example: `economy`. |
| `activities[].nights` | body | integer | no |  |
| `activities[].country` | body | string | no |  |
| `activities[].distance` | body | integer | no |  |
| `activities[].roundTrip` | body | boolean | no | Example: `true`. |
| `includeTotal` | body | boolean | no | For mode=calculate with 2+ activities: add one extra row with the total kgCO2e and the Scope 1/2/3 split of all activities. Example: `false`. |

#### Quickstart

Calculate emissions for a flight, a car trip, office electricity and a hotel stay with the latest DESNZ factors.

```bash
curl -X POST "https://api.eu.apyhub.com/martin10291/carbon-footprint-api" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "calculate",
    "includeTotal": true,
    "activities": [
      { "type": "flight", "from": "LHR", "to": "JFK", "cabin": "economy", "roundTrip": true },
      { "type": "car", "distance": 120, "unit": "km", "size": "medium", "fuel": "petrol" },
      { "type": "electricity", "kwh": 1000 },
      { "type": "hotel", "nights": 3, "country": "DE" }
    ]
  }'
```

#### What you'll get back

One row per activity plus a total row. The flight row is shown in full; the other rows are shortened.

```json
{
  "count": 5,
  "items": [
    {
      "index": 0,
      "type": "flight",
      "description": "LHR (London Heathrow Airport) -> JFK (John F. Kennedy International Airport), economy class, round trip, 1 passenger(s)",
      "input": { "type": "flight", "from": "LHR", "to": "JFK", "cabin": "economy", "roundTrip": true },
      "kgCO2e": 1400.5062,
      "tCO2e": 1.400506,
      "kgCO2": 1388.5402,
      "kgCH4asCO2e": 0.1197,
      "kgN2OasCO2e": 11.8464,
      "byScope": { "scope1": 0, "scope2": 0, "scope3": 1400.5062 },
      "activityAmount": 11966.0479,
      "activityUnit": "passenger.km",
      "components": [
        {
          "factorId": "21_316_3170_11",
          "path": "Business travel- air > Flights > Long-haul, to/from UK > Economy class > With RF",
          "category": "Business travel- air",
          "scope": "Scope 3",
          "factorUnit": "passenger.km",
          "kgCO2ePerUnit": 0.11704,
          "quantity": 11966.047899,
          "kgCO2e": 1400.5062
        }
      ],
      "from": "LHR",
      "to": "JFK",
      "greatCircleKm": 5539.8,
      "distanceKm": 5983,
      "haul": "Long-haul, to/from UK",
      "cabin": "Economy class",
      "passengers": 1,
      "roundTrip": true,
      "radiativeForcing": true,
      "includesWellToTank": false,
      "factorYear": 2026,
      "notes": [
        "Great-circle distance 5540 km + 8% DESNZ uplift = 5983 km.",
        "Includes radiative forcing (non-CO2 climate effects of aviation), as DESNZ recommends."
      ],
      "source": "UK DESNZ Greenhouse gas reporting: conversion factors 2026",
      "sourceUrl": "https://www.gov.uk/government/collections/government-conversion-factors-for-company-reporting",
      "licence": "Open Government Licence v3.0",
      "attribution": "Contains public sector information licensed under the Open Government Licence v3.0. Source: UK Department for Energy Security and Net Zero (DESNZ), Greenhouse gas reporting: conversion factors."
    },
    { "index": 1, "type": "car", "description": "120.0 km medium car, petrol", "kgCO2e": 20.8932, "byScope": { "scope1": 0, "scope2": 0, "scope3": 20.8932 } },
    { "index": 2, "type": "electricity", "description": "1000 kWh UK grid electricity", "kgCO2e": 143.95, "byScope": { "scope1": 0, "scope2": 130.96, "scope3": 12.99 } },
    { "index": 3, "type": "hotel", "description": "3 night(s) x 1 room(s), hotel in Germany", "kgCO2e": 39.6, "byScope": { "scope1": 0, "scope2": 0, "scope3": 39.6 } },
    { "type": "total", "description": "Total of 4 activities", "kgCO2e": 1604.9494, "tCO2e": 1.604949, "byScope": { "scope1": 0, "scope2": 130.96, "scope3": 1473.9894 }, "errors": 0, "factorYear": 2026 }
  ]
}
```

Find a factor ID for anything not covered by an activity type:

```json
{ "mode": "search", "query": "diesel litres", "limit": 5 }
```

## About

## What it does

The Carbon Footprint API turns business activities into CO2e using the official UK government conversion factors from DESNZ (formerly published by DEFRA). Send a list of activities and get one result row per activity, in kgCO2e and tCO2e.

Each activity has a `type`. Travel types are flight, car, rail, bus, taxi, motorbike and ferry. The others are electricity, fuel, hotel, freight and `factor` for any official factor ID. For a flight, send `from` and `to` airport codes. The API works out the distance and adds the 8% uplift DESNZ recommends. For a car, send `distance` with `size` and `fuel`. Set `owned` to true for company cars so they count as Scope 1.

Every row shows the factor used, its factor ID and the split across Scope 1, 2 and 3. Set `includeTotal` to add a total row for the whole list. Use `year` to pick a factor set from 2023 to 2026, so last year's report stays consistent.

Two more modes help you map data. `search` finds official emission factors by words, such as "diesel litres" or "hotel japan". `categories` lists every factor category with its scope and units.

Teams use the Carbon Footprint API for GHG Protocol reporting, business travel emissions, carbon dashboards and CO2 emissions calculators in their own apps.

The [Invoice Data Extraction API](https://apyhub.com/apyhub/service/extract-invoice-data) can pull kWh and litres from supplier bills. Show the Scope split with the [Donut Chart API](https://apyhub.com/apyhub/service/simple-donut-chart-generation) and export a report with the [HTML to PDF API](https://apyhub.com/apyhub/service/convert-html-to-pdf).

## Usage

Base URL: `https://api.eu.apyhub.com` (default region — see
`GET https://apyhub.com/api/public/regions` for the rest).

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyhub.com/martin10291/service/carbon-footprint-api
