APG|SGA
infosnowAPI Type 1API Type 2Divers

API Type 2 - Get routing infomation

This endpoint will find the fastest route (it may mean a detour) and the second fastest route (if configured for certain segments) using Dijkstra algorithm.

Routes can be configured to include any type of path objects (lifts, buses, hiking trails, slopes, ...).

For searches on current day, the routing will not only take into account the schedule, but also the state values of transport facilities.

API endpoint

route

Request method

GET

Request headers

-

URL parameters

from

Id of start point (see stop points).

from=2

to

Id of end point (see stop points).

to=3

date

Optional start time of journey (default is now).

date=2022-01-20 15:50

lang

Optional language (default is german).

lang=de|fr|en|it

Response content

main entities

EntityTypeValuesDescription
startDatedatetimeYYYY-MM-DD HH:MMstart date/time of journey
startPointstringany valid valuename of starting point
endPointstringany valid valuename of end point
routes[]arrayrouteslist of found routes
prevDatedatetimeYYYY-MM-DD HH:MMdate/time for previous result page
nextDatedatetimeYYYY-MM-DD HH:MMdate/time for previous result page

routes

EntityTypeValuesDescription
idintany valid valueroute identifier (unique for the current resultset only)
departuretimeHH:MMdeparture time
arrivaltimeHH:MMarrival time
durationintany valid valuetime of travel in minutes
changeOverintany valid valuenumber of change overs
segments[]arraysegmentslist of segments for this journey

segments

EntityTypeValuesDescription
stopPointstringany valid valuename of stop point
departuretimeHH:MMtime of departure
arrivaltimeHH:MMtime of arrival (for last stop point only)
durationintany valid valuetravel time in minutes (not for last stop point)
transportTypeintfacility typestype of transporation facility (not for last stop point)
transportNamestringany valid valuename of transporation facility (not for last stop point)
transportKeystringany valid valueuser key for facility (not for last stop point)
stopOnDemandbooleanany valid valuestop on demand only (not for last stop point)
continuousOperationbooleanany valid valuefacility operates continuously (only available if true)
remarks[]arrayremarksremarks

remarks

EntityTypeValuesDescription
destringany valid valuegerman
frstringany valid valuefrench
enstringany valid valueenglish
itstringany valid valueitalian

Example

{
	"startDate": "2022-01-20 15:50",
	"startPoint": "Betten Talstation, Bahn",
	"endPoint": "Betten Dorf, Talstation H2",
	"routes": [{
		"id": 1,
		"departure": "16:01",
		"arrival": "16:07",
		"duration": 6,
		"changeOver": 0,
		"segments": [{
			"stopPoint": "Betten Talstation, Bahn",
			"departure": "16:01",
			"duration": 1,
			"transportType": 12,
			"transportName": "Fussweg"
		}, {
			"stopPoint": "Betten Talstation, H1",
			"departure": "16:02",
			"duration": 4,
			"transportType": 10,
			"transportName": "Betten Talstation \u2013 Betten Dorf",
			"transportKey": "H1"
		}, {
			"stopPoint": "Betten Dorf, Bergstation H1",
			"departure": "16:06",
			"duration": 1,
			"transportType": 12,
			"transportName": "Fussweg"
		}, {
			"stopPoint": "Betten Dorf, Talstation H2",
			"arrival": "16:07"
		}]
	}, {
		"id": 2,
		"departure": "16:31",
		"arrival": "16:37",
		"duration": 6,
		"changeOver": 0,
		"segments": [{
			"stopPoint": "Betten Talstation, Bahn",
			"departure": "16:31",
			"duration": 1,
			"transportType": 12,
			"transportName": "Fussweg"
		}, {
			"stopPoint": "Betten Talstation, H1",
			"departure": "16:32",
			"duration": 4,
			"transportType": 10,
			"transportName": "Betten Talstation \u2013 Betten Dorf",
			"transportKey": "H1"
		}, {
			"stopPoint": "Betten Dorf, Bergstation H1",
			"departure": "16:36",
			"duration": 1,
			"transportType": 12,
			"transportName": "Fussweg"
		}, {
			"stopPoint": "Betten Dorf, Talstation H2",
			"arrival": "16:37"
		}]
	}, {
		"id": 3,
		"departure": "17:01",
		"arrival": "17:07",
		"duration": 6,
		"changeOver": 0,
		"segments": [{
			"stopPoint": "Betten Talstation, Bahn",
			"departure": "17:01",
			"duration": 1,
			"transportType": 12,
			"transportName": "Fussweg"
		}, {
			"stopPoint": "Betten Talstation, H1",
			"departure": "17:02",
			"duration": 4,
			"transportType": 10,
			"transportName": "Betten Talstation \u2013 Betten Dorf",
			"transportKey": "H1"
		}, {
			"stopPoint": "Betten Dorf, Bergstation H1",
			"departure": "17:06",
			"duration": 1,
			"transportType": 12,
			"transportName": "Fussweg"
		}, {
			"stopPoint": "Betten Dorf, Talstation H2",
			"arrival": "17:07"
		}]
	}, {
		"id": 4,
		"departure": "17:31",
		"arrival": "17:37",
		"duration": 6,
		"changeOver": 0,
		"segments": [{
			"stopPoint": "Betten Talstation, Bahn",
			"departure": "17:31",
			"duration": 1,
			"transportType": 12,
			"transportName": "Fussweg"
		}, {
			"stopPoint": "Betten Talstation, H1",
			"departure": "17:32",
			"duration": 4,
			"transportType": 10,
			"transportName": "Betten Talstation \u2013 Betten Dorf",
			"transportKey": "H1"
		}, {
			"stopPoint": "Betten Dorf, Bergstation H1",
			"departure": "17:36",
			"duration": 1,
			"transportType": 12,
			"transportName": "Fussweg"
		}, {
			"stopPoint": "Betten Dorf, Talstation H2",
			"arrival": "17:37"
		}]
	}, {
		"id": 5,
		"departure": "18:01",
		"arrival": "18:07",
		"duration": 6,
		"changeOver": 0,
		"segments": [{
			"stopPoint": "Betten Talstation, Bahn",
			"departure": "18:01",
			"duration": 1,
			"transportType": 12,
			"transportName": "Fussweg"
		}, {
			"stopPoint": "Betten Talstation, H1",
			"departure": "18:02",
			"duration": 4,
			"transportType": 10,
			"transportName": "Betten Talstation \u2013 Betten Dorf",
			"transportKey": "H1"
		}, {
			"stopPoint": "Betten Dorf, Bergstation H1",
			"departure": "18:06",
			"duration": 1,
			"transportType": 12,
			"transportName": "Fussweg"
		}, {
			"stopPoint": "Betten Dorf, Talstation H2",
			"arrival": "18:07"
		}]
	}],
	"prevDate": "2022-01-20 00:00",
	"nextDate": "2022-01-20 18:01"
}