Skip to content

Commit 9bd9a7b

Browse files
yoshi-automationfeywind
authored andcommitted
feat(travelimpactmodel): update the API
#### travelimpactmodel:v1 The following keys were added: - resources.flights.methods.computeScope3FlightEmissions.description - resources.flights.methods.computeScope3FlightEmissions.flatPath - resources.flights.methods.computeScope3FlightEmissions.httpMethod - resources.flights.methods.computeScope3FlightEmissions.id - resources.flights.methods.computeScope3FlightEmissions.parameterOrder - resources.flights.methods.computeScope3FlightEmissions.path - resources.flights.methods.computeScope3FlightEmissions.request.$ref - resources.flights.methods.computeScope3FlightEmissions.response.$ref - schemas.ComputeScope3FlightEmissionsRequest.description - schemas.ComputeScope3FlightEmissionsRequest.id - schemas.ComputeScope3FlightEmissionsRequest.properties.flights.description - schemas.ComputeScope3FlightEmissionsRequest.properties.flights.items.$ref - schemas.ComputeScope3FlightEmissionsRequest.properties.flights.type - schemas.ComputeScope3FlightEmissionsRequest.properties.modelVersion.$ref - schemas.ComputeScope3FlightEmissionsRequest.properties.modelVersion.description - schemas.ComputeScope3FlightEmissionsRequest.type - schemas.ComputeScope3FlightEmissionsResponse.description - schemas.ComputeScope3FlightEmissionsResponse.id - schemas.ComputeScope3FlightEmissionsResponse.properties.flightEmissions.description - schemas.ComputeScope3FlightEmissionsResponse.properties.flightEmissions.items.$ref - schemas.ComputeScope3FlightEmissionsResponse.properties.flightEmissions.type - schemas.ComputeScope3FlightEmissionsResponse.properties.modelVersion.$ref - schemas.ComputeScope3FlightEmissionsResponse.properties.modelVersion.description - schemas.ComputeScope3FlightEmissionsResponse.type - schemas.Scope3FlightEmissions.description - schemas.Scope3FlightEmissions.id - schemas.Scope3FlightEmissions.properties.flight.$ref - schemas.Scope3FlightEmissions.properties.flight.description - schemas.Scope3FlightEmissions.properties.source.description - schemas.Scope3FlightEmissions.properties.source.enum - schemas.Scope3FlightEmissions.properties.source.enumDescriptions - schemas.Scope3FlightEmissions.properties.source.type - schemas.Scope3FlightEmissions.properties.ttwEmissionsGramsPerPax.description - schemas.Scope3FlightEmissions.properties.ttwEmissionsGramsPerPax.format - schemas.Scope3FlightEmissions.properties.ttwEmissionsGramsPerPax.type - schemas.Scope3FlightEmissions.properties.wttEmissionsGramsPerPax.description - schemas.Scope3FlightEmissions.properties.wttEmissionsGramsPerPax.format - schemas.Scope3FlightEmissions.properties.wttEmissionsGramsPerPax.type - schemas.Scope3FlightEmissions.properties.wtwEmissionsGramsPerPax.description - schemas.Scope3FlightEmissions.properties.wtwEmissionsGramsPerPax.format - schemas.Scope3FlightEmissions.properties.wtwEmissionsGramsPerPax.type - schemas.Scope3FlightEmissions.type - schemas.Scope3FlightSegment.description - schemas.Scope3FlightSegment.id - schemas.Scope3FlightSegment.properties.cabinClass.description - schemas.Scope3FlightSegment.properties.cabinClass.enum - schemas.Scope3FlightSegment.properties.cabinClass.enumDescriptions - schemas.Scope3FlightSegment.properties.cabinClass.type - schemas.Scope3FlightSegment.properties.carrierCode.description - schemas.Scope3FlightSegment.properties.carrierCode.type - schemas.Scope3FlightSegment.properties.departureDate.$ref - schemas.Scope3FlightSegment.properties.departureDate.description - schemas.Scope3FlightSegment.properties.destination.description - schemas.Scope3FlightSegment.properties.destination.type - schemas.Scope3FlightSegment.properties.distanceKm.description - schemas.Scope3FlightSegment.properties.distanceKm.format - schemas.Scope3FlightSegment.properties.distanceKm.type - schemas.Scope3FlightSegment.properties.flightNumber.description - schemas.Scope3FlightSegment.properties.flightNumber.format - schemas.Scope3FlightSegment.properties.flightNumber.type - schemas.Scope3FlightSegment.properties.origin.description - schemas.Scope3FlightSegment.properties.origin.type - schemas.Scope3FlightSegment.type
1 parent f7a757b commit 9bd9a7b

File tree

2 files changed

+391
-1
lines changed

2 files changed

+391
-1
lines changed

discovery/travelimpactmodel-v1.json

Lines changed: 145 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,21 @@
113113
"$ref": "ComputeFlightEmissionsResponse"
114114
}
115115
},
116+
"computeScope3FlightEmissions": {
117+
"description": "Stateless method to retrieve GHG emissions estimates for a set of flight segments for Scope 3 reporting. The response will contain all entries that match the input 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 origin, destination, carrier, flightNumber, departureDate, and cabinClass. 2. Typical flight emissions given origin, destination, year in departureDate, and cabinClass. 3. Distance-based emissions calculated using distanceKm, year in departureDate, and cabinClass. 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, 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 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 TIM_EMISSIONS or TYPICAL_FLIGHT_EMISSIONS type matching, or missing distance for a 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 (source) to confirm the results are as expected.",
118+
"flatPath": "v1/flights:computeScope3FlightEmissions",
119+
"httpMethod": "POST",
120+
"id": "travelimpactmodel.flights.computeScope3FlightEmissions",
121+
"parameterOrder": [],
122+
"parameters": {},
123+
"path": "v1/flights:computeScope3FlightEmissions",
124+
"request": {
125+
"$ref": "ComputeScope3FlightEmissionsRequest"
126+
},
127+
"response": {
128+
"$ref": "ComputeScope3FlightEmissionsResponse"
129+
}
130+
},
116131
"computeTypicalFlightEmissions": {
117132
"description": "Retrieves typical flight emissions estimates between two airports, also known as a market. If there are no estimates available for a certain market, the response will return the market object with empty emission fields. The request will still be considered successful. Details on how the typical emissions estimates are computed are on [GitHub](https://github.com/google/travel-impact-model/blob/main/projects/typical_flight_emissions.md). The request can contain up to 1000 markets. If the request has more than 1000 markets, it will fail with an INVALID_ARGUMENT error.",
118133
"flatPath": "v1/flights:computeTypicalFlightEmissions",
@@ -131,7 +146,7 @@
131146
}
132147
}
133148
},
134-
"revision": "20250624",
149+
"revision": "20251008",
135150
"rootUrl": "https://travelimpactmodel.googleapis.com/",
136151
"schemas": {
137152
"ComputeFlightEmissionsRequest": {
@@ -166,6 +181,42 @@
166181
},
167182
"type": "object"
168183
},
184+
"ComputeScope3FlightEmissionsRequest": {
185+
"description": "A list of flight segments to request the Scope 3 emissions for.",
186+
"id": "ComputeScope3FlightEmissionsRequest",
187+
"properties": {
188+
"flights": {
189+
"description": "Required. Flights to return emission estimates for.",
190+
"items": {
191+
"$ref": "Scope3FlightSegment"
192+
},
193+
"type": "array"
194+
},
195+
"modelVersion": {
196+
"$ref": "ModelVersion",
197+
"description": "Optional. The model version under which emission estimates for all flights in this request were computed."
198+
}
199+
},
200+
"type": "object"
201+
},
202+
"ComputeScope3FlightEmissionsResponse": {
203+
"description": "A list of flights with Scope 3 emission estimates.",
204+
"id": "ComputeScope3FlightEmissionsResponse",
205+
"properties": {
206+
"flightEmissions": {
207+
"description": "List of flight segments with emission estimates.",
208+
"items": {
209+
"$ref": "Scope3FlightEmissions"
210+
},
211+
"type": "array"
212+
},
213+
"modelVersion": {
214+
"$ref": "ModelVersion",
215+
"description": "The model version under which emission estimates for all flights in this response were computed."
216+
}
217+
},
218+
"type": "object"
219+
},
169220
"ComputeTypicalFlightEmissionsRequest": {
170221
"description": "A list of pair of airports (markets) to request the typical emissions for.",
171222
"id": "ComputeTypicalFlightEmissionsRequest",
@@ -389,6 +440,99 @@
389440
},
390441
"type": "object"
391442
},
443+
"Scope3FlightEmissions": {
444+
"description": "Scope 3 flight with emission estimates.",
445+
"id": "Scope3FlightEmissions",
446+
"properties": {
447+
"flight": {
448+
"$ref": "Scope3FlightSegment",
449+
"description": "Required. Matches the flight identifiers in the request."
450+
},
451+
"source": {
452+
"description": "Optional. The source of the emissions data.",
453+
"enum": [
454+
"SCOPE3_DATA_TYPE_UNSPECIFIED",
455+
"TIM_EMISSIONS",
456+
"TYPICAL_FLIGHT_EMISSIONS",
457+
"DISTANCE_BASED_EMISSIONS"
458+
],
459+
"enumDescriptions": [
460+
"Unspecified data type.",
461+
"TIM-based emissions given origin, destination, carrier, flight number, departure date, and year.",
462+
"Typical flight emissions given origin, destination, and year.",
463+
"Distance-based emissions based on the distance traveled and year."
464+
],
465+
"type": "string"
466+
},
467+
"ttwEmissionsGramsPerPax": {
468+
"description": "Optional. Tank-to-wake flight emissions per passenger based on the requested info.",
469+
"format": "int64",
470+
"type": "string"
471+
},
472+
"wttEmissionsGramsPerPax": {
473+
"description": "Optional. Well-to-tank flight emissions per passenger based on the requested info.",
474+
"format": "int64",
475+
"type": "string"
476+
},
477+
"wtwEmissionsGramsPerPax": {
478+
"description": "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.",
479+
"format": "int64",
480+
"type": "string"
481+
}
482+
},
483+
"type": "object"
484+
},
485+
"Scope3FlightSegment": {
486+
"description": "Flight parameters with which the Scope 3 emissions are fetched.",
487+
"id": "Scope3FlightSegment",
488+
"properties": {
489+
"cabinClass": {
490+
"description": "Required. The cabin class of the flight.",
491+
"enum": [
492+
"CABIN_CLASS_UNSPECIFIED",
493+
"ECONOMY",
494+
"PREMIUM_ECONOMY",
495+
"BUSINESS",
496+
"FIRST"
497+
],
498+
"enumDescriptions": [
499+
"Unspecified cabin class.",
500+
"Economy class.",
501+
"Premium economy class.",
502+
"Business class.",
503+
"First class."
504+
],
505+
"type": "string"
506+
},
507+
"carrierCode": {
508+
"description": "Optional. IATA carrier code, 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).",
509+
"type": "string"
510+
},
511+
"departureDate": {
512+
"$ref": "Date",
513+
"description": "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."
514+
},
515+
"destination": {
516+
"description": "Optional. IATA airport code 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.",
517+
"type": "string"
518+
},
519+
"distanceKm": {
520+
"description": "Optional. Distance in kilometers, e.g. `2423`. 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. This field supports values between 0 and 2.5e16 km.",
521+
"format": "int64",
522+
"type": "string"
523+
},
524+
"flightNumber": {
525+
"description": "Optional. Flight number, e.g. `71`. 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.",
526+
"format": "int32",
527+
"type": "integer"
528+
},
529+
"origin": {
530+
"description": "Optional. IATA airport code 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.",
531+
"type": "string"
532+
}
533+
},
534+
"type": "object"
535+
},
392536
"TypicalFlightEmissions": {
393537
"description": "Typical flight emission estimates for a certain market",
394538
"id": "TypicalFlightEmissions",

0 commit comments

Comments
 (0)