Parking API

Parking Locations v2

Request access

Important note
This API is not available as part of our free evaluation or Pay As You Grow (PAYG) offering. Click the Request Access button above to contact our Sales team.

Important notes:

  • This API is powered by the TomTom Orbis Maps.
  • See the TomTom Orbis Maps documentation for more information.

Purpose

The On-Street Parking API Parking Locations endpoint provides information about on-street parking location probability in the requested point and within the area described by the given radius. Additionally, it can provide parking location ID’s and aggregated probability calculated upon the requested area.

Request data

HTTPS Method: GET

  • Constants and parameters enclosed in curly brackets {} must be replaced with their values.
  • See the following Request parameters section with the required and optional parameters tables for these values.

URL format

get
URL format
https://{baseURL}/maps/orbis/on-street-parking/locations?apiVersion=2&key={Your_API_Key}&point={longitude},{latitude}&radiusInMeters={radius}&parkingDataAtDateTime={timestamp}&maxResults={maxResults}&selectionType={selectionType}

URL example

get
URL example
https://api.tomtom.com/maps/orbis/on-street-parking/locations?apiVersion=2&key={Your_API_Key}&point=151.20807219091648,-33.872809993512945&radiusInMeters=100&parkingDataAtDateTime=2022-01-01T00:00:01Z&maxResults=150&selectionType=probability

curl command example

get
curl command example
curl 'https://api.tomtom.com/maps/orbis/on-street-parking/locations?apiVersion=2&key={Your_API_Key}&point=151.20807219091648,-33.872809993512945&radiusInMeters=100&parkingDataAtDateTime=2022-01-01T00:00:01Z&maxResults=150&selectionType=probability'

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

Base URL for calling the API.


Value: api.tomtom.com

key


string

The authorization key for access to the API.
Please note that using the TomTom-Api-Key header is recommended over apiVersion query parameters for improved security.
Value: Your valid API Key.

point


float,float

The coordinates of the point close to which on-street parking locations are searched for.


They must be comma-separated and calculated using EPSG:4326 projection (also known as WGS84 ).


Value: longitude,latitude

Optional parameters

Description

apiVersion integer

A version of the API to call. If the parameter is set, it will overwrite the value stored in TomTom-Api-Version header. Value: The current version is 2.

radiusInMeters


positive integer

Maximum radius in a straight line from a point to a parking location, measured in meters.


Default value: 100


Values: 1..1000

parkingDataAtDateTime


string

The time value used to determine the parking data.

  • Parking data is time-dependent; the target time can be specified to get the data for the particular date or hour.

  • Only future dates and time values are supported.
  • The only supported time standard is UTC.

Default value: current timestamp


Values: timestamp in the format of YYYY-MM-DDThh:mm:ssZ

maxResults


integer

The maximum number of parking locations that are returned.


Default value: 20


Values: 1..200

selectionType


string

The method of selecting the returned locations.


Default value: distance


Values:

  • distance : The closest locations to a requested point are returned.

  • probability : Locations with the highest probability field are returned.

Request headers

The following data table lists HTTP request headers of particular interest to clients of the Parking locations endpoint.

Required headers

Description

TomTom-Api-Key
string

The authorization key for access to the API.
Preferred method for authentication. Using the header is recommended over apiVersion query parameters for improved security.
Value: Your valid API Key.

TomTom-Api-Version integer

Contains a version of the API to call. Value: The current version is 2.

Attributes

A list of fields to return, specified in dot-notation.
See the Attributes header section for details and examples.
Value: list of the selected fields.

Optional headers

Description

Accept

Contains the acceptable media types that the client is able to understand. If the preferred media type is not supported, the server will fall back to the default one.
Value: application/json

Accept-Encoding

Contains the content encoding (usually a compression algorithm), that the client is able to understand.


Value: gzip

Attributes-Exclude

A list of response fields to omit, specified in dot-notation.
See the Attributes-Exclude header section for details and examples.
Value: list of the selected fields.

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 a 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: <string>

Attributes

Attributes header

A list of response fields to return, specified in dot-notation. Nested fields are expressed using . separators and optional grouped subfields using parentheses.
Attributes header must contain at least one valid top-level field. Using only a top-level * wildcard is not allowed.
When a field name refers to a non-primitive object, all its non-EXPLICIT subfields are returned by default unless further restricted in the header. EXPLICIT fields (as documented per API) are only returned when they are explicitly listed in Attributes (they are never included solely by selecting their parent or by using *).
The * wildcard may be used only at non–top-level positions to include all non-EXPLICIT subfields of the selected object.

Syntax:

  • <field-list> ::= <field> (',' <field>)*
  • <field> ::= <name> ('.' <field> | <field-set>)?
  • <field-set> ::= '(' <field-set-list> ')'
  • <field-set-list> ::= '*' (',' <field>)* | <field> (',' <field>)*
  • <name> ::= one or more alphabetic characters

Note:

  • All listed field names must exist in the response schema; unknown fields result in an error.
  • Response schema can be found in Response schema section.
  • APIs may restrict which fields are allowed in Attributes. Disallowed-but-existing fields result in an error.
  • New fields may be added over time. When they are marked EXPLICIT, they are not returned unless explicitly requested via Attributes, preserving backward compatibility and performance.

Examples:

  • easeOfParkingPercentage
  • easeOfParkingPercentage, locations.probabilityPercentage
  • `locations.*

Attributes-Exclude header

A list of response fields to omit, specified in dot-notation. Nested fields are expressed using . separators and optional grouped subfields using parentheses.
Any field listed in Attributes-Exclude, including its entire sub-tree, is omitted from the response, regardless of whether it was included implicitly or explicitly via the Attributes header. Exclusion always overrules inclusion.
The format of the field list is the same “listed dot-notation” used for the Attributes header:

Syntax:

  • <field-list> ::= <field> (',' <field>)*
  • <field> ::= <name> ('.' <field> | <field-set>)?
  • <field-set> ::= '(' <field-set-list> ')'
  • <field-set-list> ::= '*' (',' <field>)* | <field> (',' <field>)*
  • <name> ::= one or more alphabetic characters

Notes:

  • The exclusion list is applied to the result of the inclusion list. If a parent field is excluded, all of its children are excluded, even if some of those children were explicitly listed in Attributes.
  • When Attributes header inclusion list is not present in the request, then Attributes-Exclude header value is ignored.
  • Listed field names in Attributes-Exclude must exist in the response schema; unknown fields result in an error.
  • Response schema can be found in Response schema section.
  • APIs may restrict which fields are allowed in Attributes-Exclude. Disallowed-but-existing fields result in an error.
  • Fields may occur multiple times in Attributes-Exclude (not recommended, but not an error).
  • Some overlap between Attributes and Attributes-Exclude is allowed. In case of overlap, the exclusion takes precedence.
  • Whether a field is EXPLICIT or not does not change the semantics of exclusion: if it is present in Attributes-Exclude, it is omitted whenever it would otherwise have been returned.
  • If all fields are excluded, then HTTP 204 No Content response is returned.

Example:
Attributes: locations.*
Attributes-Exclude: locations.id
Results in returning properties for all locations present in the response except id property.

Response data

Successful response

For a single valid request, the Parking Locations endpoint returns its response body in JSON format.

Response schema

The exclamation mark ! means that a particular field cannot be equal to null, for example:

  • Point! - value cannot be equal to null
  • [Point!] - array of non-null objects
  • [Point]! - array cannot be null, but it can contain null values
Query
type Query {
easeOfParking: Float
locations: [Location]
}
Location
type Location {
probability: Float
id: String
coordinates: [[Float!]!]!
}

Response field structure

The following table describes JSON element fields that appear in a response.

Field

Description

locations


array

It contains available parking locations. If there is no data in the requested area the array is empty.

coordinates


array

It contains the geometry of a specific on-street parking location
represented as a LineString, defined by a sequence of coordinate pairs [longitude, latitude]
in the EPSG:4326 projection
( WGS84 ).

probabilityPercentage


float

It is a probability of finding an available on-street parking location belonging to the given coordinates.


If probability equals null in a particular parking location, it means that the parking location coordinates are available, but currently there is no probability associated with it.


Values: null,0.0..1.0

easeOfParkingPercentage


float

It is an aggregated probability of finding an available parking location, calculated upon all of the locations available in the requested area.


If easeOfParking equals null , it means that one of the following situations occurs:

  • All of the available parking locations have probability equal to null.

  • There is no on-street parking data in requested area.

Values: 0.0..1.0

id


string

This is the parking location ID, coming directly from our parking data provider. It can be used to combine data from different sources.


Value: A parking location ID.

Response examples

Example request & response

get
Request example 3
https://api.tomtom.com/maps/orbis/on-street-parking/locations?apiVersion=2&point=151.20807219091648,-33.872809993512945
Response example - JSON
{
"easeOfParkingPercentage":0.37,
"locations":[
{
"id":"00000000-000c-719d-0009-20d4467654e2",
"probabilityPercentage":0.37,
"coordinates":[
[
151.2080673806,
-33.8724552573
],
[
151.2080566518,
-33.8726078057
]
]
},
{
"id":"00000000-000c-719d-0009-20d4467654e2",
"probabilityPercentage":null,
"coordinates":[
[
151.2080566518,
-33.8726859588
],
[
151.2080539696,
-33.8728385067
]
]
}
...]
}

Error response

The Parking Locations endpoint, for an invalid single request, returns a response body in JSON format.

Response field structure

Field

Description

detailedError


object

Main object of the error response.

code


string

One of a server-defined set of error codes.

message


string

A human-readable description of the error code.

Response example

Error response example - JSON
{
"detailedError": {
"code": "INVALID_REQUEST",
"message": "Missing required parameter: point."
}
}

HTTP response codes

Code

Meaning & possible causes

200

OK

400

Bad request

403

Forbidden: The supplied API Key is not valid for this request.

405

Method Not Allowed: The provided HTTP request method is known by the server, but is not supported by the target resource.

429

Too Many requests: Too many requests were sent in a given amount of time for the supplied API Key.

500

Internal Server Error

503

Service currently unavailable: The service is currently unavailable.

596

Service Not Found: Unknown version of the service.

HTTP response headers

The following data table contains response headers sent back from an API server.

Header

Description

Access-Control-Allow-Origin

Indicates that cross-origin resource sharing (CORS) is allowed.


Value: *

Allow

Lists the set of supported HTTP methods. The header is sent in case a 405 HTTP response code is returned.


Value: GET, HEAD

Content-Encoding

Indicates which encodings were applied to the response body.


Value: gzip

Content-Length

Contains information about the size of the response body.


Value: <decimal number>

Content-Type

Indicates the media type of the resource returned.


Value: <application/json; charset=utf-8>

Date

Contains the date and time at which the message was originated. For details check RFC 7231.
Value: <http-date>

Tracking-ID

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


Value: <string>