Developers (json api)

Basic Query

Geocode

Get details of a parking garage

Get details of a meter

Try the API

 

 

Basic query

http://divvapi.parkshark.nl/apitest.jsp?action=plan&to_lat=51.5&to_lon=4.9&dd=28&mm=12&yy=2013&h=12&m=50&dur=2&opt_routes=y&opt_routes_ret=n&opt_am=n&opt_rec=y

Alternative (rest)

http://divvapi.parkshark.nl/rest/plan?to_lat=51.5&to_lon=4.9&dd=28&mm=12&yy=2013&h=12&m=50&dur=2&opt_routes=y&opt_routes_ret=n&opt_am=n&opt_rec=y

http://divvapi.parkshark.nl/rest/plan/calback?to_lat=51.5&to_lon=4.9&dd=28&mm=12&yy=2013&h=12&m=50&dur=2&opt_routes=y&opt_routes_ret=n&opt_am=n&opt_rec=y

Will return costs and recommendations for visiting marco polo straat on the 28 december 2013 and staying for 3 hs

It will use 51.5 x 4.9 as your geolocation and look only for machines accepting cash and pin

        
Parmeters :

	to_lat			:	latitude of destination		(51.4)
	to_lon			: 	longitude of destination	(4.9)
	dd			: 	day		(28)
	mm			: 	month	(12)
	yy			:	year	(2013)
	h			:	hour	(12)
	m			:	minutes	(50)
	dur			:	Duration in hours (2)
	opt_am			:	Include the full list of meters	(y/n)
	opt_routes_ret		:	Also calculate the return routes (y/n)
	opt_otp_timout		:	OpenTripPlanner timeour (milliseconds)
	opt_rec			:	return recommendations (y/n)
	plan_radius		:	Create rout plan only if within a radius in meters
	opt_garagecount		:	Maximum amount of garages to include in results
	opt_metercount		:	Maximum amount of meters to include in results
	opt_maxresults		:	Maximum results in total to include in results


Example result	

{
	result: {
		_executiontime: 13855,
		isInPaidParkingAmsterdam: "y",	/* is this location within the paid parking zones of amsterdam (y/n) */
		timings: [
			"after prv : 114",
			"after plan : 13855"
		],
		reccommendations: [
			/* Array of :
				[ recommendations] 
			*/

			{
				"dist_in_meters":78787,		/* distance from your destination in meters (as the crow flies) */
				"cost":-1,			/* cost of parking in Euro or -1 if it cannot be calculated */
				"name" : "Olympic Statuim"	/* Name of location */
				"automat_number":"",		/* the unique number appearing on a parking meter */
				"address":"De entree 7",	/* street address */
				"lat":52.3109973,		/* latitude */
				"lon":4.9391216,		/* longitude */
				"i":0,				/* internal counter refering back to list of meters */
				"match" : 1,			/* this is always  or above and it for internal use */
				"type":"garage",		/* on street meter / or garage */
				"expected_occupancy":"",	/* as a percentage */
				"garage_type" : "park-and-ride",/* parking-garage or park-and-ride
				"notes" : ""			/* notes */
				"garage_opening_hours" : "0-5 0000 0000 0000 0000|6 0700 0700 2200 2200",	
								/* days open_in open_out close_in close_out */
								/* there can be multiple broken by a | */
								/* days can be 0-5 or 5 or 1,2 */
				"garage_opening_hours_today" : "0000 0000 0000 0000",
								/* opening hours on the day being planned */
				"garage_opening_hours_today_json" : "{"open_in":"0000","open_out":"0000","close_in":"0000","close_out":"0000"}",						
				"garage_owner" : "",		/* owner URL */
				"garage_infourl" : "",		/* information URL */
				"garage_includes_public_transport" : "n",		
								/* do you get a free public transport card included  y/n */
				
				"csdkid" : "test.divv.parking.car.36", 	/* citysdk id */
				"csdkurl" : "http://test-api.citysdk.waag.org/test.divv.parking.car.36", 	
								/* citysdk direct URL */
				"ams_pr_fare" : "1-5 04:00 10:00 8 24 | 1-5 10:00 04:00 1 24 | 6-0 0:00 0:00 1 24",
								/* amsterdam park and ride format */
								
				
				"reccommended_pt_route":{	/* recommended public transport route  as legs returned from open trip planner*/
					"status":0,
					"distance":123727,	/* in meters, calculated along the travel route */
					"duration":11151,	/* duration in seconds */
					"cost":-1,		/* cost of travel is -1 if it cannot be calculated */
					"src":"",		/* */
					"url":"",		/* */
					"legs":[
						{
							"from":{
								/* Place format */
								"lat":52.31098914608117,
								"lon":4.939129283393896,
								"name":"De Entree",
								"street":"",
								"postcode":"",
								"url":"",
								"type":"",
								"rawdata":"",
								"cdk_id":""		/* city sdk node id if appropriate */
							},
							"to":{
								/* Place format */
							}
							"mode":"WALKING",		/* modes are WALKING, TRAM, TRAIN, METRO, FERRY */
							"transitinfo":{
								/* information returned frmo open trip planner */
								"@class":"com.glimworm.opendata.divvamsterdamapi.planning.transit.xsd.TransitInfoWalk",
								"agency":"null",	/* for example GVB or NS or 
								"line":"",		/* for example 33 for bus line 33 */
								"lineId":"null",	/* for example 33 for line 33 */
								"headsign":"null",	/* Amsterdam CS on the front of a bus */
								"polyline":"{\"levels\":null,\"length\":19,\"points\":\"s~g~Hotc]c@eBf@c@FKOo@[mAsAoFj@k@|BqBEOaCwJKY]yAGSMg@g@wBAM?ODM\"}",
											/* polyline can be represented on a google map */
								"from":{
									/* Place format */
								},
								"to":{
									/* Place format */
								}
								"startTime":{
									/* MMDateTime format */
									"day":12,
									"month":12,
									"year":2013,
									"hour":7,
									"minute":47
								},
								"endTime":{
								},
								"type":"leg"
							},{
							. . . many more legs . . . 
							}
						],
						"type":"",
						"startTime":"2013-12-12T07:47:09.000+01:00",
						"endTime":"2013-12-12T10:53:00.000+01:00",
						"_executiontime":3148
					},
					"reccommended_pt_route_return":{
						/* same format at the pt_route but for the return journey */
					}
				}
			},
			meters : [
			{
				/* array of parking meters */
				"i":2313,
				"match":1,
				"dist":787873,			/* distance from your end destination in meters */
				"onmap":false,			/* */
				"lat":52.3109973,		/* latitude */
				"lon":4.9391216,		/* longitude */
				"cost":-1,			/* total cost or -1 if it cannot be calculated */
				"totalcost":-1,			/* total cost or -1 if it cannot be calculated */
				"max":0,			/* maximum allowed parking time in minutes */
				"isInNorth":false,		/* true if is in amsterdam north */
				"bw":{
					"cash":true,		/* accepts cash */
					"creditcard":true,	/* accepts creditcard */
					"pin":true,		/* accepts pin */
					"chip":true		/* accepts chipknip */
				},
				"costs":{
					/* basic cost info */
				},
				"csdkid":"",	/* citysdk node id if found */
				"csdkzone":"",	/* city sdk tariff zone */
				"expected_occupancy":"",	
				"entityid":"",
				"stadsdeel":"",
				"belnummer":"",
				"adres":"",
				"postcode":"",
				"woonplaats":"",
				"typeautomaat":"",
				"betaalwijze":"",
				"status":"",
				"tariefcode":"",
				"type":"garage",			/* types : on-street-meter , garage */
				"costsignature":""
				}, {
					. . .  more meters . . .
				}
			]
		]
	


        

 

 

 

Looking up a geocode

http://divvapi.parkshark.nl/apitest.jsp?action=geocode&addr=Marco+Polostraat+107+%2C+Amsterdam%2C+Netherlands

Alternative (rest)

http://divvapi.parkshark.nl/rest/geocode?addr=Marco+Polostraat+107+%2C+Amsterdam%2C+Netherlands

Will return details of the geocoded responses from mapquest

{
		result: {
			_executiontime: 1332,
			timings: [ ],
			places: [
			{
			lat: 52.368007,
			lon: 4.85601,
			name: "",
			street: "Marco Polostraat 107",
			postcode: "1057 BM",
			url: "http://open.mapquestapi.com/staticmap/v4/getmap?key=Fmjtd|luubn16829,bw=o5-90asgw&type=map&size=225,160&pois=purple-1,52.3680074236842,4.85600957894737,0,0|¢er=52.3680074236842,4.85600957894737&zoom=15&rand=-62158057",
type: "s",
			rawdata: "{"latLng":{"lng":4.85601,"lat":52.368007},"adminArea4":"Stadsregio Amsterdam","adminArea5Type":"City","adminArea4Type":"County","adminArea5":"Amsterdam","street":"Marco Polostraat 107","adminArea1":"NL","adminArea3":"North Holland","type":"s","displayLatLng":{"lng":4.85601,"lat":52.368007},"linkId":0,"postalCode":"1057 BM","dragPoint":false,"sideOfStreet":"N","adminArea1Type":"Country","geocodeQuality":"POINT","geocodeQualityCode":"P1XXX","adminArea3Type":"State","mapUrl":"http://open.mapquestapi.com/staticmap/v4/getmap?key=Fmjtd|luubn16829,bw=o5-90asgw&type=map&size=225,160&pois=purple-1,52.3680074236842,4.85600957894737,0,0|¢er=52.3680074236842,4.85600957894737&zoom=15&rand=-62158057"}",
			cdk_id: "",
			data: {
				map: [
				[
					"latLng",
					{
						map: [
						[
							"lng",
							4.85601
						],
						[
							"lat",
							52.368007
						]
						]
					}
				],
				[
					"adminArea4",
					"Stadsregio Amsterdam"
				],
				[
					"adminArea5Type",
					"City"
				],
				[
					"adminArea4Type",
					"County"
				],
				[
					"adminArea5",
					"Amsterdam"
				],
				[
					"street",
					"Marco Polostraat 107"
				],
				[
					"adminArea1",
					"NL"
				],
				[
					"adminArea3",
					"North Holland"
				],
				[
					"type",
					"s"
				],
				[
					"displayLatLng",
					{
					map: [
						[
							"lng",
							4.85601
						],
						[
							"lat",
							52.368007
						]
					]
					}
				],
				[
					"linkId",
					0
				],
				[
					"postalCode",
					"1057 BM"
				],
				[
					"dragPoint",
					false
				],
				[
					"sideOfStreet",
					"N"
				],
				[
					"adminArea1Type",
					"Country"
				],
				[
					"geocodeQuality",
					"POINT"
				],
				[
					"geocodeQualityCode",
					"P1XXX"
				],
				[
					"adminArea3Type",
					"State"
				],
				[
				"mapUrl",
				"http://open.mapquestapi.com/staticmap/v4/getmap?key=Fmjtd|luubn16829,bw=o5-90asgw&type=map&size=225,160&pois=purple-1,52.3680074236842,4.85600957894737,0,0|¢er=52.3680074236842,4.85600957894737&zoom=15&rand=-62158057"
				]
				]
				}
			}
			]
			}
}
        

 

 

Details of one garage

http://divvapi.parkshark.nl/apitest.jsp?action=get-garage-by-id&id=27

Alternative (rest)

p>

http://divvapi.parkshark.nl/rest/get-garage-by-id/27

http://divvapi.parkshark.nl/rest/get-garage-by-id/27/callback?callback=myvariable

Will return details of the garage as imported into the api from the citysdk

Try the API

		{
		result: {
		_executiontime: 2,
		timings: [ ],
		garage: {
			lat: 52.3440266,
			lon: 4.8539215,
			name: "Olympisch Stadion",
			street: "",
			postcode: "1076DE",
			url: "http://www.p1.nl/parkeren/parkeergarage-olympisch-stadion/",
			type: "parking-garage",
			rawdata: "",
			cdk_id: "test.divv.parking.car.23",
			places: 0,
			owner: "P1 Parkeergarage Olympisch Stadion",
			remarks: "",
			capacity: 0,
					price_day: 50,
			free_minutes: 0,
			opening_times: [
			{
				dayOfWeek: 0,
				open_in: "0000",
				open_out: "0000",
				close_in: "0000",
				close_out: "0000"
			},
			{
				dayOfWeek: 1,
				open_in: "0000",
				open_out: "0000",
				close_in: "0000",
				close_out: "0000"
			},
			{
				dayOfWeek: 2,
				open_in: "0000",
				open_out: "0000",
				close_in: "0000",
				close_out: "0000"
			},
			{
				dayOfWeek: 3,
				open_in: "0000",
				open_out: "0000",
				close_in: "0000",
				close_out: "0000"
			},
			{
				dayOfWeek: 4,
				open_in: "0000",
				open_out: "0000",
				close_in: "0000",
				close_out: "0000"
			},
			{
				dayOfWeek: 5,
				open_in: "0000",
				open_out: "0000",
				close_in: "0000",
				close_out: "0000"
			},
			{
				dayOfWeek: 6,
				open_in: "0000",
				open_out: "0000",
				close_in: "0000",
				close_out: "0000"
			}],
			opening_times_raw: "0-6 0000 0000 0000 0000",
			time_unit_minutes: 9,
			price_per_time_unit: 0.5,
			includes_public_transport: "n",
			calc_type: "garage",
			csdkid: "test.divv.parking.car.23",
			csdkurl: "http://test-api.citysdk.waag.org/test.divv.parking.car.23",
			ams_pr_fare: "1-5 04:00 10:00 8 24 | 1-5 10:00 04:00 1 24 | 6-0 0:00 0:00 1 24",
			ams_pr_fares: [{
				dayOfWeek_start: 1,
				dayOfWeek_end: 5,
				entry_start: 4,
				entry_end: 10,
				price_day: 8
			},{
				dayOfWeek_start: 1,
				dayOfWeek_end: 5,
				entry_start: 0,
				entry_end: 10,
				price_day: 1
			},{
				dayOfWeek_start: 1,
				dayOfWeek_end: 5,
				entry_start: 4,
				entry_end: 24,
				price_day: 1
			},{
				dayOfWeek_start: 6,
				dayOfWeek_end: 6,
				entry_start: 0,
				entry_end: 24,
				price_day: 1
			},{
				dayOfWeek_start: 0,
				dayOfWeek_end: 0,
				entry_start: 0,
				entry_end: 24,
				price_day: 1
			}]
		}}}        
        

 

 

Details of one garage

http://divvapi.parkshark.nl/apitest.jsp?action=get-meter-by-automat-number&id=11328

Alternative (rest)

p>

http://divvapi.parkshark.nl/rest/get-meter-by-automat-number/27

http://divvapi.parkshark.nl/rest/get-meter-by-automat-number/27/callback?callback=myvariable

Will return details of the meter as imported into the api from the citysdk

{
		result: {
		_executiontime: 3,
		timings: [ ],
		meter: {
			i: 355,
			match: 0,
			dist: 0,
			onmap: false,
			lat: 52.3762398,
			lon: 4.91645,
			cost: 0,
			totalcost: 0,
			max: 0,
			isInNorth: false,
			bw: {
				cash: false,
				creditcard: true,
				pin: true,
				chip: true
			},
			costs: {
				geb_code: "G1",
				days: [
				{
					start: 12,
					end: 24
				},
				{
					start: 9,
					end: 24
				},
				{
					start: 9,
					end: 24
				},
				{
					start: 9,
					end: 24
				},
				{
					start: 9,
					end: 24
				},
				{
					start: 9,
					end: 24
				},
				{
					start: 9,
					end: 24
				}
				],
				t_code: "TZ13",
				first: {
					combination: "n",
					price: 0,
					hrs: 0,
					price2: 0,
					hrs2: 0
				},
				cost: 3,
				max: 0,
				maxdaycost: 0,
				error: 0
			},
			csdkid: "",
			csdkzone: "test.divv.parking.zone.13",
			csdkurl: "",
			expected_occupancy: "",
			name: "",
			entityid: "1328",
			stadsdeel: "Centrum",
			belnummer: "11328",
			adres: "Dijksgracht 6",
			postcode: "1019 BS",
			woonplaats: "Amsterdam",
			typeautomaat: "CWT",
			betaalwijze: "5",
			status: "OP",
			tariefcode: "3",
			type: "on-street-meter",
			costsignature: "",
			garageid: -1
		}
		}
}
        

 

Data Sources

Garages from citySDK

http://test-api.citysdk.waag.org/nodes?layer=test.divv.parking.car.price&geom
http://test-api.citysdk.waag.org/nodes?layer=test.divv.parking.car&geom

Parking chances from citySDK

http://test-api.citysdk.waag.org/test.divv.parking.zone.10?layer=test.divv.parking.zone.chance

Zone information from citySDK

http://test-api.citysdk.waag.org/nodes?layer=test.divv.parking.zone.*&per_page=1000
http://test-api.citysdk.waag.org/nodes?lon=4.850185219599298&lat=52.355662948327264&layer=test.divv.parking.zone&radius=10&per_page=10
http://test-api.citysdk.waag.org/nodes?layer=test.divv.parking.zone.*&per_page=1000&geom
http://test-api.citysdk.waag.org/nodes?layer=test.divv.parking.zone.*&per_page=1000

Calculations from ParkShark

http://api.parkshark.nl

Code Hosted on Github

https://github.com/jonathanrcarter/divv-amsterdam-parkingapi

Hosted and supported by Glimworm

http://www.glimworm.com/

Based on research done commissioned by divv

https://github.com/DIVV-Amsterdam/DIVV-multi-modal-api-report
http://jon651.glimworm.com/divvamsterdam/DIVV-multi-modal-api-report/php/example/planning/plan.php?go=y&from=52.083266%2C4.878896%2CAnjerstraat+3%2C+Woerden&to=52.359798%2C4.884206%2CRijksmuseum&opt_startWithCar=y&date=2013-12-17&time=14%3A30&hour=14&minute=30&timex=3000