EcoTransIT World REST-Api (2025stable2.2.2)

Rate limit

Please Note: this Api uses rate limits: max. 100 requests/second and max 7 simultaneous connections are allowed!
Exceeding the rate limit will result in a http 429 error ("too many requests")

Authorization

EcoTransIT Rest Api uses the "Authorization Code Flow" for Authentication.
In the Header of your Api request set the authorization to Bearer followed by an access_token (see below how to get the token) like in the following curl request:

curl -X POST https://customer-name.ecotransit.org/etw-rest/calculateTransport \
     -H 'Content-Type: application/json' \
     -H 'Authorization: Bearer xxx-some-example-access-token-yyy' \
     -d '{"key": "value"}'

Authentication Server to get the access token from: https://customer-name.ecotransit.org/auth/realms/ETW/protocol/openid-connect/token

Get Access Token

Please visit get Access Token and provide username and password as given to you by the EcoTransIT staff.
After successful login you will r./eceive an access token and a refresh token. Use this access token as bearer token in your calculateTransport request (see first code snippet in Authorization section)
Please note that the access token expires after a while. You can use the refresh token to get a new access token, like in the following curl request.

curl -X POST https://customer-name.ecotransit.org/auth/realms/ETW/protocol/openid-connect/token \
     -H "Content-Type: application/x-www-form-urlencoded" \
     -d "client_id=webservice-rest" \
     -d "client_secret=<my-client-secret>" \
     -d "grant_type=refresh_token" \
     -d "refresh_token=<my-refresh-token>"

⚠️ Warning: Store the refresh token at a safe place as it contains sensitive information!!

OpenId Endpoint Overview

An overview of the OpenId Endpoint Overview of the authorization server can be found here

Download OpenAPI description
Languages
Servers
Mock server
https://rest-api.ecotransit.world/_mock/apis/openapi/
https://customer-name.ecotransit.org/

calculateTransport

calculate Emissions for specified Transport

Operations

Info

get general Information about the api

Operations