Travel
In addition to direct calculation of emissions per passenger-kilometer, passenger-mile, tonne-kilometer or ton-mile, Climatiq makes endpoints available for calculating emissions based on departure and arrival airports. The API will automatically select an appropriate emission factor; a specific ID can be selected to override this.
Flights
POST Calculate total estimated emissions produced by passenger flights between the specified airports
https://beta4.api.climatiq.io/travel/flights
Request
The following parameters can be defined as JSON-encoded object in a body.
Attribute | Required |
---|---|
legs array An array of one or more legs in a flight | required |
Flight legs
are the constituent elements of a given flight from one location to another; e.g. a flight from Berlin to New York JFK might require 2 legs
of Berlin to Amsterdam and Amsterdam to New York JFK
Leg Attributes | Required | Default |
---|---|---|
from string Start of flight leg, expressed in an IATA code (opens in a new tab) | required | |
to string End of flight leg, expressed in an IATA code (opens in a new tab) | required | |
passengers int How many passengers are on the flight? | optional | 1 |
class string Which class the flight was on. Allowed values are unknown , economy , business , first | optional | unknown |
emission_factor Selector This endpoint will automatically pick the highest emission factor which is eligible for the flight. If you want to override the automatic emission factor selection you can provide a selector. You are then fully responsible for emission factor selection. The selector must end up selecting an emission factor that supports the PassengerOverDistance unit. | optional |
# First class trip from Berlin to Amsterdam for two passengers.# Followed by a trip from Amsterdam to New York JFK for two passengers in economy class.curl --request POST \ --url https://beta4.api.climatiq.io/travel/flights \ --header 'Authorization: Bearer API_KEY' \ --data '{ "legs": [ { "from": "BER", "to": "AMS", "passengers": 2, "class": "first" }, { "from": "AMS", "to": "JFK", "passengers": 2, "class": "economy" } ] }'
Response
The response includes the total emissions for the trip in kgCO2e
, and the emissions for each leg of the trip.
Attribute |
---|
co2e number Total carbon dioxide equivalent for entire trip. |
co2e_unit string The unit in which the co2e field is expressed. |
legs [Estimations] List of estimations, one for each leg in the trip. These are returned in the same order as the flight legs. |
{ "co2e": 1367.0136226777042, "co2e_unit": "kg", "legs": [ { "co2e": 172.05228286000002, "co2e_unit": "kg", "co2e_calculation_method": "ar4", "co2e_calculation_origin": "source", "emission_factor": { "name": "International flight - RF effect unknown", "activity_id": "passenger_flight-route_type_international-aircraft_type_na-distance_na-class_na-rf_na", "id": "0887b1b9-a42c-442e-ab4d-499e6a7d882f", "access_type": "public", "source": "UBA", "source_dataset": "ProBas", "year": 2020, "region": "DE", "category": "Air Travel", "source_lca_activity": "upstream-fuel_combustion", "data_quality_flags": [] }, "constituent_gases": { "co2e_total": 172.05228286000002, "co2e_other": null, "co2": null, "ch4": null, "n2o": null }, "activity_data": { "activity_value": 1186.5674680000002, "activity_unit": "passenger-km" }, "audit_trail": "enabled" }, { "co2e": 1194.9613398177041, "co2e_unit": "kg", "co2e_calculation_method": "ar6", "co2e_calculation_origin": "climatiq", "emission_factor": { "name": "Air Travel - Long haul (>= 2300 miles) - RF effect unknown", "activity_id": "passenger_flight-route_type_na-aircraft_type_na-distance_gt_2300mi-class_na-rf_na", "id": "468e56b4-fe65-4a2f-9739-103f2fe58239", "access_type": "public", "source": "EPA", "source_dataset": "GHG Emission Factors Hub", "year": 2022, "region": "US", "category": "Air Travel", "source_lca_activity": "use_phase", "data_quality_flags": [ "notable_methodological_variance" ] }, "constituent_gases": { "co2e_total": null, "co2e_other": null, "co2": 1184.5152235991807, "ch4": 0.004360178737174898, "n2o": 0.03778821572218245 }, "activity_data": { "activity_value": 7266.964561958163, "activity_unit": "passenger-mile" }, "audit_trail": "enabled" } ]}