# CO2 Emissions

This feature can be enabled in the API request by including:

```json
"control": {
  "features": [
    "co2_emissions"
  ]
}
```

The CO2 emissions feature leverages IATA's CO2 Connect data to enrich the Routehappy API's response with the real-time data of individual airlines and deliver an accurate calculation of the CO2 emissions volume for all parts of the itinerary - individually for each segment, per leg, and for the entire itinerary.

CO2 emissions are calculated for all itineraries in the API's request in real time, taking into consideration all of the individual itineraries' necessary details, such as _operating_ carrier, equipment, date of departure, cabin, etc.

Once the feature is enabled in the API request, the CO2 emissions values on all of the itinerary's levels (per segment, per leg, or for the entire itinerary) will appear in the response. They are represented as the calculation of the total duration (in minutes) of the specific level, multiplied by the calculated emissions per minute for the specific level of the itinerary. CO2 emission values are _always_ represented as floating-point numbers (truncated to the second decimal placement) in **kilograms** (kg) for a single passenger.

_**Missing IATA records**_
>It is important to note that for segments with an equipment type which **doesn't exist** in IATA's file, no CO2 Connect records will be matched, and the resulting emissions value in the API response will be `0`.

_**Mandatory Disclaimer (Effective 1st of January 2027)**_

To comply with the FOEN regulation, IATA recommends adding one of the following IATA-approved disclaimers to each flight offer, whether CO2e TTW or CO2e WTW is displayed:

_**Long version:**_

Emission estimates are calculated using IATA CO2 Connect (RP 1726). Estimates are indicative only and may differ from actual flight emissions. The calculated emissions include only CO₂-equivalent emissions from fuel consumption; additional climate-relevant effects may result in a higher overall climate impact.

_**Short version:**_

Calculated emissions include only CO₂-equivalent emissions from fuel consumption. Additional climate-relevant effects may result in a higher overall climate impact.

This is an example response for a single itinerary with 4 segments and 2 legs:

```json
{
  "data": {
      ...
  },
  "itineraries": [
    {
      "data": {
        "co2_emissions": 1616.22, // The CO2 emissions for the entire itinerary in Kg
        "legs": [
          {
            "co2_emissions": 780.09, // The CO2 emissions for the first leg in Kg
            "fares": [
              {
                "segments": [
                  {
                    "co2_emissions": 404.28, // The CO2 emissions for the first segment in Kg
                    "id": "MEL-SIN-XX-35-20231102-ECON",

                    ...
                  },
                  {
                    "co2_emissions": 375.81, // The CO2 emissions for the second segment in Kg
                    "id": "SIN-BKK-XX-39-20231102-ECON",

                    ...
                  }
                ]
              }
            ],

            ...
          },
          {
            "co2_emissions": 836.13, // The CO2 emissions for the second leg in Kg
            "fares": [
              {
                "segments": [
                  {
                    "co2_emissions": 367.17, // The CO2 emissions for the third segment in Kg
                    "id": "BKK-SIN-XX-38-20231115-ECON",

                    ...
                  },
                  {
                    "co2_emissions": 468.96, // The CO2 emissions for the fourth segment in Kg
                    "id": "SIN-MEL-XX-36-20231115-ECON",

                    ...
                  }
                ]
              }
            ],

            ...
          }
        ]
      },
      "valid": true,

      ...
    }
  ],

  ...
}
```
