Path to flights emission calculator
POST https://api.earthonly.io/api/v1/emissions/flights
Authentication
Authentication Headers
{
"eo-api-key" : "eb57f933ebbc42139c0a65813c2763b2"
}
hello@earthonly.io Request Schema
Example Request body
{
"routes":["JFK-LHR"],
"trip_type":"Round Trip",
"trip_class":"Economy",
"seat_count":1
}
Parameters
routes : string[] required An array of routes represented by their IATA codes. For example:
For the route between John F Kennedey International Airport,New York & London Heathrow Airport you would provide as route such as [JFK-LHR], represented by their IATA Codes. If you have multiple flights in a single route, you push more flights in the route such as,"routes" : ["JFK-LHR", "LHR-THF"]
This represents a flight, going as New York -> London -> Berlin
trip_type: enum: ["One Way" , "Round Trip"] required Represent the trip type where it is a One Way trip or a Round Trip.
trip_class: enum: ["Economy",Premium Economy","Business","First"] required Representing the service class of a flight travel.
seat_count: number required The number of passengers hauling a particular flight.
Response Schema
200 you get the following responseExample Response body
{
"total_CO2":"632.00", //Co2 in Kgs
"from_city":"NEW YORK",
"to_city":"LONDON",
"trip_class":"Economy",
"seat_count":1
},
Attributes
total_CO2 : number Represents the emission calculator result in Kgs. In this case the result is 632.00 Kgs of CO2 emissions in the flight taken
from_city: string Represents the starting point of the trip.
to_city: string Represents the ending point of the trip.
trip_class: string Represents the trip_class as provided in the input.
seat_count: number The number of passengers hauling a particular flight.