Donate using PayPal

CycleStreets API (v1)

  • Details for:
  • API overview
  • Obtain API key
  • Usage policy
  • Uptime policy

Cycle routing - plan leisure (circular) route

This API call plans a circular, leisure-orientated route [example] which starts and finishes at the same points. An example use case is of a user with two hours to spare and would like ideas for a ride.

This type of routing is only available by arrangement. You must contact us before using this API call. Unauthorised implementations are at the risk of termination of an API key. This API call is normally a charged-for option, but we may make exceptions for community projects.

They are planned based on a suggested distance or duration, though currently the actual distance or duration of the suggested route will only be a rather rough approximation to that requested.

Preferred types of points of interest can be specified so that the route will favour these where possible.

For leisure routes, the CycleStreets planner tries eight routes in different directions around the start point. The quietest of these eight routes is returned as the result, but the other results are also available and can be presented to the end user.

The following is based on: Icon a two-hour leisure route from Buckingham Palace.

https://www.cyclestreets.net/api/journey.json?key=registeredapikey&plan=leisure&itinerarypoints=-0.14009,51.50202,Buckingham+Palace&duration=7200

(Legacy support for XML is also available using .xml rather than .json.)

Leisure routing - required parameters

key string
Your registered API key
plan string
The value: leisure.
itinerarypoints Starting waypoint: longitude,latitude or longitude,latitude,name
There must only be one waypoint; the name is optional.
distance integer ≥ 1000
The rough target distance (in metres) for the leisure route. Either distance or duration must be specified.
duration integer ≥ 300
The rough target duration (in seconds) for the leisure route. Either distance or duration must be specified.
poitypes string
A comma separated list of POI types, e.g. cafes,pubs. Leisure routes will tend to find routes through these POI types, if they are available.

Return values

The response is based on the same layout as A-B journey requests. However, in addition:

Initial part of response

otherRoutes string
A comma separated list of the leisure routes found, which can be some or all of: leisure1,leisure2,leisure3,leisure4,leisure5,leisure6,leisure7,leisure8. These can be used as the plan argument to retrieve a particular one of the (up to) eight routes that were previously generated.

POI

These contain points of interest, POIs (if found) near to the requested waypoints.

longitude float
Longitude of the resolved POI
latitude float
Latitude of the resolved POI
sequenceId tinyint
Index for the POI corresponding to the waypoint, starting from 1.
poitypeId string
The POI type key name.
name string
Name of the POI.
website string
Any link for the POI.

Example for POIs section of response:

poi: [
	{
		@attributes: {
			poitypeId: "parks",
			name: "Waterlow Park",
			website: "",
			longitude: "-0.14573",
			latitude: "51.57023",
			sequenceId: "2"
		}
	},
	{
		@attributes: {
			poitypeId: "parks",
			name: "Jack Cornwall Park",
			website: "",
			longitude: "-0.01238",
			latitude: "51.56915",
			sequenceId: "3"
		}
	},
	{
		@attributes: {
			poitypeId: "parks",
			name: "Robin Hood Gardens",
			website: "",
			longitude: "-0.00834",
			latitude: "51.50969",
			sequenceId: "4"
		}
	}
]
		

We welcome your feedback, especially to report bugs or give us route feedback.

My comments relate to: *






Your comments: *
URL of page: * https://kingslynn.cyclestreets.net/api/v1/leisure/
How did you find out about CycleStreets?:
Your name:
Our ref: Please leave blank - anti-spam measure

* Items marked with an asterisk [*] are required fields and must be fully completed.