Use this API to further personalize the carbon footprint of flight and restaurant transactions based on user feedback on their diet type, info on flights taken etc.

1) Carbon footprint of a flight

Get a hyper-accurate carbon footprint estimation for flights by adding airports, cabin class and trip type.

Example Request

{
  "flightInfo": {
    "airports": {
      "from": "6218b010ba28c21aa5a3ea67",
      "to": "6218b010ba28c21aa5a3ea74"
    },
    "cabinClass": "economy",
    "tripType": "one_way"
  }
}

Example Response

{
    "carbonFootprint": 2085.9853878428353
}

2) Update carbon footprint selecting a category

If a user manually changes the category of a transaction, update the carbon footprint estimation.

Example Request

{
    "categoryId": "60c21ea6e088574facaa4981"
}

Example response

{
    "carbonFootprint": 82.72
}

3) Update carbon footprint by adding diet type

For grocery shopping and restaurants, fine-tune the carbon footprint of a transaction if the user identifies that the transaction has a different diet type than the regular diet type of the user.

Example request

"endUserPreferences": {
      "dietType": "vegan"
}

Example response

{
    "carbonFootprint": 1.56
}

Error responses

{
    "status": 404,
    "message": "Transaction not found."
}

Error transaction ID was not found in the database.

{
    "status": 400,
    "message": "Airports are not supported"
}
{
    "status": 404,
    "message": "Category not found."
}

Bad request error, please check the Airport ID/Category ID and make sure it's a valid Airport/Category ID.

Language
Authorization
Click Try It! to start a request and see the response here!