Method: flights.computeFlightEmissions

Stay organized with collections Save and categorize content based on your preferences.

Stateless method to retrieve emission estimates. Details on how emission estimates are computed: 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 syntax.

Request body

The request body contains data with the following structure:

JSON representation
{
  "flights": [
    {
      object (Flight)
    }
  ]
}
Fields
flights[]

object (Flight)

Required. Direct flights to return emission estimates for.

Response body

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

Output definition for the [flights.computeFlightEmissions][google.travel.sustainability.travelimpactmodel.v1.ComputeFlightEmissions] response.

JSON representation
{
  "flightEmissions": [
    {
      object (FlightWithEmissions)
    }
  ],
  "modelVersion": {
    object (ModelVersion)
  }
}
Fields
flightEmissions[]

object (FlightWithEmissions)

List of flight legs with emission estimates.

modelVersion

object (ModelVersion)

The model version under which emission estimates for all flights in this response were computed.

Flight

All details related to a single request item for a direct flight emission estimates.

JSON representation
{
  "origin": string,
  "destination": string,
  "operatingCarrierCode": string,
  "flightNumber": integer,
  "departureDate": {
    object (Date)
  }
}
Fields
origin

string

Required. IATA airport code for flight origin, e.g. "LHR".

destination

string

Required. IATA airport code for flight destination, e.g. "JFK".

operatingCarrierCode

string

Required. IATA carrier code, e.g. "AA".

flightNumber

integer

Required. Flight number, e.g. 324.

departureDate

object (Date)

Required. Date of the flight in the time zone of the origin airport. Must be a date in the present or future.

Date

Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following:

  • A full date, with non-zero year, month, and day values.
  • A month and day, with a zero year (for example, an anniversary).
  • A year on its own, with a zero month and a zero day.
  • A year and month, with a zero day (for example, a credit card expiration date).

Related types:

JSON representation
{
  "year": integer,
  "month": integer,
  "day": integer
}
Fields
year

integer

Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.

month

integer

Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.

day

integer

Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.

FlightWithEmissions

Direct flight with emission estimates.

JSON representation
{
  "flight": {
    object (Flight)
  },
  "emissionsGramsPerPax": {
    object (EmissionsGramsPerPax)
  }
}
Fields
flight

object (Flight)

Required. Matches the flight identifiers in the request. Note: all IATA codes are capitalized.

emissionsGramsPerPax

object (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 [flights.computeFlightEmissions][google.travel.sustainability.travelimpactmodel.v1.ComputeFlightEmissions].

EmissionsGramsPerPax

Grouped emissions per seating class results.

JSON representation
{
  "first": integer,
  "business": integer,
  "premiumEconomy": integer,
  "economy": integer
}
Fields
first

integer

Emissions for one passenger in first class in grams. This field is always computed and populated, regardless of whether the aircraft has first class seats or not.

business

integer

Emissions for one passenger in business class in grams. This field is always computed and populated, regardless of whether the aircraft has business class seats or not.

premiumEconomy

integer

Emissions for one passenger in premium economy class in grams. This field is always computed and populated, regardless of whether the aircraft has premium economy class seats or not.

economy

integer

Emissions for one passenger in economy class in grams. This field is always computed and populated, regardless of whether the aircraft has economy class seats or not.

ModelVersion

Travel Impact Model version. For more information about the model versioning see https://github.com/google/travel-impact-model/#versioning.

JSON representation
{
  "major": integer,
  "minor": integer,
  "patch": integer,
  "dated": string
}
Fields
major

integer

Major versions: Major changes to methodology (e.g. adding new data sources to the model that lead to major output changes). Such changes will be infrequent and announced well in advance. Might involve API version changes, which will respect guidelines in https://cloud.google.com/endpoints/docs/openapi/versioning-an-api#backwards-incompatible

minor

integer

Minor versions: Changes to the model that, while being consistent across schema versions, change the model parameters or implementation.

patch

integer

Patch versions: Implementation changes meant to address bugs or inaccuracies in the model implementation.

dated

string

Dated versions: Model datasets are recreated with refreshed input data but no change to the algorithms regularly.