Calculate emissions with the API

Learn how emissions are calculated, create an API key with write permissions, search for appropriate emission factors, and use the API endpoint /calculate for up to 100 calculation options per request.

Calculations are billed by Calculation Option. Learn more about our how to Find your billing model.

Preparation

First, familiarize yourself with how we Calculate emissions.

Create an API Key

Open the developer menu in the dashboard and navigate to the API Keys section. Click on Add New API Keys. To calculate emissions, your API keys need write permissions.

Important: Store the secret key securely and never share it with third parties!

Find Suitable Emission Factors

Search for the appropriate emission factors in our database. You can submit up to 100 calculation options per request to our API.

Make an API Request

Use the endpoint /calculate to calculate the emissions.

Good to know: You can also use our PHP Library or Node.js Library to interact with the API.

Options

Calculation Options

Pass the calculation_options you have defined to the API. You can calculate up to 100 calculation_options simultaneously.

Fractional Digits

By default, we round the calculated emissions to the nearest kilogram. If you want a more precise calculation, you can use the fractional_digits parameter to define the maximum number of decimal places returned.

Example

In this example, we calculate the emissions for a trip from Berlin to Munich.

POSThttps://api.klimapi.com/v2/calculate

1
2
3
4
5
6
7
8
9
10
11
12
13
{
    "calculation_options": [
        {
            "type": "travel-land",
            "activity": "cars_by_size",
            "specification": "small_car",
            "detail": "average",
            "departure": "Berlin, Germany",
            "destination": "Munich, Germany"
        }
    ],
    "fractional_digits": 2
}

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
    "kgCO2e": 71.23,
    "calculation_id": "CALC-0000-00000000",
    "results": [
        {
            "type": "travel-land",
            "activity": "cars_by_size",
            "specification": "small_car",
            "detail": "average",
            "value": 586,
            "departure": "Berlin, Germany",
            "destination": "Munich, Germany",
            "kgCO2e": 71.23
        }
    ]
}

No credit card required - Create an account now

Create an account and start calculating and offsetting the CO2 emissions directly via our API. Do you still have questions or need a customized offer? Use the chat or make an appointment directly with our sales team.