[Developer platform](/en-us/developers)

# Routing, toll and emissions

Send a vehicle and coordinates. Get the route, the toll and the emissions in one response, without saving a trip.

**Runs on:** The routing engine set on your platform (PTV by default; PTV Developer, HERE, Google and OSRM are supported) with Transportial's emission calculation on top. POST /routing/calculate/route uses the in-house multi-modal engine.

| Endpoint                            | Permission              | What it does                                                      |
| ----------------------------------- | ----------------------- | ----------------------------------------------------------------- |
| POST /route/calculate:georeferences | calculate:route         | One route through coordinates, in the order given.                |
| POST /route/calculate:alternatives  | calculate:route         | Alternatives for the same stops, compared on toll and CO2.        |
| POST /routing/calculate/route       | calculate:routing:route | The in-house engine for road, rail, inland waterway, sea and air. |

Base URL `https://api.app.transportial.com/api`. Send `x-api-key` and `x-api-secret`, from an API access integration holding the permission above. Note that a missing permission answers 401 and missing authentication answers 403.

## One call instead of three

A route calculation returns distance, driving time and geometry, plus toll per country and system when the engine prices toll, plus well-to-wheel and tank-to-wheel emissions. dangerousGoods and tunnelRestrictionCode add ADR restrictions.

## What the emission figures are

With PTV Developer the figures are the engine's ISO 14083 values. With other engines they are estimates from the distance, fuel type and Euro class. Send vehicle.fuelType, because without it those estimates are 0.

## Example

### Rotterdam to Amsterdam for a Euro 6 diesel

Coordinates in driving order; the departure time defaults to now.

Call

```
curl -X POST "https://api.app.transportial.com/api/route/calculate:georeferences" \
  -H "x-api-key: $TRANSPORTIAL_KEY" \
  -H "x-api-secret: $TRANSPORTIAL_SECRET" \
  -H "Content-Type: application/json" \
  -d @request.json
```

request.json

```
{
  "vehicle": { "fuelType": "diesel", "emissionStandard": "euro6" },
  "geoReferences": [
    { "type": "latLonPointGeoReference", "lat": 51.9244, "lon": 4.4777 },
    { "type": "latLonPointGeoReference", "lat": 52.3676, "lon": 4.9041 }
  ]
}
```

Response

```
{
  "success": true,
  "route": {
    "time": 0,
    "distance": 0,
    "lineString": "...",
    "toll": { "engine": "...", "currency": "EUR", "total": 0, "approximated": false, "countries": [] },
    "additionalInfo": { "CO2eWTW": 0, "CO2eTTW": 0, "emissionReport": { "standard": "...", "basis": "...", "totalTtwKg": 0, "totalWtwKg": 0, "legs": [] } }
  }
}
```

Response shape only; the values depend on your engine and input.

## Limits worth knowing

* toll is empty when the engine does not price toll.
* POST /routing/calculate/route falls back to a straight line for rail and barge where no network graph is loaded.
* Calls to a paid routing engine use your platform's engine configuration.

## Questions

Is the route saved?

No. These endpoints only calculate. Save a route with POST /route if you want to keep it.

[Create a developer account](https://portal.otms.transportial.com/auth/developer/register)[Read the guide](https://docs.transportial.com/examples/route-toll-emissions)[How it works](/en-us/blog/truck-route-toll-emissions-api)

---
Canonical page: https://transportial.com/en-us/developers/algorithms/routing-and-cost
