Parking Locations v2
Request accessPurpose
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
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
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=probabilitycurl 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 |
|---|---|
string | Base URL for calling the API. Value: api.tomtom.com |
string | The authorization key for access to the API. |
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 |
|---|---|
| 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 |
positive integer | Maximum radius in a straight line from a point to a parking location, measured in meters. Default value: Values: |
string | The time value used to determine the parking data.
Default value: current timestamp Values: timestamp in the format of
|
integer | The maximum number of parking locations that are returned. Default value: Values: |
string | The method of selecting the returned locations. Default value: Values:
|
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 | The authorization key for access to the API. |
TomTom-Api-Version integer | Contains a version of the API to call.
Value: The current version is |
| Attributes | A list of fields to return, specified in dot-notation. |
Optional headers | Description |
|---|---|
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. | |
Contains the content encoding (usually a compression algorithm), that the client is able to understand. Value: | |
| Attributes-Exclude | A list of response fields to omit, specified in dot-notation. |
| Tracking-ID | Specifies an identifier for the request. It can be used to trace a call.
The value must match the regular expression
Value: |
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:
easeOfParkingPercentageeaseOfParkingPercentage, 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
Attributesheader inclusion list is not present in the request, thenAttributes-Excludeheader value is ignored. - Listed field names in
Attributes-Excludemust 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
AttributesandAttributes-Excludeis 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
type Query { easeOfParking: Float locations: [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 |
|---|---|
array | It contains available parking locations. If there is no data in the requested area the array is empty. |
array | It contains the geometry of a specific on-street parking location |
float | It is a probability of finding an available on-street parking location belonging to the given coordinates. If probability equals Values: |
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
Values: |
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
https://api.tomtom.com/maps/orbis/on-street-parking/locations?apiVersion=2&point=151.20807219091648,-33.872809993512945{ "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 |
|---|---|
object | Main |
string | One of a server-defined set of error codes. |
string | A human-readable description of the error code. |
Response example
{ "detailedError": { "code": "INVALID_REQUEST", "message": "Missing required parameter: point." }}HTTP response codes
Code | Meaning & possible causes |
|---|---|
| OK |
| Bad request |
| Forbidden: The supplied API Key is not valid for this request. |
| Method Not Allowed: The provided HTTP request method is known by the server, but is not supported by the target resource. |
| Too Many requests: Too many requests were sent in a given amount of time for the supplied API Key. |
| Internal Server Error |
| Service currently unavailable: The service is currently unavailable. |
| 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 |
|---|---|
Indicates that cross-origin resource sharing (CORS) is allowed. Value: | |
Lists the set of supported HTTP methods. The header is sent in case a
Value: | |
Indicates which encodings were applied to the response body. Value: | |
Contains information about the size of the response body. Value: | |
Indicates the media type of the resource returned. Value:
| |
Contains the date and time at which the message was originated. For
details check
RFC 7231. | |
| 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> |