[ Whereis® API Home ] [ JSON API Home ] [ Services ] [ Route Services ]

Use this service to obtain a route, either as a series of points to plot on a map, or as a list of instructions for getting from one point to another. Returns a route from one point to another, optionally passing through one or more waypoints and avoiding one or more avoidpoints.

Each returned route contains a handle - an ID that can be used, within a specified time limit (currently 30 minutes from time of issue), to retrieve route data that may not have been originally requested.

URL

HTTP Post to <ENDPOINT>/service/route

Request format

{
	"mode":<string>,
	"method":<string>,
	"tolls": <Boolean>,
	"imageformat":<string>,
	"waypoints":[<waypoint>, <waypoint>],
	"avoidPoints":[<point>]
}

Rules

Parameter

Mandatory?

Description

mode

Y

Must be one of "VEHICLE" or "FOOT"

method

N

Options are:

  • "FASTEST" - the quickest time
  • "SHORTEST" - the shortest distance 
  • "EASIEST" the least amount of turns
  • "NO_FREEWAYS" - quickest time, but with no freeways
  • "AVOID_FREEWAYS" - quickest time, but with fewer freeways
  • "PREFER_FREEWAYS" - quickest time, but with more freeways
  • "IGNORE_PIPES" - special method that ignores turn restrictions

Default = "FASTEST"

This parameter is ignored in "FOOT" mode.

tolls

N

Default = true

This parameter is ignored in "FOOT" mode.

imageFormat

N

May be one of "PNG", "JPG", "SVG".

If no format is supplied then no image details are returned.

waypoints

N

A list of <waypoint> objects, which may be either a <streetPoint> or a <street> and <centrePoint> pair.

avoidPoints

N

Contains an array of <point> objects, which define locations that the route should not pass through.

Sample request

{
	"mode": "VEHICLE",
	"method": "FASTEST",
	"tolls": "true",
	"imageFormat": "PNG",
	"waypoints": [
		{
			"streetPoint": {
				"lon": 144.95817,
				"lat": -37.81562
			}
		},
		{
			"centrePoint": {
				"lon": 144.97817,
				"lat": -37.81562
			},
			"street": {
				"name": "Lonsdale",
				"type": "St"}
			}
	],
	"avoidPoints":  [
		{
			"lon": 142.45,
			"lat": -36.837
		}
	]
}

Sample response

For a full explanation of the returned route object, see <route>.

<ROUTE>
NOTES

Typically, use a <street> and <centrePoint> when routing to a POI; and a streetPoint if it has been returned in a <geocode>.

Only use a streetPoint if you are certain the point is on a street.

Icon

This request and response use the following objects: