Flights Trip Emissions API


picture

Path to flights emission calculator

POST https://api.earthonly.io/api/v1/emissions/flights

Authentication

All requests to EarthOnly servers requires an API key which you can set in the request headers like the example below.

Authentication Headers

{
	"eo-api-key" : "eb57f933ebbc42139c0a65813c2763b2"
}
Get your API Key access by requesting access to EarthOnly Partner Platform at 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

After a successfull Status 200 you get the following response

Example 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.


EarthOnly Logo
EarthOnly is your partner in achieving sustainability of our Earth through its impactful technological interventions.
Contact Us:
203, 2-A/3, Kundan Mansion, Asaf Ali Rd, New Delhi,
Delhi, India - 110002
© 2023 Earthonly. All rights reserved.