- [HTTP request](https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#body.HTTP_TEMPLATE)
- [Request body](https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#body.request_body)
  - [JSON representation](https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#body.response_body)
  - [JSON representation](https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#body.ComputeScope3FlightEmissionsResponse.SCHEMA_REPRESENTATION)
- [Scope3FlightSegment](https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightSegment)
  - [JSON representation](https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightSegment.SCHEMA_REPRESENTATION)
- [Scope3FlightSegment.CabinClass](https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightSegment.CabinClass)
- [Scope3FlightEmissions](https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightEmissions)
  - [JSON representation](https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightEmissions.SCHEMA_REPRESENTATION)
- [Scope3FlightEmissions.Scope3DataType](https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightEmissions.Scope3DataType)
- [Try it!](https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#try-it)

Retrieves GHG emissions estimates for a set of flight segments for Scope 3 reporting.

The response will contain all entries that match the input `https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightSegment` flight segments, in the same order provided. The estimates will be computed using the following cascading logic (using the first one that is available):

1. TIM-based emissions given `https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightSegment.FIELDS.origin`, `https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightSegment.FIELDS.destination`, `https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightSegment.FIELDS.carrier_code`, `https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightSegment.FIELDS.flight_number`, `https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightSegment.FIELDS.departure_date`, and `https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightSegment.FIELDS.cabin_class`.
2. Typical flight emissions given `https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightSegment.FIELDS.origin`, `https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightSegment.FIELDS.destination`, year in `https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightSegment.FIELDS.departure_date`, and `https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightSegment.FIELDS.cabin_class`.
3. Distance-based emissions calculated using `https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightSegment.FIELDS.distance_km`, year in `https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightSegment.FIELDS.departure_date`, and `https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightSegment.FIELDS.cabin_class`.

If there is a future flight requested in this calendar year, we do not support Tier 1 emissions and will fallback to Tier 2 or 3 emissions. If the requested future flight is in not in this calendar year, we will return an empty response. We recommend that for future flights, `https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeFlightEmissions#google.travel.sustainability.travelimpactmodel.v1.TravelImpactModelService.ComputeFlightEmissions` API is used instead.

If there are no estimates available for a certain flight with any of the three methods, the response will return a `https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightEmissions` object with empty emission fields. The request will still be considered successful. Generally, missing emissions estimates occur when the flight is unknown to the server (e.g. no specific flight exists, or typical flight emissions are not available for the requested pair).

The request will fail with an `INVALID_ARGUMENT` error if:

- The request contains more than 1,000 flight legs.
- The input flight leg is missing one or more identifiers. For example, missing origin/destination without a valid distance for `https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightEmissions.Scope3DataType.ENUM_VALUES.TIM_EMISSIONS` or `https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightEmissions.Scope3DataType.ENUM_VALUES.TYPICAL_FLIGHT_EMISSIONS` type matching, or missing distance for a `https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightEmissions.Scope3DataType.ENUM_VALUES.DISTANCE_BASED_EMISSIONS` type matching (if you want to fallback to distance-based emissions or want a distance-based emissions estimate, you need to specify a distance).
- The flight date is before 2019 (Scope 3 data is only available for 2019 and after).
- The flight distance is 0 or lower.
- Missing cabin class.

Because the request is processed with fallback logic, it is possible that misconfigured requests return valid emissions estimates using fallback methods. For example, if a request has the wrong flight number but specifies the origin and destination, the request will still succeed, but the returned emissions will be based solely on the typical flight emissions. Similarly, if a request is missing the origin for a typical flight emissions request, but specifies a valid distance, the request could succeed based solely on the distance-based emissions. Consequently, one should check the source of the returned emissions (`https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightEmissions.FIELDS.source`) to confirm the results are as expected.

### HTTP request

`POST https://travelimpactmodel.googleapis.com/v1/flights:computeScope3FlightEmissions`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "flights": [ { object (`https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightSegment`) } ], "modelVersion": { object (`https://developers.google.com/travel/impact-model/docs/reference/rest/v1/ModelVersion`) } } ``` |

| Fields ||
|---|---|
| `flights[]` | ``object (`https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightSegment`)`` Required. Flights to return emission estimates for. |
| `modelVersion` | ``object (`https://developers.google.com/travel/impact-model/docs/reference/rest/v1/ModelVersion`)`` Optional. The model version under which emission estimates for all flights in this request were computed. |

### Response body

A list of flights with Scope 3 emission estimates.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "flightEmissions": [ { object (`https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightEmissions`) } ], "modelVersion": { object (`https://developers.google.com/travel/impact-model/docs/reference/rest/v1/ModelVersion`) } } ``` |

| Fields ||
|---|---|
| `flightEmissions[]` | ``object (`https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightEmissions`)`` List of flight segments with emission estimates. |
| `modelVersion` | ``object (`https://developers.google.com/travel/impact-model/docs/reference/rest/v1/ModelVersion`)`` The model version under which emission estimates for all flights in this response were computed. |

## Scope3FlightSegment

Flight parameters with which the Scope 3 emissions are fetched.

| JSON representation |
|---|
| ``` { "departureDate": { object (`https://developers.google.com/travel/impact-model/docs/reference/rest/v1/Date`) }, "cabinClass": enum (`https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightSegment.CabinClass`), "origin": string, "destination": string, "carrierCode": string, "flightNumber": integer, "distanceKm": string } ``` |

| Fields ||
|---|---|
| `departureDate` | ``object (`https://developers.google.com/travel/impact-model/docs/reference/rest/v1/Date`)`` Required. Date of the flight in the time zone of the origin airport. Only year is required for typical flight and distance-based emissions models (month and day values are ignored and therefore, can be either omitted, set to 0, or set to a valid date for those cases). Correspondingly, if a specific date is not provided for TIM emissions, we will fallback to typical flight (or distance-based) emissions. |
| `cabinClass` | ``enum (`https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightSegment.CabinClass`)`` Required. The cabin class of the flight. |
| `origin` | `string` Optional. 3-character [IATA airport code](https://www.iata.org/en/publications/directories/code-search/) for flight origin, e.g. `YVR`. This is used to match specific flight if provided alongside destination, carrier, and flight number. If there is no match, we will first try to match the flight to a typical flight between the provided origin and destination airports. Otherwise, we will use the distance-based emissions model if the flight distance is provided. |
| `destination` | `string` Optional. 3-character [IATA airport code](https://www.iata.org/en/publications/directories/code-search/) for flight destination, e.g. `ICN`. This is used to match specific flight if provided alongside origin, carrier, and flight number. If there is no match, we will first try to match the flight to a typical flight between the provided origin and destination airports. Otherwise, we will use the distance-based emissions model if the flight distance is provided. |
| `carrierCode` | `string` Optional. 2-character [IATA carrier code](https://www.iata.org/en/publications/directories/code-search/), e.g. `KE`. This is required if specific flight matching is desired. Otherwise, this is unused for typical flight and distance-based emissions models. This could be both operating and marketing carrier code (i.e. codeshare is covered). |
| `flightNumber` | `integer` Optional. Up to 4-digit [flight number](https://en.wikipedia.org/wiki/Flight_number), e.g. `71`, from \[1, 9999\]. This is first used to match a specific flight if a flight number is specified alongside origin, destination, and carrier. If a flight number is not specified, we will first try to match the flight to a typical flight between the provided origin and destination airports. If that fails and/or origin \& destination are not provided, we will use the distance-based emissions model based on the flight distance provided. |
| `distanceKm` | `string (https://developers.google.com/discovery/v1/type-format format)` Optional. Distance in kilometers, e.g. `2423`, from \[`1`, `1e12`) km. This is used to match a flight to distance-based emissions when origin and destination are not provided or there are no matching typical flights. |

## Scope3FlightSegment.CabinClass

The cabin class of the flight.

| Enums ||
|---|---|
| `CABIN_CLASS_UNSPECIFIED` | Unspecified cabin class. |
| `ECONOMY` | Economy class. |
| `PREMIUM_ECONOMY` | Premium economy class. |
| `BUSINESS` | Business class. |
| `FIRST` | First class. |

## Scope3FlightEmissions

Scope 3 flight with emission estimates.

| JSON representation |
|---|
| ``` { "flight": { object (`https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightSegment`) }, "wtwEmissionsGramsPerPax": string, "ttwEmissionsGramsPerPax": string, "wttEmissionsGramsPerPax": string, "source": enum (`https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightEmissions.Scope3DataType`), "modelVersion": string } ``` |

| Fields ||
|---|---|
| `flight` | ``object (`https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightSegment`)`` Identifier. Matches the flight identifiers in the request. |
| `wtwEmissionsGramsPerPax` | `string (https://developers.google.com/discovery/v1/type-format format)` Optional. Total flight emissions (sum of well-to-tank and tank-to-wake) per passenger based on the requested info. This is the total emissions and unless you have specific reasons for using TTW or WTT emissions, you should use this number. |
| `ttwEmissionsGramsPerPax` | `string (https://developers.google.com/discovery/v1/type-format format)` Optional. Tank-to-wake flight emissions per passenger based on the requested info. |
| `wttEmissionsGramsPerPax` | `string (https://developers.google.com/discovery/v1/type-format format)` Optional. Well-to-tank flight emissions per passenger based on the requested info. |
| `source` | ``enum (`https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeScope3FlightEmissions#Scope3FlightEmissions.Scope3DataType`)`` Optional. The source of the emissions data. |
| `modelVersion` | `string` Optional. The model version under which the emissions were computed. |

## Scope3FlightEmissions.Scope3DataType

The type of matching used to compute Scope 3 emissions. This is used for the Scope 3 response, marking which of the methods was used to compute the emissions.

| Enums ||
|---|---|
| `SCOPE3_DATA_TYPE_UNSPECIFIED` | Unspecified data type. |
| `TIM_EMISSIONS` | TIM-based emissions given origin, destination, carrier, flight number, departure date, and year. |
| `TYPICAL_FLIGHT_EMISSIONS` | Typical flight emissions given origin, destination, and year. |
| `DISTANCE_BASED_EMISSIONS` | Distance-based emissions based on the distance traveled and year. |