Quick Start

With the Routing service you can calculate routes from A to B taking into account vehicle-specific restrictions, traffic situations, toll or emissions.

Using the Routing API is simple. Follow the steps on this page to get started with routing.

API Endpoint

To get you started we will use the following endpoint, that will calculate a route by specifying a list of waypoints.

https://api.myptv.com/routing/v1/routes
Request

To calculate a route near Luxemburg to Karlsruhe use the waypoints parameter in the request.

You can test this by entering the URL into your web browser (be sure to replace YOUR_API_KEY with your actual API key).

https://api.myptv.com/routing/v1/routes?waypoints=49.62127,6.06479&waypoints=48.999591,8.407974&apiKey=YOUR_API_KEY

Alternatively you can choose one of the following options to send your request. You also have the option to send the API key in the request header.

cURL:
curl --location --request GET "https://api.myptv.com/routing/v1/routes?waypoints=49.62127,6.06479&waypoints=48.999591,8.407974" --header "ApiKey: YOUR_API_KEY"

PowerShell:
$headers = @{"apiKey" = "YOUR_API_KEY"}
$Uri = "https://api.myptv.com/routing/v1/routes?waypoints=49.62127,6.06479&waypoints=48.999591,8.407974"
$response = Invoke-RestMethod -Uri $uri -Method Get -Headers $headers
$response | ConvertTo-Json

Response

Below you will find a possible result list with the distance in meters, the travel time in seconds and whether a valid route was found.

{
	"distance":  241205,
	"travelTime":  12816.696,
	"violated":  false
}