Members of the Cloverly team will use the Cloverly API to offset or avoid the carbon impact of their flights when they travel next week to the IATA Airline Industry Retailing Hackathon in Frankfurt, Germany.
To see the documentation of the ability to offset air travel directly with our API, click here. For more details of how it works, read on.
Our flight endpoint calculates the typical fuel burn per passenger on a typical flight of that distance. Thus, the API requests require a distance. But when dealing with flights, people don’t typically talk distance. They talk departure and arrival airports. So we broke down the API to accept IATA airport codes (short codes). An example cURL command of a flight leaving SFO (San Francisco) and arriving at ATL (Atlanta) is below:
Given that there are often connecting flights, we knew the array may be longer. Below is an example of a flight leaving SFO, connecting at ATL, and heading to Frankfurt (FRA):
Thus, in a single command, you could calculate how to offset a round trip from SFO -> ATL -> FRA -> ATL -> SFO:
Getting Excited about Data Structures and API Design
Our tech team got incredibly excited about the array structure for transmitting flight data (so much so that they asked that we include it in our blog). The team at first looked at ways to do “departure” and “arrival” codes, but then suggested multiple API calls for connecting flights. At that point, someone said, “Why not an array?” Everyone agreed that the array data structure provided the easiest, most fluid description of the trip.
Long story short, we nerd out on data structures and API design.
• • •
Carbon-Neutral Shipping with Cloverly
Cloverly provides an easy way for ecommerce consumers to purchase carbon offsets and achieve carbon-neutral shipping for their orders, at no cost to the store owner. For details, visit our How It Works page. Shopify store owners can get our Shopify shipping app by clicking here. For our BigCommerce app, click here. If you have a Magento store, click here.