# Flight: EPA 🇺🇸

### :bulb: High-Level Description:

The Environmental Protection Agency (EPA) has long been a vanguard in environmental preservation and protection in the United States. When it comes to carbon calculations for the flight passenger sector, the EPA's methodology offers a robust framework, bearing in mind the intricate nature of aviation and its environmental implications. As the aviation industry remains a considerable contributor to greenhouse gas emissions, it becomes crucial to possess a comprehensive and accurate calculation methodology.

The EPA's approach for carbon emissions from passenger flights emphasizes not just the direct emissions but also factors in relevant elements such as plane type, flight distance, fuel efficiency, and load factors. This multifaceted methodology assists airlines, regulatory bodies, and environmental advocates in gaining a clearer understanding of the sector's carbon footprint. The consistency this approach provides ensures that carbon reduction efforts are based on reliable data, making it possible to chart effective and impactful strategies to combat climate change.

**Versioning:** Include `methodology_version` to pin a specific Hub 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": "US-EPA",
      "external_reference": "test_1",
      "number_of_travelers": 1,
      "origin": "JFK",
      "destination": "ORY",
      "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": "US-EPA",
      "external_reference": "test_1",
      "number_of_travelers": 1,
      "origin": "JFK",
      "destination": "ORY",
      "methodology_version": "2024"
    }
  ]
}
```

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

***

### **API Request Items**

* `"type": "flight"` **(required)**
* `"methodology": "US-EPA"` **(required)**
* `"methodology_version"`: EPA Hub year (e.g., `"2024"`). **Optional**; if omitted → **latest supported year**.
* `"external_reference"`: Correlates request/response (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"`).
* Multi-leg itineraries: use **`routing`** (hyphen-separated airports) instead of `origin`/`destination` — see [**Flight: Routing (multi-leg)**](/api-calculations-request-response/travel/flight/flight-routing.md).
* `"distance_in_km"`: If provided, **overrides** origin/destination resolution (not used as the routed total when **`routing`** is set; see Flight: Routing).
* `"sustainable_fuels"`: Indicates SAF usage (reduces emissions in SQUAKE; not part of EPA factors).
* `"carbon_reduction_percentage_of_total"`: Fraction `0–1` applied when `sustainable_fuels` is used (**default:** `0`).
* `"audit"`: boolean (optional). Set to `true` to create immutable audit records for finalized calculations. Must be enabled for your account.

> Notes: EPA provides mode-level factors; aircraft-specific parameters (type, booking class, RFI) are not part of EPA Hub factors.

***

### **Sample API Response**

```json
{
  "carbon_quantity": 625550,
  "carbon_unit": "gram",
  "items": [
    {
      "carbon_quantity": 625550,
      "carbon_unit": "gram",
      "external_reference": "test_1",
      "type": "flight",
      "methodology": "US-EPA",
      "methodology_version": "2024",
      "distance": 5964.0,
      "distance_unit": "kilometer"
    }
  ]
}
```

***

### **Versions**

* **Behavior:** If `methodology_version` is omitted, SQUAKE automatically applies the **latest supported** EPA Hub year. Pin a year for reproducibility and auditability.

***

### **Bibliography**

* **US EPA — GHG Emission Factors Hub**: <https://www.epa.gov/climateleadership/ghg-emission-factors-hub>


---

# 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-epa.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.
