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

Retrieves emission estimates. Details on how emission estimates are computed are in [GitHub](https://github.com/google/travel-impact-model).

The response will contain all entries that match the input flight legs, in the same order. If there are no estimates available for a certain flight leg, the response will return the flight leg object with empty emission fields. The request will still be considered successful. Reasons for missing emission estimates include:

- The flight is unknown to the server.
- The input flight leg is missing one or more identifiers.
- The flight date is in the past.
- The aircraft type is not supported by the model.
- Missing seat configuration.

The request can contain up to 1000 flight legs. If the request has more than 1000 direct flights, if will fail with an INVALID_ARGUMENT error.

### HTTP request

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

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/Flight`) } ] } ``` |

| Fields ||
|---|---|
| `flights[]` | ``object (`https://developers.google.com/travel/impact-model/docs/reference/rest/v1/Flight`)`` Required. Direct flights to return emission estimates for. |

### Response body

Output definition for the `https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeFlightEmissions#google.travel.sustainability.travelimpactmodel.v1.TravelImpactModelService.ComputeFlightEmissions` response.

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/computeFlightEmissions#FlightWithEmissions`) } ], "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/computeFlightEmissions#FlightWithEmissions`)`` List of flight legs 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. |

## FlightWithEmissions

Direct flight with emission estimates.

| JSON representation |
|---|
| ``` { "flight": { object (`https://developers.google.com/travel/impact-model/docs/reference/rest/v1/Flight`) }, "source": enum (`https://developers.google.com/travel/impact-model/docs/reference/rest/v1/Source`), "emissionsGramsPerPax": { object (`https://developers.google.com/travel/impact-model/docs/reference/rest/v1/EmissionsGramsPerPax`) }, "easaLabelMetadata": { object (`https://developers.google.com/travel/impact-model/docs/reference/rest/v1/EasaLabelMetadata`) }, "contrailsImpactBucket": enum (`https://developers.google.com/travel/impact-model/docs/reference/rest/v1/ContrailsImpactBucket`) } ``` |

| Fields ||
|---|---|
| `flight` | ``object (`https://developers.google.com/travel/impact-model/docs/reference/rest/v1/Flight`)`` Identifier. Matches the flight identifiers in the request. Note: all IATA codes are capitalized. |
| `source` | ``enum (`https://developers.google.com/travel/impact-model/docs/reference/rest/v1/Source`)`` Optional. The source of the emissions data. |
| `emissionsGramsPerPax` | ``object (`https://developers.google.com/travel/impact-model/docs/reference/rest/v1/EmissionsGramsPerPax`)`` Optional. Per-passenger emission estimate numbers. Will not be present if emissions could not be computed. For the list of reasons why emissions could not be computed, see `https://developers.google.com/travel/impact-model/docs/reference/rest/v1/flights/computeFlightEmissions#google.travel.sustainability.travelimpactmodel.v1.TravelImpactModelService.ComputeFlightEmissions`. |
| `easaLabelMetadata` | ``object (`https://developers.google.com/travel/impact-model/docs/reference/rest/v1/EasaLabelMetadata`)`` Optional. Metadata about the EASA Flight Emissions Label. Only set when the emissions data source is EASA. |
| `contrailsImpactBucket` | ``enum (`https://developers.google.com/travel/impact-model/docs/reference/rest/v1/ContrailsImpactBucket`)`` Optional. The significance of contrails warming impact compared to the total CO2e emissions impact. |