Entur Developer
Open
REST
Emissions Calculator

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 | null · 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, or send null, the API calculates the distance along the roads.

Point

A coordinate in WGS84 (EPSG:4326). x is the longitude and y is the latitude.
x
​number · double · min: -180 · max: 180 · required
y
​number · double · min: -90 · max: 90 · required

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.
​array | null
stopIds
​array | null

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. METRO is one MX3000 trainset on the Oslo subway, and METRO_TWO_TRAINSETS is two coupled MX3000 trainsets. If you do not know the length of the train, use METRO_TWO_TRAINSETS.

CalculationModel

name
​string · required

The model that calculated the emission. SMEC is the SINTEF energy module. SINTEF_EMISSION_FACTORS is a set of fixed emission factors from SINTEF for each passenger kilometre, which the API uses for bike, electrical bike and electrical scooter. The API can get more models in the future, so a client must accept values that it does not know.

Example: SMEC
versionCode
​integer | null · int64 · required

The version of the model. For SMEC, it is the version code that the SINTEF energy module gave for the calculation, the same value as versionCode in the response from SINTEF. It can be null if the SINTEF energy module does not give a version. For SINTEF_EMISSION_FACTORS, it is the version of the set of factors that the API uses. Entur increases it when a factor changes. For a train trip with more than one leg, the value is null if the legs have different versions. Then each leg in legs has its own version.

Example: 9

CalculationSummary

numberOfVehicles
​integer · int32 · required

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

co2eEmissionInGrams
​string · decimal · pattern: ^-?\d+(\.\d+)?$ · required

The total CO2e emission for all passengers in grams. The value is a decimal number in a string, so that a client that reads JSON numbers as floating point numbers does not lose digits.

Example: 1739.564818547628
​CalculationModel · required

The model that calculated the emission.

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.

EmissionsResponse

​TransportModeCalculation[] · required
warnings
​string[] · required
​TransportModeCalculationFailure[] · required
​ResponseMetadata · required

Information about the response as a whole.

ResponseMetadata

source
​string · required

The organisation that makes the results available. Credit it when you use or show the results. «Terms of use» in the API description gives the attribution text that NLOD requires.

Example: Entur AS

SintefCalculation

A part of the response from the SINTEF energy module. The response has more fields than this schema shows.
versionCode
​integer | null · int64

The version of the SINTEF energy module that made the calculation. The value changes when SINTEF changes the model.

Example: 10
​SintefSource | null
​SintefResults | null

SintefEmission

The emission in grams.
tailpipeG
​number | null · double

SintefEmissions

The emission of one vehicle on the route.

The emission in grams for each part of the lifecycle of the vehicle.

​SintefEmission | null

The emission in grams.

SintefLifecycleEmission

The emission in grams for each part of the lifecycle of the vehicle.
tailpipeG
​number | null · double
vehicleManufacturingG
​number | null · double
vehicleMaintenanceG
​number | null · double
fuelProductionG
​number | null · double
totalLifecycleG
​number | null · double

SintefResults

travelTimeS
​number | null · double

The travel time in seconds.

routeLengthKm
​number | null · double

The length of the route in kilometres.

averageSpeedKmH
​number | null · double

The average speed in kilometres each hour.

​SintefEmissions | null

The emission of one vehicle on the route.

SintefSource

vehicleId
​string | null

The SINTEF vehicle that the calculation uses.

Example: web:train-type-75

TrainLeg

vehicleId
​string · required

The SINTEF vehicle that the calculation for the leg uses.

Example: web:train-type-93
co2eEmissionInGrams
​string · decimal · pattern: ^-?\d+(\.\d+)?$ · required

The CO2e emission of the leg in grams. The value is a decimal number in a string, so that a client that reads JSON numbers as floating point numbers does not lose digits.

Example: 1739.564818547628
​CalculationModel · required

The model that calculated the leg.

​SintefCalculation · required

The response from the SINTEF energy module for the leg, without changes. The emissions are for one train set, not for the passengers in the request. The emission of the passengers on the leg is co2eEmissionInGrams. A sum over the legs is for one train set on each leg. The schema shows only the fields that clients use most. The response has more fields.

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.

TransportModeCalculation

transportMode
​string · required

The transport mode of the calculation. It is one of the transport modes in the request. The API can get more transport modes in the future, so a client must accept values that it does not know.

Example: TRAIN
​CalculationSummary · required
​SintefCalculation | null

The response from the SINTEF energy module, without changes. The emissions are for one vehicle, not for the passengers in the request. The emission for the request is calculationSummary.co2eEmissionInGrams. The schema shows only the fields that clients use most. The response has more fields. The value is null for bike, electrical bike and electrical scooter. It is also null for a train trip with more than one leg. Then each leg in legs has its own response.

​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.

TransportModeCalculationFailure

transportMode
​string · required

The transport mode of the calculation. It is one of the transport modes in the request. The API can get more transport modes in the future, so a client must accept values that it does not know.

Example: TRAIN
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?