Train: REM (Rail Emissions Model)
Calculate train emissions with REM, an operator- and country-aware rail methodology that resolves an emission factor per passenger-kilometre through a tiered resolver and multiplies it by distance and passenger count.
This page is aligned to the REM methodology (integration and Calculation API payloads). Use "methodology": "REM" in all new integrations. If you omit methodology on a train item, the API uses your client's configured train default.
Overview
REM selects an emission factor (grams COβe per passenger-kilometre) with a deterministic tiered resolver, then multiplies it by distance and passenger count.
Send operator_name, ISO country codes, departure_date and energy_scope when you have them: they improve tier matching and make results easier to audit.
Factor resolution (tiers)
REM applies this order:
- Tier 1, operator-reported: used when
operator_namematches operator-specific factors for the requestedenergy_scope,train_typeand, when needed,fuel_typeand year. - Tier 2, operator-reported mix: used when
operator_namematches an operator-specific energy mix for the requestedenergy_scope,train_typeand, when needed,fuel_typeand year. - Tier 3, country-published: uses country-level methodology data when Tier 1 and Tier 2 don't apply and a country context is available (see Country context).
- Tier 4, activity-based: uses fuel, traction mix and electricity carbon intensity data for the country or region when Tier 3 doesn't yield a factor.
- Tier 5, global constant: well-to-wheel global rail averages (IEA-based constants), with a pre/post cut-off driven by
departure_datewhen present.
Country context
For Tiers 3 and 4, the resolver uses origin_country if set, otherwise destination_country (both optional). Values should be ISO 3166-1 alpha-2 (for example DE, SE). The API accepts other resolvable country inputs and normalises them to alpha-2 where possible (for example UK β GB). If neither country field is available, Tier 1 and Tier 2 may still apply; otherwise resolution falls through toward Tier 5.
Distance handling
After validation, you must provide one of:
originanddestination, resolved to a route distance;distance_in_km, a positive number;route_coords, an array of at least two[longitude, latitude]pairs (WGS84). Longitude must be in [-180, 180], latitude in [-90, 90].
Precedence: if distance_in_km is set together with origin and destination, distance_in_km is used for the calculation distance.
Corrections:
- If you send
route_coords, the API computes a border-aware path distance (per-country segments, train-type detour factor from REM data). That total becomes the distance used for emissions; no additional "air distance" correction is applied on top. - If you send
distance_in_kmwithoutroute_coords, REM uses it exactly as sent and applies no detour factor. - If you send only
originanddestination, REM estimates the rail route distance from the straight-line distance between them and the train-type detour factor from REM data. - For audit and debugging, expanded item metadata may include a
border_distance_breakdownwhenroute_coordswere used (sequential segments and totals per ISO alpha-3 country). If some segments can't be attributed to a country, a warning may be present.
Sample requests
Send a quote before booking, then repeat the call with audit set to true once the booking is final. The body is otherwise identical. The third example uses route_coords instead of origin and destination: when route_coords is valid, origin and destination aren't required for distance validation.
{
"expand": ["items"],
"items": [{
"audit": false,
"type": "train",
"external_reference": "test_1",
"origin": "Stockholm",
"destination": "Malmo",
"number_of_travelers": 1,
"train_type": "high_speed",
"seat_type": "second_class",
"fuel_type": "electricity",
"operator_name": "sj",
"methodology": "REM",
"departure_date": "2025-06-15",
"origin_country": "SE",
"destination_country": "SE",
"energy_scope": "wtw"
}]
}audit_for is optional
Pass the ID of an auditable entity when you calculate on behalf of that entity. Otherwise, leave it out.
Defaults
| Field | Default | Applies when |
|---|---|---|
methodology | Your client's configured train default | No methodology is sent on a train item |
number_of_travelers | 1 | No number_of_travelers is sent |
train_type | average | No train_type is sent |
fuel_type | diesel | No fuel_type is sent |
seat_type | average | No seat_type is sent |
energy_scope | wtw | No energy_scope is sent |
Request fields
typestringrequiredtrain
methodologystringREM. If omitted, the API uses your client's configured train default.
external_referencestringUnique ID for the item in the request, to map results to inputs. Up to 128 characters.
number_of_travelersintegerInteger β₯ 1. Defaults to 1.
originstringLocation string as in other train methodologies: addresses, IATA/ICAO, UN/LOCODE, coordinates, UIC/provider codes. See Origin and destination formats. Required unless you send distance_in_km or valid route_coords.
destinationstringSame formats and rules as origin.
distance_in_kmnumberIf provided together with origin and destination, this value wins. REM uses it exactly as sent, with no detour factor.
route_coordsarrayArray of [lon, lat] pairs, minimum 2 points. Each pair must have exactly two numbers. Used for border-aware distance and the detour factor.
train_typeenumOne of average, high_speed, intercity, regional, long_distance, commuter, tram, metro, light_rail, urban_rail. Defaults to average.
fuel_typeenumdiesel, electricity, hvo, hydrogen. Defaults to diesel. Used for Tier 1 and Tier 2 disambiguation when an operator has multiple fuel rows, and for Tier 3 and Tier 4 modelling where applicable.
seat_typeenumaverage, first_class or second_class. Defaults to average.
operator_namestringEnables Tier 1 or Tier 2 when the operator exists in the REM operator database. Contact product@squake.earth for the full list of currently supported operators.
departure_datestringISO 8601 calendar date only, YYYY-MM-DD (not a full timestamp). Used to select year-matched factors. If invalid, the API returns: Departure date '<value>' is not a valid ISO-8601 date.
origin_countrystringISO 3166-1 alpha-2 recommended (for example DE, FR). Other resolvable country strings may be accepted and normalised to alpha-2. Invalid codes return a parameter error. For country-based tiers, origin_country is preferred over destination_country when both are set.
destination_countrystringSame formats and rules as origin_country.
energy_scopeenumwtw (well-to-wheel, default) or ttw (tank-to-wheel). Invalid values return an error listing allowed scopes.
auditbooleanSet to true to create immutable audit records. The feature must be enabled for your account.
POST /v2/calculations in the API referenceOrigin and destination formats
SQUAKE tries to resolve origin and destination whatever their format. Ideally, use:
- Addresses: Post/standard postal format.
- Airports: IATA/ICAO (
^[A-Z]{3,4}$, for exampleMUC). - Ports and trade locations: UN/LOCODE (
^[A-Z]{2}\W?[A-Z2-9]{3}$, for exampleDEHAM). - Coordinates:
^[-+]?\d{1,3}\.\d{1,10}\s?,\s?[-+]?\d{1,3}\.\d{1,10}$(for example"+40.712,-74.006").
UIC and provider codes
Invalid or unsupported codes may trigger a fallback to more generic (non-journey-specific) factors.
Send <provider>:<uic_code>, for example sncf:FRAAA. Possible provider prefixes: uic, uic8_sncf, sncf, sncf_tvs, entur, db, busbud, distribusion, flixbus, cff, leoexpress, obb, trenitalia, trenitalia_rtvt, trenord, ntv_rtiv, ntv, hkx, renfe, atoc, benerail, westbahn.
// Illustrative
{
"type": "train",
"methodology": "REM",
"origin": "entur:7400001",
"destination": "entur:7400046",
"operator_name": "sj",
"number_of_travelers": 1
}Distance and fallback
- If you send both
origin/destinationanddistance_in_km, SQUAKE usesdistance_in_km. - Unresolvable locations produce validation errors or methodology fallbacks as described for train generally.
Sample response
When you expand items, each train item may include algorithm_specifics describing the resolved REM tier and matched metadata (for example tier, energy_scope, gco2e_per_pax_km, year_matched, country_matched, operator_matched, source_links and resolver details). The exact shape follows the live API.
{
"carbon_quantity": 261,
"carbon_unit": "gram",
"items": [{
"carbon_quantity": 261,
"carbon_unit": "gram",
"external_reference": "test_1",
"type": "train",
"methodology": "REM",
"distance": 616.0,
"distance_unit": "kilometer",
"algorithm_specifics": {
"tier": 1,
"energy_scope": "wtw",
"gco2e_per_pax_km": "0.42",
"year_matched": 2024,
"country_matched": "se",
"operator_matched": "sj",
"source_links": [],
"methodology": "operator_reported"
}
}]
}Field formatting
The numeric and string formatting of algorithm_specifics fields matches the production API. Treat gco2e_per_pax_km as a decimal string or number per the response schema.
White paper
- SQUAKE: Rail Emissions Model Whitepaper.
- REM: Rail Emissions Model.