GoClimateNeutral API Reference

Introduction

The GoClimateNeutral API is organized around REST. It has resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

Calculation Model

The GoClimateNeutral API uses IATA-airport codes of a route to calculate the CO2-emissions. You can read more about how the calculation is done here.

Authentication

The GoClimateNeutral API uses API keys to authenticate requests. Get your API key by contacting us.

Authentication to the API is performed via HTTP Basic Auth. Provide your API key as the basic auth username value and leave the password empty. Authentication is required for all endpoints.

Errors

GoClimateNeutral uses conventional HTTP status codes to indicate the success or failure of API requests.

Summary of HTTP status codes used by the GoClimateNeutral API:

Resources

Flight Footprint

Calculates estimated footprint per passenger for flights.

Retrieving flight footprint

Retrieve estimated footprint for one flight. If you need to calculate footprint for a trip with multiple legs, retrieve the estimated footprint for each leg and sum estimated footprint for each to create a total for the full trip.

Endpoint:

GET /v1/flight_footprint

Request parameters:

Response attributes:

Errors:

Example

Request:

$ curl https://api.goclimateneutral.org/v1/flight_footprint \
  -u YOUR_API_KEY: \
  -d 'segments[0][origin]=ARN' \
  -d 'segments[0][destination]=BCN' \
  -d 'segments[1][origin]=BCN' \
  -d 'segments[1][destination]=ARN' \
  -d 'cabin_class=economy' \
  -d 'currencies[]=SEK' \
  -G

Response:

{
  "footprint": 1400,
  "offset_prices": [
    {
      "amount": 4000,
      "currency": "SEK"
    }
  ],
  "details_url": "https://www.goclimateneutral.org/flight_offsets/new?offset_params=economy%2CARN%2CBCN%2CBCN%2CARN"
}