Parking Availability

Service version: 2
Last edit: 2024.02.27
Automotive only

Important note
This API is unavailable on a Freemium or Pay As You Grow (PAYG) basis.
Click the Request Access button above to contact our Sales team.

Purpose

The Parking Availability service provides information about the current availability status of parking sites.

Request data

HTTPS method: GET

For ease of viewing and identification:

  • Constants and parameters enclosed in curly brackets { } must be replaced with their values.
  • Please see the following Request parameters section with the required and optional parameters tables for their values. The generic request format is as follows.

URL format

get
Request URL format
https://{baseURL}/search/{versionNumber}/parkingAvailability.{ext}?key={Your_API_Key}&parkingAvailability={parkingAvailabilityId}

URL example

get
Request URL example
https://api.tomtom.com/search/2/parkingAvailability.json?key={Your_API_Key}&parkingAvailability=00000000-0003-1d9a-0009-20d4467654e2

curl command example

get
Request curl command example
curl 'https://api.tomtom.com/search/2/parkingAvailability.json?key={Your_API_Key}&parkingAvailability=00000000-0003-1d9a-0009-20d4467654e2'

Request parameters

The following table describes the parameters that can be used in a request.

  • Required parameters must be used or the call will fail.
  • Parameters and values are case-sensitive.
  • Optional parameters may be used.

Required parameters

Description

baseURL


string

The base URL for calling the API.


Value: api.tomtom.com

versionNumber


string

The service version.


Value: The current value is 2.

ext


string

The response format of the API request. The valid response format is JSON or XML.


Value: json or xml

key


string

An API Key valid for the requested service.


Value: Your valid API Key.

parkingAvailability


string

The parkingAvailability ID, previously retrieved from the dataSources section at the bottom of the Search response.
Value: Example: 00000000-0003-1d9a-0009-20d4467654e2

Request headers

The following table describes HTTP request headers.

Optional headers

Description

Tracking-ID

Specifies an identifier for the request.

  • It can be used to trace a call.
  • The value must match the regular expression '^[a-zA-Z0-9-]{1,100}$'.

  • An example of the format that matches this regular expression is UUID (e.g., 9ac68072-c7a4-11e8-a8d5-f2801f1b9fd1 ).

  • For details check RFC 4122.

  • If specified, it is replicated in the Tracking-ID response header.

  • It is only meant to be used for support and does not involve tracking of you or your users in any form.

Value: An identifier for the request.

Response data

Response body

If the <ext> parameter value is set to .json, the response will be a JSON object with the following structure:

Response body with the request URL <ext> parameter value set to ".json"
1{
2 "statuses": [
3 {
4 "current": {
5 "emptySpots": 1,
6 "updatedAt": "2021-12-12T11:29:00Z",
7 "available": true,
8 "availabilityTrend": "emptying"
9 }
10 }
11 ],
12 "parkingAvailability": "00000000-0003-1d9a-0009-20d4467654e2"
13}

If the <ext> parameter value is set to .xml, the response will be an XML format with the following structure:

Response body with the request URL <ext> parameter value set to ".xml"
1<response>
2 <parkingAvailability>00000000-0003-1d9a-0009-20d4467654e2</parkingAvailability>
3 <statuses>
4 <item>
5 <current>
6 <emptySpots>1</emptySpots>
7 <updatedAt>2021-12-12T11:29:00Z</updatedAt>
8 <available>true</available>
9 <availabilityTrend>emptying</availabilityTrend>
10 </current>
11 </item>
12 </statuses>
13</response>

Usage and freshness of Parking Availability data

Updates are provided regularly, typically within minutes.

Response fields

The following table describes all of the fields that can appear in a response. Fields are listed by the response section they belong to and in the order that they appear in the response.

Primary fields

Field

Description

parkingAvailability


string

The ID of the returned entity.

statuses


array

A list of parking availability statuses present in this parking site. array of item objects

item object

FieldDescription

current


object

Current state for this Status. current object

current object

FieldDescription

available


boolean

Parking availability status.

emptySpots


integer

Number of available parking spots.

availabilityTrend


string

Prediction on availability.


Available values:

  • static
  • fillingUp
  • emptying

updatedAt


string

The time at which this parking spot data was last updated.


Format: YYYY-MM-DDThh:mm:ssZ ISO_8601

Response codes

Code

Meaning & possible causes

200

OK : If the given parkingAvailability was found, the body of the response will contain the data. Otherwise, the response will contain an empty statuses array in the response body. For example:


Error response example - JSON
1{
2 "statuses": [],
3 "parkingAvailability": "1"
4}

400

Bad request : One or more parameters (e.g., parkingAvailability , ext ) were incorrectly specified or are out of range.

403

Forbidden : Possible causes include:

  • Service requires SSL
  • Not authorized
  • Rate or volume limit exceeded
  • Unknown referer

404

Not Found : The requested resource could not be found, but it may be available again in the future.

405

Method Not Allowed : The client used an HTTP method other than GET.

429

Too Many Requests : The API Key is over QPS (Queries per second).

5xx

Server Error : The service was unable to process your request. Contact support to resolve the issue.

Response headers

The following table lists HTTP response headers of particular interest to Parking Availability service clients.

Header

Description

Access-Control-Allow-Origin

The Parking Availability service allows cross-origin resource sharing.


Value: * This asterisk signifies access to the TomTom API using the Access-Control-Allow-Origin (ACAO) header in its response, indicating which origin sites are allowed.

Content-Encoding

The Parking Availability service supports HTTP compression if requested by the client.


Value: gzip

Cache-Control

The Cache-Control general-header field is used to specify directives that must be obeyed by all caching mechanisms along the request/response chain.

  • Supported by HTTP/1.1 clients.
  • May not be supported by HTTP/1.0 clients.

Value: no-cache

Content-Type

Indicates the format of the response as chosen by the client. Format: type/subtype; charset=utf-8


Value: type/subtype: application/json

Tracking-ID

An identifier for the request. If the Tracking-ID header was specified, it is replicated in the response. Otherwise, it is generated automatically by the service. It is only meant to be used for support and does not involve tracking of you or your users in any form.


Value: An identifier for the request.

Error response

The error response content type depends on the ext parameter.

Error response example - JSON
1{
2 "message": "Missing parameter 'parameterName'",
3 "detailedError": {
4 "code": "MissingParameter",
5 "message": "Missing required parameter 'parameterName'."
6 },
7 "httpStatusCode": "400"
8}
Error response example - XML
1<ErrorEvResponse>
2 <message>Missing parameter 'parameterName'</message>
3 <detailedError>
4 <code>MissingParameter</code>
5 <message>Missing required parameter 'parameterName'.</message>
6 </detailedError>
7</ErrorEvResponse>

Error response fields

Primary fields

Description

message


string

A human-readable description of the error.

detailedError


object

Detailed information about the error.


detailedError object

detailedError object

FieldDescription

code


string

One of a server-defined set of error codes.

message


string

A human-readable description of the error code. It is intended as an aid to developers and is not suitable for exposure to end users.