Entur Developer
Emissions Calculator

TransportMode

string · enum
Enum values:
TRAIN
ELECTRICAL_CAR
DIESEL_CAR
MOTORCYCLE
PLANE
ELECTRICAL_BUS
DIESEL_BUS
METRO

The SINTEF energy module calculates the emission for all transport modes, but not for BIKE, ELECTRICAL_BIKE and ELECTRICAL_SCOOTER. For these three, the API uses a fixed factor from SINTEF for each passenger kilometre.

Route

The route of the trip, as waypoints or as stop IDs. A stop ID can identify a stop place, a quay or a group of stop places. If the route has waypoints, the API uses only the waypoints and ignores the stop IDs. Then the route must have two or more waypoints, and each waypoint must have x and y. If the route has no waypoints, the API uses the stop IDs. Then the route must have two or more stop IDs.
​Point[]
stopIds
​string[]
anyOf
At least one variant must match. Multiple variants may match simultaneously.

Decision Table

VariantMatching Criteria
requires: waypoints
requires: stopIds
Properties for Variant 1:
Waypoints
waypoints
​minItems: 2 · required

Point

A coordinate in WGS84 (EPSG:4326). x is the longitude and y is the latitude.
x
​number · double · required
y
​number · double · required
z
​number · double

EmissionsRequest

transportModes
​TransportMode[] · minItems: 1 · required
Enum values:
TRAIN
ELECTRICAL_CAR
DIESEL_CAR
MOTORCYCLE
PLANE
ELECTRICAL_BUS
DIESEL_BUS
METRO
​Route · required

The route of the trip, as waypoints or as stop IDs. A stop ID can identify a stop place, a quay or a group of stop places.

If the route has waypoints, the API uses only the waypoints and ignores the stop IDs. Then the route must have two or more waypoints, and each waypoint must have x and y. If the route has no waypoints, the API uses the stop IDs. Then the route must have two or more stop IDs.

numberOfPassengers
​integer · int32 · min: 1 · required
distanceKm
​number · double

The distance of the trip in kilometres. The API uses this distance for bike, electrical bike and electrical scooter. If you do not send it, the API calculates the distance along the roads.

EmissionsResponse

​TransportModeCalculation[] · required
warnings
​string[] · required
Enum values:
UNSUPPORTED_TRANSPORT_MODES_OMITTED_FROM_CALCULATIONS
​TransportModeCalculationFailure[] · required

TransportModeCalculation

transportMode
​TransportMode · enum · required

The SINTEF energy module calculates the emission for all transport modes, but not for BIKE, ELECTRICAL_BIKE and ELECTRICAL_SCOOTER. For these three, the API uses a fixed factor from SINTEF for each passenger kilometre.

Enum values:
TRAIN
ELECTRICAL_CAR
DIESEL_CAR
MOTORCYCLE
PLANE
ELECTRICAL_BUS
DIESEL_BUS
METRO
​CalculationSummary · required
​object | null

The response from the SINTEF energy module, without changes. The value is null for bike, electrical bike and electrical scooter. It is also null for a train trip with more than one leg.

​array | null

The parts of a train trip. Each leg uses one train type, for example an electric train or a diesel train. If the full trip uses one train type, there is one leg, and detailedSintefCalculations also has a value. The value is null for all transport modes other than TRAIN.

TrainLeg

vehicleId
​string · required

The SINTEF vehicle that the calculation for the leg uses.

Example: web:train-type-93
co2eEmissionInGrams
​string · required

The CO2e emission of the leg in grams. The value is a string, to keep full precision.

trainLine
​string | null

The diesel line of the leg. The value is null if the leg uses an electric train.

Example: NORDLANDSBANEN
distanceKm
​number | null · double

The length of the leg in kilometres. The value is null if the SINTEF energy module does not give a length.

CalculationSummary

numberOfVehicles
​integer · int32 · required

The number of vehicles that are necessary for all the passengers.

co2eEmissionInGrams
​string · required

The total CO2e emission for all passengers in grams. The value is a string, to keep full precision.

distanceKm
​number | null · double

The length of the route in kilometres. The value is null if the SINTEF energy module does not give a length.

TransportModeCalculationFailure

transportMode
​TransportMode · enum · required

The SINTEF energy module calculates the emission for all transport modes, but not for BIKE, ELECTRICAL_BIKE and ELECTRICAL_SCOOTER. For these three, the API uses a fixed factor from SINTEF for each passenger kilometre.

Enum values:
TRAIN
ELECTRICAL_CAR
DIESEL_CAR
MOTORCYCLE
PLANE
ELECTRICAL_BUS
DIESEL_BUS
METRO
reason
​string · required

The cause of the failure, as text for a person to read. Use it in logs. Do not compare it with a fixed value, because the text can change.

Problem

An error response as described by RFC 9457. All errors from the endpoint use this format.
type
​string · uri · required

Identifies the type of error. Errors from the API have their own URI. The URI only identifies the type of error: it does not open a page. For other errors, the value is about:blank.

Example: https://api.entur.io/emissions-calculator-api/problems/unknown-stop-place
title
​string · required

For errors from the API, a code for the type of error, for example unknown_stop_place. For other errors, the HTTP status text.

Example: unknown_stop_place
status
​integer · int32 · required

The HTTP status code.

Example: 400
instance
​string · uri · required

Identifies this occurrence of the error with the correlation ID of the request. If the correlation ID is a UUID, the value is urn:uuid:<correlation ID>. If not, the value is urn:correlation-id:<correlation ID>. Give this value when you contact Entur about the error.

Example: urn:uuid:3f2b8c1e-6d4a-4b7e-9a1f-2c5d8e7b6a90
detail
​string

An explanation of this occurrence of the error, as text for a person to read.

Did you find what you were looking for?