# Flight: DEFRA 🇬🇧

:bulb: **High-Level Description:**

The Department for Environment, Food, and Rural Affairs (DEFRA) of the United Kingdom plays a key role in shaping environmental policies and approaches to carbon reduction. As part of its sustainability initiatives, DEFRA has developed a carbon calculation methodology specifically for the flight passenger sector, providing a standardized and credible means to evaluate the emissions associated with air travel.

DEFRA's methodology for evaluating carbon emissions from passenger flights incorporates a range of factors. These include the aircraft's fuel consumption, flight distance, type of aircraft, and even the indirect effects of high-altitude emissions. The aim is to offer a holistic view of a flight's environmental impact. By developing this standardized approach, DEFRA not only aids the aviation industry in understanding and reducing its carbon footprint but also provides a reliable reference point for policymakers and environmental advocacy groups.

**Versioning:** Add `methodology_version` to pin a specific **Conversion Factors** year (e.g., `"2024"`). If omitted, SQUAKE **uses the latest supported year**.

***

### **Sample API Requests**

#### A. Without audit mode (for pre-booking/quotes)

```json
{
  "expand": ["items"],
  "items": [
    {
      "audit": false,
      "type": "flight",
      "methodology": "DEFRA",
      "external_reference": "test_4",
      "number_of_travelers": 2,
      "origin": "LON",
      "destination": "LAX",
      "booking_class": "first",
      "aircraft_type": "737",
      "radiative_forcing_index": true,
      "energy_scope": "wtw",
      "methodology_version": "2024"
    }
  ]
}
```

#### B. With audit mode (for finalized/post-booking calculations)

```json
{
  "expand": ["items"],
  "audit_for": "<Auditable Entity ID>",
  "items": [
    {
      "audit": true,
      "type": "flight",
      "methodology": "DEFRA",
      "external_reference": "test_4",
      "number_of_travelers": 2,
      "origin": "LON",
      "destination": "LAX",
      "booking_class": "first",
      "aircraft_type": "737",
      "radiative_forcing_index": true,
      "energy_scope": "wtw",
      "methodology_version": "2024"
    }
  ]
}
```

> **Note:** `audit_for` is optional. Provide when calculating on behalf of a specific Auditable entity; otherwise omit.

* **Default Values**
  * `"booking_class": "average"`
  * `"energy_scope": "wtw"`
  * `"radiative_forcing_index": true`
  * `"methodology_version"`: **latest supported DEFRA year (default if omitted)**
* **Calculation Specifics**
  * An **8% uplift** is applied to Great Circle Distance (GCD) to account for indirect paths, delays, etc.
  * If both `distance_in_km` and `origin`/`destination` are provided, **`distance_in_km` takes precedence**.

***

### **API Request Items**

* `"type": "flight"` **(required)**
* `"methodology": "DEFRA"` **(required)**
* `"methodology_version"`: DEFRA **Conversion Factors** year (e.g., `"2024"`). **Optional**; if omitted → **latest supported year**.
* `"external_reference"`: Unique identifier (max 128 chars).
* `"number_of_travelers"`: Minimum `1` (**default:** `1`).
* `"origin"`: For airports use IATA/ICAO code (format: `^[A-Z]{3,4}$`, e.g. `"MUC"`), for other locations used in trade and transportation use UN/LOCODE codes (format: `^[A-Z]{2}\W?[A-Z2-9]{3}$`, e.g. `"DEHAM"`). You can also pass lat/long (format: `^[-+]?\d{1,3}\.\d{1,10}\s?,\s?[-+]?\d{1,3}\.\d{1,10}$`, e.g. `"+40.712,-74.006"`).
* `"destination"`: For airports use IATA/ICAO code (format: `^[A-Z]{3,4}$`, e.g. `"MUC"`), for other locations used in trade and transportation use UN/LOCODE codes (format: `^[A-Z]{2}\W?[A-Z2-9]{3}$`, e.g. `"DEHAM"`). You can also pass lat/long (format: `^[-+]?\d{1,3}\.\d{1,10}\s?,\s?[-+]?\d{1,3}\.\d{1,10}$`, e.g. `"+40.712,-74.006"`).
* `"distance_in_km"`: If present, **overrides** origin/destination resolution.
* `"booking_class"`: If not provided, pass `fare_class` + `airline` to auto-resolve; **default:** `"average"`.
* `"aircraft_type"`: IATA/ICAO code; **only applied when at least one airport is in the UK**.
* `"fare_class"` / `"airline"`: Mutually exclusive with `"booking_class"`.
* `"radiative_forcing_index"`: Apply high-altitude climate impact multiplier (**default:** `true`).
* `"sustainable_fuels"`: Indicates SAF use (reduces emissions in SQUAKE; not part of official DEFRA factors).
* `"carbon_reduction_percentage_of_total"`: Fraction `0–1` from SAF; **default:** `0`.
* `"energy_scope"`: `"wtw"` (**default**) or `"ttw"`.
* `"audit"`: boolean (optional). Set to `true` to create immutable audit records for finalized calculations. Must be enabled for your account.

***

### **Aircraft Type Distribution**

| Domestic | Short-Haul | Long-Haul |
| -------- | ---------- | --------- |
| 32N      | 32N        | 32N       |
| 32Q      | 32Q        | 32Q       |
| 319      | 318        | 320       |
| 320      | 319        | 321       |
| 321      | 320        | 332       |
| AT4      | 321        | 333       |
| AT5      | 332        | 339       |
| AT7      | 333        | 343       |
| 738      | 359        | 359       |
| D38      | AT7        | 338       |
| ER3      | 7M8        | 7M8       |
| ER4      | 7M9        | 738       |
| E70      | 733        | 752       |
| E90      | 734        | 763       |
| E95      | 735        | 764       |
| J41      | 736        | 772       |
| SF3      | 737        | 773       |
|          | 738        | 77F       |
|          | 739        | 77W       |
|          | 752        | 788       |
|          | 753        | 789       |
|          | 763        | 781       |
|          | 772        |           |
|          | 77W        |           |
|          | 788        |           |
|          | 789        |           |
|          | 221        |           |
|          | 223        |           |
|          | CR9        |           |
|          | DH8        |           |
|          | E70        |           |

***

### **Sample API Response**

```json
{
  "carbon_quantity": 15273823,
  "carbon_unit": "gram",
  "items": [
    {
      "carbon_quantity": 15273823,
      "carbon_unit": "gram",
      "external_reference": "test_4",
      "type": "flight",
      "methodology": "DEFRA",
      "methodology_version": "2024",
      "distance": 8804.0,
      "distance_unit": "kilometer"
    }
  ]
}
```

***

### **Versions**

* **Behavior:** If `methodology_version` is omitted, SQUAKE automatically applies the **latest supported** DEFRA Conversion Factors year. Pin a year for reproducibility and audit readiness.

***

### **Bibliography**

* UK Government — **Greenhouse gas emissions: Research & statistics**: <https://www.gov.uk/environment/greenhouse-gas-emissions#research\\_and\\_statistics>
* Bramwell, R., et al. (2024). *Government Greenhouse Gas Conversion Factors for Company Reporting — Methodology*. (Methodology paper PDF).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-integration.squake.earth/api-calculations-request-response/travel/flight/flight-defra.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
