Geometry Search

Service version: 2
Last edit: 2022.09.07

Purpose

The Geometry Search endpoint allows you to perform a free form search inside a single geometry or many of them. The search results that fall inside the geometry/geometries will be returned. The service returns POI results by default. For other result types, the idxSet parameter should be used. To send the geometry you will use a POST or GET request with json as a string value for the geometryList parameter.

  • POST is recommended for all datasets.
  • POST requests require the Content-Type header to be set to application/json.
  • GET can only be used for small datasets.

Run this endpoint

You can easily run this and other endpoints. Go to the TomTom API Explorer page and follow the directions.

Options

Option 1. Use a POST request for all geometry datasets.

Submit the data as a JSON file to the API database using a POST request. Note: the geometryList data array is included in the POST body.

1{
2 "geometryList": [
3 {
4 "type":"POLYGON",
5 "vertices": [
6 "37.7524152343544,-122.43576049804686",
7 "37.70660472542312,-122.43301391601562",
8 "37.712059855877314,-122.36434936523438",
9 "37.75350561243041,-122.37396240234374"
10 ]
11 },
12 {
13 "type":"CIRCLE",
14 "position":"37.71205,-121.36434",
15 "radius":6000
16 },
17 {
18 "type":"CIRCLE",
19 "position":"37.31205,-121.36434",
20 "radius":1000
21 }
22 ]
23}

Option 2. Use a GET request only for small datasets.

Retreive the data from the API database using a GET request with the geometryList parameter value set as an array.

1?geometryList=[
2 {
3 "type":"POLYGON",
4 "vertices":[
5 "37.7524152343544,-122.43576049804686",
6 "37.70660472542312,-122.43301391601562",
7 "37.712059855877314,-122.36434936523438",
8 "37.75350561243041,-122.37396240234374"
9 ]
10 },
11 {
12 "type":"CIRCLE",
13 "position":"37.71205,-121.36434",
14 "radius":6000
15 },
16 {
17 "type":"CIRCLE",
18 "position":"37.31205,-121.36434",
19 "radius":1000
20 }
21]

Request data

HTTPS Method: POST

For ease of viewing and identification:

  • Constants and parameters enclosed in curly brackets &#123 } 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.

POST URL request format

https://{baseURL}/search/{versionNumber}/geometrySearch/{query}.{ext}?key={Your_API_Key}&geometryList={geometryList}&limit={limit}&language={language}&idxSet={idxSet}&extendedPostalCodesFor={extendedPostalCodesFor}&categorySet={categorySet}&brandSet={brandSet}&connectorSet={connectorSet}&fuelSet={fuelSet}&view={view}&openingHours={openingHours}&timeZone={timeZone}&mapcodes={mapcodes}&relatedPois={relatedPois}&minPowerKW={minPowerKW}&maxPowerKW={maxPowerKW}&entityTypeSet={entityTypeSet}

POST URL request example

1https://api.tomtom.com/search/2/geometrySearch/pizza.json?key={Your_API_Key}&geometryList=[
2 {
3 "type":"POLYGON",
4 "vertices":[
5 "37.7524152343544,-122.43576049804686",
6 "37.70660472542312,-122.43301391601562",
7 "37.712059855877314,-122.36434936523438",
8 "37.75350561243041,-122.37396240234374"
9 ]
10 },
11 {
12 "type":"CIRCLE",
13 "position":"37.71205,-121.36434",
14 "radius":6000
15 },
16 {
17 "type":"CIRCLE",
18 "position":"37.31205,-121.36434",
19 "radius":1000
20 }
21]

POST curl command request example

1curl -XPOST -d '{
2 "geometryList": [
3 {
4 "type":"POLYGON",
5 "vertices": [
6 "37.7524152343544,-122.43576049804686",
7 "37.70660472542312,-122.43301391601562",
8 "37.712059855877314,-122.36434936523438",
9 "37.75350561243041,-122.37396240234374"
10 ]
11 },
12 {
13 "type":"CIRCLE",
14 "position":"37.71205,-121.36434",
15 "radius":6000
16 },
17 {
18 "type":"CIRCLE",
19 "position":"37.31205,-121.36434",
20 "radius":1000
21 }
22 ]
23}' 'https://api.tomtom.com/search/2/geometrySearch/pizza.json?key={Your_API_Key}'

HTTPS Method: GET

GET URL request format

https://{baseURL}/search/{versionNumber}/geometrySearch/{query}.{ext}?key={Your_API_Key}&geometryList={geometryList}&limit={limit}&language={language}&idxSet={idxSet}&extendedPostalCodesFor={extendedPostalCodesFor}&categorySet={categorySet}&brandSet={brandSet}&connectorSet={connectorSet}&fuelSet={fuelSet}&view={view}&openingHours={openingHours}&timeZone={timeZone}&mapcodes={mapcodes}&relatedPois={relatedPois}&minPowerKW={minPowerKW}&maxPowerKW={maxPowerKW}&entityTypeSet={entityTypeSet}

GET URL request example

1https://api.tomtom.com/search/2/geometrySearch/pizza.json?key={Your_API_Key}&geometryList=[
2 {
3 "type":"POLYGON",
4 "vertices":[
5 "37.7524152343544,-122.43576049804686",
6 "37.70660472542312,-122.43301391601562",
7 "37.712059855877314,-122.36434936523438",
8 "37.75350561243041,-122.37396240234374"
9 ]
10 },
11 {
12 "type":"CIRCLE",
13 "position":"37.71205,-121.36434",
14 "radius":6000
15 },
16 {
17 "type":"CIRCLE",
18 "position":"37.31205,-121.36434",
19 "radius":1000
20 }
21]

GET curl command request example

1curl 'https://api.tomtom.com/search/2/geometrySearch/pizza.json?key={Your_API_Key}&geometryList=[
2 {
3 "type":"POLYGON",
4 "vertices":[
5 "37.7524152343544,-122.43576049804686",
6 "37.70660472542312,-122.43301391601562",
7 "37.712059855877314,-122.36434936523438",
8 "37.75350561243041,-122.37396240234374"
9 ]
10 },
11 {
12 "type":"CIRCLE",
13 "position":"37.71205,-121.36434",
14 "radius":6000
15 },
16 {
17 "type":"CIRCLE",
18 "position":"37.31205,-121.36434",
19 "radius":1000
20 }
21]'

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.
  • Optional parameters may be used.
  • If there is a default value that will be assumed when an optional parameter is not used, it is shown in the table.
  • The order of request parameters is not important.
Required parameters Description
baseURL
string

Base URL for calling the API.
Values:

versionNumber
string
The service version.
Value: The current value is 2.
query
string

The query string. It must be properly URL-encoded.
Value: A properly URL-encoded query string.

ext
string
A valid response format:
Values: json, jsonp, js, or xml
key
string
An API Key valid for the requested service.
Value: Your valid API Key.
geometryList
object

List of geometries to search in (JSON).
Available types are:

  • POLYGON with an array of vertices (lat,lon string)
  • CIRCLE with position (lat,lon string) and radius (in meters).

The format is as in the example above. The circle radius unit is in meters and must be greater than 0. The list (array) can contain up to 50 geometries, each consisting of up to 50 vertices.
Value: A list of geometries. See the following code example.

1{
2 "type":"POLYGON",
3 "vertices":[
4 "37.7524152343544,-122.43576049804686",
5 "37.70660472542312,-122.43301391601562",
6 "37.712059855877314,-122.36434936523438",
7 "37.75350561243041,-122.37396240234374"
8 ]
9},
10{
11 "type":"CIRCLE",
12 "position":"37.71205,-121.36434",
13 "radius":6000
14}

Optional parameters

Description

limit
integer

The maximum number of responses that will be returned.
Default value: 10
Maximum value: 100

language
string

Language in which search results should be returned. It should be one of the TomTom IETF

Supported Languages

tags, case insensitive. When data in the specified language is not available for a specific field or the language is not specified, the language best matched with your query is used.


Value: A TomTom IETF

Supported Languages

tag.

lat
float

Latitude, e.g., lat=37.337 lat,lon where results should be biased.


Values: min/max: -90 to +90


Reference:

Latitude, Longitude, and Coordinate System Grids

lon
float

Longitude, e.g.,lon=-121.89 lat,lon where results should be biased.


Values: min/max: -180 to +180


Reference:

Latitude, Longitude, and Coordinate System Grids

extendedPostalCodesFor
string

Indexes for which extended postal codes should be included in the results. Available values are described in additional information indexes abbreviation values section. The value should be a comma-separated list of index types (in any order) or None for no indexes. By default, extended postal codes are included for all indexes

except Geo

. Extended postal code lists for geographies can be quite long, so they have to be explicitly requested when needed.
Value: A comma-separated list of index types.


Usage examples:
  • extendedPostalCodesFor=POI
  • extendedPostalCodesFor=PAD,Addr,POI
  • extendedPostalCodesFor=None

Extended postal code is returned as an extendedPostalCode property of an address. Availability is region-dependent.

idxSet
string

The idxSet parameter allows for fine tuning Search by specifying which indexes to utilize for the search. The pre-defined indexes are:

  • Addr

    = Address range interpolation (when there is no PAD)

  • Geo

    = Geographies

  • PAD

    = Point Addresses

  • POI

    = Points of Interest

  • Str

    = Streets

  • XStr

    = Cross Streets (intersections)


Values: See the preceding list of pre-defined indexes.
Usage examples:

  • idxSet=POI (search Points Of Interest only)

  • idxSet=PAD,Addr (search addresses only)

categorySet
string

A comma-separated list of categories which could be used to restrict the result to the Points Of Interest of specific categories. The list of categories can be discovered using the

POI Categories

endpoint.


Value: A comma-separated list of category identifiers (in any order). When multiple category identifiers are provided, only POIs that belong to (at least) one of the categories from the provided list will be returned.


Usage examples:
  • categorySet=7315 (search Points Of Interest of category Restaurant)

  • categorySet=7315025,7315017 (search Points Of Interest of a category, in this example an Italian (italian) or French (french) Restaurant

brandSet
string

A comma-separated list of brand names which could be used to restrict the result to Points Of Interest of specific brands.


Value: A comma-separated list of brand names (in any order). When multiple brands are provided, only POIs that belong to (at least) one of the brands from the provided list will be returned. Brands that contain a "," (comma) in their name should be put into quotes, for example: "A,B,C".
Usage examples:

  • brandSet=Tomtom (search Points Of Interest of the "Tomtom" brand)

  • brandSet=Tomtom,Foobar (search Points Of Interest of the "Tomtom" brand OR "Foobar" brand)

  • brandSet="A,B,C Comma" (search Points Of Interest of the "Adam,Batsman,and,Bowling" brand)

connectorSet
string

A comma-separated list of connector types which could be used to restrict the result to the Points Of Interest of type Electric Vehicle Station supporting specific connector types. See the list of

Supported Connector Types

.
Value: A comma-separated list of connector types (in any order). When multiple connector types are provided, only POIs that support (at least) one of the connector types from the provided list will be returned.


Usage examples:
  • connectorSet=IEC62196Type2CableAttached (search Points Of Interest of type Electric Vehicle Station supporting IEC62196Type2CableAttached)

  • connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached

    (search Points Of Interest of type Electric Vehicle Station supporting IEC62196Type2CableAttached or IEC62196Type2Outlet)

minPowerKW
double

An optional parameter which could be used to restrict the result to the Points Of Interest of type Electric Vehicle Station supporting at least one connector with a specific minimal value of power in kilowatts (closed interval - with that value).
Value: A double value representing the power rate in kilowatts.
Usage example: minPowerKW=22.2. Returns a Points Of Interest of type Electric Vehicle Station supporting at least one connector with a power rate in the range from 22.2 kW. This parameter might be used together with maxPowerKW.

maxPowerKW
double

An optional parameter which could be used to restrict the result to the Points Of Interest of type Electric Vehicle Station supporting at least one connector with a specific maximum value of power in kilowatts (closed interval - with that value).
Value: A double value representing the power rate in kilowatts.
Usage example: maxPowerKW=43.2. Returns a Points Of Interest of type Electric Vehicle Station supporting at least one connector with a power rate in the range to 43.2 kW. This parameter might be used together with minPowerKW.

fuelSet
string

A comma-separated list of fuel types which could be used to restrict the result to the Points Of Interest of specific fuels. If fuelSet is specified, the query can remain empty. Only POIs with a proper fuel type will be returned.


Value: A comma-separated list of fuel type identifiers (in any order). When multiple fuel types are provided, only POIs that belong to (at least) one of the fuel types from the provided list will be returned.


Available values:
  • Petrol
  • LPG
  • Diesel
  • Biodiesel
  • DieselForCommercialVehicles
  • E85
  • LNG
  • CNG
  • Hydrogen
  • AdBlue

Usage examples:
  • fuelSet=Diesel (search Points Of Interest of the Diesel fuel type)

  • fuelSet=Petrol,LPG (search Points Of Interest of either the Petrol or LPG fuel type)

view
string

Geopolitical View. The context used to resolve the handling of disputed territories. Views include Unified, along with AR, IL, IN, MA, PK, RU, TR, and CN which are respectively tailored for Argentina, Israel, India, Morocco, Pakistan, Russia, Turkey, and China.


Default values:
  • Argentina, default view: AR, available views: Unified, IL, IN, MA, PK, RU, TR, CN

  • India, default view: IN, available views: -

  • Morocco, default view: MA, available views: Unified, AR, IL, IN, PK, RU, TR, CN

  • Pakistan, default view: PK, available views: Unified, AR, IL, IN, MA, RU, TR, CN

  • Russia, default view: RU, available views: Unified, AR, IL, IN, MA, PK, TR, CN

  • Turkey, default view: TR, available views: Unified, AR, IL, IN, MA, PK, RU, CN

  • China, default view: CN, available views: Unified, AR, IL, IN, MA, PK, RU, TR

  • Others, default view: Unified, available views: AR, IL, IN, MA, PK, RU, TR, CN

openingHours
string

List of opening hours for a POI (Points of Interest).
Value: nextSevenDays Mode shows the opening hours for next week, starting with the current day in the local time of the POI.


Usage example: openingHours=nextSevenDays
timeZone
string

Used to indicate the mode in which the timeZone object should be returned.
Values: iana. Mode shows the IANA ID which allows the user to determine the current time zone for the POI.


Usage example: timeZone=iana
mapcodes
string

Enables the return of a comma-separated mapcodes list. It can also filter the response to only show selected mapcode types. See

mapcodes

in the response.


Values: One or more of: Local, International, Alternative A mapcode represents a specific location to within a few meters. Every location on Earth can be represented by a mapcode. Mapcodes are designed to be short, easy to recognize, remember, and communicate. Visit the Mapcode project website for more information.


Usage examples:
  • mapcodes=Local (only returns the Local mapcode for a location)

  • mapcodes=Local,Alternative (returns both Local and Alternative mapcodes for a location)

  • mapcodes=Local,Alternative,International (returns all possible mapcodes for a location)

relatedPois
string

An optional parameter that provides the possibility to return related Points Of Interest.


Default value: off

Values: off, child, parent , all


Points Of Interest can be related to each other when one is physically part of another. For example, an airport terminal can physically belong to an airport. This relationship is expressed as a parent/child relationship: the airport terminal is a child of the airport. If the value child or parent is given, a related Points Of Interest with a specified relation type will be returned in the response. If the value all is given, then both child and parent relations are returned.


Usage examples:
  • relatedPois=child: Returns only Points Of Interest with a child relation.

  • relatedPois=parent: Returns only Points Of Interest with a parent relation.

  • relatedPois=all: Returns Points Of Interest with all possible relations.

entityTypeSet
string

A comma-separated list of entity types which can be used to restrict the result to a specific entity type. Parameter should be used with the idxSet parameter set to the Geography value.
Value: A comma-separated list of of entity types. Item order in the list does not matter. Values are case sensitive.


Available values:
  • Country
  • CountrySubdivision
  • CountrySecondarySubdivision
  • CountryTertiarySubdivision
  • Municipality
  • MunicipalitySubdivision
  • Neighbourhood
  • PostalCodeArea

Usage examples:
  • entityTypeSet=Municipality: only returns results with a Municipality entity type.

  • entityTypeSet=Municipality,MunicipalitySubdivision: returns results with a Municipaliy or MunicipalitySubdivision entity type.

Request headers

Optional headers

Description

Accept-Encoding

Enables response compression.
Value: gzip

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

For illustrative purposes the example below is neatly indented and includes all possible response fields. Actual responses are more compact and the fields present will vary based on the result type and the data available. See the following response field documentation for more information. When requesting JSON output, the response has the following structure:

1{
2 "summary": {
3 "query": "pizza",
4 "queryType": "NON_NEAR",
5 "queryTime": 82,
6 "numResults": 10,
7 "offset": 0,
8 "totalResults": 479,
9 "fuzzyLevel": 1,
10 "geoBias": {
11 "lat": 36.98844,
12 "lon": -121.97483
13 }
14 },
15 "results": []
16}

Each element of the results array is in the following format:

Results array elements format - JSON
1{
2 "type": "POI",
3 "id": "g6JpZK84NDAwNjEwMDE4NjUxNDKhY6NVU0GhdqdVbmlmaWVk",
4 "score": 4,
5 "dist": 0,
6 "info": "search:ta:840061001865142-US",
7 "entityType": "Municipality",
8 "poi": {
9 "name": "Upper Crust Pizza & Pasta",
10 "phone": "+(1)-(831)-4762333",
11 "url": "www.uppercrustsc.com/",
12 "brands": [
13 {
14 "name": "Upper Crust"
15 }
16 ],
17 "categorySet": [
18 {
19 "id": 7315015
20 }
21 ],
22 "categories": ["pizza", "restaurant"],
23 "openingHours": {
24 "mode": "nextSevenDays",
25 "timeRanges": [
26 {
27 "startTime": {
28 "date": "2019-02-05",
29 "hour": 7,
30 "minute": 0
31 },
32 "endTime": {
33 "date": "2019-02-05",
34 "hour": 21,
35 "minute": 0
36 }
37 },
38 {
39 "startTime": {
40 "date": "2019-02-06",
41 "hour": 7,
42 "minute": 0
43 },
44 "endTime": {
45 "date": "2019-02-06",
46 "hour": 21,
47 "minute": 0
48 }
49 },
50 {
51 "startTime": {
52 "date": "2019-02-07",
53 "hour": 7,
54 "minute": 0
55 },
56 "endTime": {
57 "date": "2019-02-07",
58 "hour": 21,
59 "minute": 0
60 }
61 },
62 {
63 "startTime": {
64 "date": "2019-02-08",
65 "hour": 7,
66 "minute": 0
67 },
68 "endTime": {
69 "date": "2019-02-08",
70 "hour": 21,
71 "minute": 0
72 }
73 },
74 {
75 "startTime": {
76 "date": "2019-02-09",
77 "hour": 7,
78 "minute": 0
79 },
80 "endTime": {
81 "date": "2019-02-09",
82 "hour": 21,
83 "minute": 0
84 }
85 },
86 {
87 "startTime": {
88 "date": "2019-02-10",
89 "hour": 7,
90 "minute": 0
91 },
92 "endTime": {
93 "date": "2019-02-10",
94 "hour": 12,
95 "minute": 0
96 }
97 },
98 {
99 "startTime": {
100 "date": "2019-02-10",
101 "hour": 14,
102 "minute": 0
103 },
104 "endTime": {
105 "date": "2019-02-10",
106 "hour": 21,
107 "minute": 0
108 }
109 }
110 ]
111 },
112 "classifications": [
113 {
114 "code": "RESTAURANT",
115 "names": [
116 {
117 "nameLocale": "en-US",
118 "name": "pizza"
119 },
120 {
121 "nameLocale": "en-US",
122 "name": "restaurant"
123 }
124 ]
125 }
126 ],
127 "timeZone": {
128 "ianaId": "Europe/Andorra"
129 }
130 },
131 "relatedPois": [
132 {
133 "relationType": "child",
134 "id": "g6JpZK83ODQwMDkwMDAwMjUxMTWhY6NBUkWhdqdVbmlmaWVk"
135 },
136 {
137 "relationType": "child",
138 "id": "u234HsadasKHZK81MjgwMDkwMDQyNDY3jashfsaASDHkjhdA"
139 }
140 ],
141 "address": {
142 "streetNumber": "2501",
143 "streetName": "Soquel Dr",
144 "municipalitySubdivision": "Santa Cruz, Live Oak",
145 "municipality": "Santa Cruz, Live Oak",
146 "countrySecondarySubdivision": "Santa Cruz",
147 "countryTertiarySubdivision": "Santa Cruz",
148 "countrySubdivision": "CA",
149 "postalCode": "95065",
150 "extendedPostalCode": "950652023",
151 "countryCode": "US",
152 "country": "United States Of America",
153 "countryCodeISO3": "USA",
154 "freeformAddress": "2501 Soquel Dr, Santa Cruz, CA 95065",
155 "countrySubdivisionName": "California",
156 "localName": "Santa Cruz"
157 },
158 "position": {
159 "lat": 36.98844,
160 "lon": -121.97483
161 },
162 "mapcodes": [
163 {
164 "type": "Local",
165 "fullMapcode": "US-CA FS.WRH3",
166 "territory": "US-CA",
167 "code": "FS.WRH3"
168 },
169 {
170 "type": "International",
171 "fullMapcode": "S4ZW4.990V"
172 },
173 {
174 "type": "Alternative",
175 "fullMapcode": "US-CA 4349.S8W",
176 "territory": "US-CA",
177 "code": "4349.S8W"
178 },
179 {
180 "type": "Alternative",
181 "fullMapcode": "US-CA JJCH.H9DF",
182 "territory": "US-CA",
183 "code": "JJCH.H9DF"
184 },
185 {
186 "type": "Alternative",
187 "fullMapcode": "USA JJCH.H9DF",
188 "territory": "USA",
189 "code": "JJCH.H9DF"
190 }
191 ],
192 "viewport": {
193 "topLeftPoint": {
194 "lat": 36.98934,
195 "lon": -121.97596
196 },
197 "btmRightPoint": {
198 "lat": 36.98754,
199 "lon": -121.9737
200 }
201 },
202 "entryPoints": [
203 {
204 "type": "main",
205 "position": {
206 "lat": 36.98817,
207 "lon": -121.97487
208 }
209 },
210 {
211 "type": "minor",
212 "functions": ["FrontDoor"],
213 "position": {
214 "lat": 52.30987,
215 "lon": 4.76093
216 }
217 }
218 ],
219 "addressRanges": {
220 "rangeLeft": "1 - 3",
221 "rangeRight": "2 - 12",
222 "from": {
223 "lat": 51.16561,
224 "lon": 19.48489
225 },
226 "to": {
227 "lat": 51.16545,
228 "lon": 19.4863
229 }
230 },
231 "chargingPark": {
232 "connectors": [
233 {
234 "connectorType": "IEC62196Type2CCS",
235 "ratedPowerKW": 22.2,
236 "currentA": 32,
237 "currentType": "AC3",
238 "voltageV": 380
239 },
240 {
241 "connectorType": "Tesla",
242 "ratedPowerKW": 43.2,
243 "currentA": 16,
244 "currentType": "AC3",
245 "voltageV": 480
246 }
247 ]
248 },
249 "dataSources": {
250 "chargingAvailability": {
251 "id": "442009000132285"
252 },
253 "parkingAvailability": {
254 "id": "00000000-0005-36de-0009-20d4467654e2"
255 },
256 "fuelPrice": {
257 "id": "1:cf81fe50-6218-11ea-a677-d05099d5f839"
258 },
259 "geometry": {
260 "id": "00004e4c-3100-3c00-0000-0000685e23c7"
261 }
262 }
263}

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
summary
object

Summary information about the search that was performed.
summary object

results
array

Result list, sorted in descending order by score.
results array

summary object

Field Description
query
string
Query as interpreted by the search engine.
queryType
string

Response type. Can be NEARBY or NON_NEAR.

queryTime
integer
Time spent on resolving the query.
numResults
integer
Number of results in the response.
offset
integer

Starting offset of the returned results within the full result set.

totalResults
integer
Total number of results found.
fuzzyLevel
integer
Maximum fuzzy level required to provide results.
geoBias
object

Position used to bias the results.

LatLon

results array

Field Description
type
string

Type of result.
Values: One of: POI, Street, Geography , Point Address, Address Range, Cross Street

id
string

A stable unique id for the POI index, and a non-stable unique id for the other indexes.
Note: stable id means that it doesn't change between data releases without changing the location, attribution or classification.

score
double

Score of the result.
A larger score means there is a probability that a result meeting the query criteria is higher.

dist
double

Unit: meters. This is the distance to an object if geoBias was provided.

info
string
Information about the original data source of the result.
entityType
string

Optional section. Only present if type == Geography.
Values: One of:

  • Country
  • CountrySubdivision
  • CountrySecondarySubdivision
  • CountryTertiarySubdivision
  • Municipality
  • MunicipalitySubdivision
  • Neighbourhood
  • PostalCodeArea
poi
object

Information about the Points of Interest in the result. Optional section. Only present if type == POI.
poi object

relatedPois
object

List of related Points Of Interest.
relatedPois object

address
object

Structured address for the result.
address object

position
object

Position of the result:

LatLon
mapcodes
array

List of mapcode objects
mapcodes object

viewport
object

A viewport which can be used to display the result on a map.
viewport object

entrypoints
array

List of entry points of the POI.
entryPoints array

addressRanges
object

Address ranges on a street segment. Available only for results where the result type is equal to "Address Range".
addressRanges object

chargingPark
object

A list of chargingPark objects. Present only when the Points of Interest are of the Electric Vehicle Station type.
chargingPark object

dataSources
object

Optional section. Reference ids for use with the

Additional Data

service.
dataSources object

poi object

Field Description
name
string

Name of the POI.

phone
string
Telephone number.
brands
array

The list of POI brands.
brands array

url
string
Website URL.
categories
array
Deprecated

The list of POI categories.

Supported Category Codes

.

Deprecated: Use classifications instead.

  • As of May 1, 2018:
    • The response categories field has been deprecated.

    • It will be withdrawn following a 12 month deprecation period.

    • The planned withdrawal date is May 1, 2019.

categorySet
array

The list of the most specific POI categories.
categorySet array

openingHours
object

List of opening hours for a POI (Points of Interest).


openingHours object

classifications
array

The list of POI category classifications.
classifications array

timeZone
object

Time zone information for the POI.
timeZone object

categorySet array

Field Description
id
number

Category id. Full list of available categories is available under the

POI Categories

endpoint.

brands array

Field Description
name
string
Brand name.

classifications array

Field Description
code
string

Fixed top level category code.

Supported Category Codes

names
array

List of category names with locale code information. Currently only the en-US locale is returned.
names array

names array

Field Description
nameLocale
string
Locale code of this category name.
name
string
Category name in given locale.

relatedPois object

Field Description
relationType
string

Relation type: child, parent

id
string

Pass this as entityId to the

Place by ID

service to fetch additional data for the Point Of Interest.

address object

Field Description
streetNumber
string
The building number on the street.
streetName
string
The street name.
municipalitySubdivision
string
Sub / Super City.
municipality
string
City / Town.
countrySecondarySubdivision
string
County.
countryTertiarySubdivision
string
Named Area.
countrySubdivision
string
State or Province.
postalCode
string
Postal Code / Zip Code.
postalName
string

An address component which represents the name for a postal code that is related to a single administrative area, city, town, or other populated place. Note: This field only appears for geographies having entityType == PostalCodeArea. It is only supported for the USA.

extendedPostalCode
string
Extended postal code (availability dependent on region).
countryCode
string
Country. Note: this is a two-letter code, not a country name.
country
string
Country name.
countryCodeISO3
string
ISO alpha-3 country code.
freeformAddress
string

An address line formatted according to the formatting rules of the result's country of origin. In the case of countries, its full country name. For the USA, in the case of geographies with entityType == PostalCodeArea it will contain the postalName field value.

countrySubdivisionName
string

The full name of the first level of a country's administrative hierarchy. This field appears only in case countrySubdivision is presented in an abbreviated form. Supported only for USA, Canada, and Great Britain.

countrySubdivisionCode
string

countrySubdivisionCode prefixed by countryCode (countryCode-countrySubdivisionCode) and the hyphen forms the ISO 3166-2 code. Only present if the returned document has entityType == CountrySubdivision.

  • countrySubdivisionCode examples:

    • TX for Texas

    • SCT for Scotland

    • ON for Ontario

    • ZE for Zeeland

    • BB for Brandenburg

localName
string

An address component which represents the name of a geographic area or locality that groups a number of addressable objects for addressing purposes, without being an administrative unit.

mapcodes object

Field Description
type
string

Type of mapcode.


Local

The shortest possible (and easiest to remember) mapcode. Local mapcodes are especially useful when the user knows what territory the mapcode is in (for example, when an application is designed to be used inside just one European country or US state). Note that the code element of a Local mapcode is ambiguous when used without the territory element. For example, the "4J.P2" mapcode can mean the Eiffel Tower location (48.858380, 2.294440) (with the territory set to FRA), but also some place in Amsterdam-Noord, Netherlands (52.382184, 4.911021) (with the territory set to NLD).


International

This mapcode is unambiguous. It is also the longest.


Alternative

Alternatives to Local mapcodes. Each Alternative mapcode points to slightly different coordinates due to the way mapcodes are computed (see the mapcode documentation ). For example, the position from a response can be encoded as "5DM.WC" (51.759244, 19.448316) and the "VHJ.036" (51.759245, 19.448264), which are close to each other, but not exactly the same place.

fullMapcode
string

The full form of a mapcode (territory + code). It is always unambiguous. The territory element is always in the Latin alphabet. In an International mapcode, the territory part is empty.

territory
string

The territory element of the mapcode. The territory element is always in the Latin alphabet. Usually, the territory is the

ISO 3166-1 alpha 3

abbreviation for the country name. However in these eight very large countries:

  • USA
  • Canada
  • Mexico
  • Brazil
  • India
  • Russia
  • China

an address has little meaning unless the user also knows what state it's in (just as, elsewhere, an address has little meaning if the user doesn’t know what country it’s in). More information about territory codes is available at Territories for mapcodes. This field is not returned for an International mapcode.

code
string

The mapcode without the territory element. It consists of two groups of letters and digits separated by a dot. The code is using the same language and alphabet as the response. The language parameter may be used to modify the language and alphabet of both the response and the code (for example: Cyrillic for the language'ru-RU'). This field is not returned for the International mapcodes. Use fullMapcode instead.

viewport object

Field Description
topLeftPoint
object

Top-left corner of the rectangle:

LatLon
btmRightPoint
object

Bottom-right corner of the rectangle:

LatLon

entryPoints array

Field Description
type
string

The main entry point. One of: main, minor

functions
array

If present, represents the type of access for the POI.


Example: FrontDoor
position
object

Position of the entry point:

LatLon

addressRanges object

Field Description
rangeLeft
string

An address range on the left side of a street segment
(assuming looking from the "from" end toward the "to" end).

rangeRight
string

An address range on the right side of a street segment
(assuming looking from the "from" end toward the "to" end).

from
object

A beginning point of a street segment.

LatLon
to
object

An end point of a street segment.

LatLon

chargingPark object

Field Description
connectors
array

A list of connectors available in the Points Of Interest of an Electric Vehicle Station type.
connectors array

connectors array

Field Description
connectorType
string

Type of the connector available in Electric Vehicle Station. See the:

List of supported connector types

.

ratedPowerKW
double
Rated power of the connector in kilowatts (kW).
currentA
integer
Current value of the connector in amperes (A).
currentType
string
Current type of the connector.
voltageV
integer
Voltage of the connector in Volts (V).

dataSources object

Field Description
chargingAvailability
object

Information about the charging stations availability. Only present if type == POI.
chargingAvailability object

parkingAvailability
object

Information about the parking site availability. Only present if type == POI.
parkingAvailability object

fuelPrice
object

Information about the fuel station prices. Only present if type == POI.
fuelPrice object

geometry
object

Information about the geometric shape of the result. Only present if type == Geography or POI.
geometry object

chargingAvailability object

Field Description
id
string

Pass this as chargingAvailability to the

EV Charging Stations Availability

service to fetch charging availability information for this result.

parkingAvailability object

Field Description
id
string

Pass this as parkingAvailability to the

Parking Availability

service to fetch parking availability information for this result.

fuelPrice object

Field Description
id
string

Pass this as fuelPrice to the

Fuel Prices

service to fetch fuel price information for this result.

geometry object

Field Description
id
string

Pass this as geometryId to the

Additional Data

service to fetch geometry information for this result.

Field Description
sourceName
string
Name of an additional data provider.

LatLon

Field Description
lat
float

Latitude. min/max: -90 to +90
Reference: Latitude, Longitude, and Coordinate System Grids

lon
float

Longitude. min/max: -180 to `+180``
Reference: Latitude, Longitude, and Coordinate System Grids

openingHours object

Field Description
mode
string
Mode used in the request.
timeRanges
array

List of time ranges for the next 7 days.
timeRanges array

timeRanges array

Field Description
startTime
object

The point in the next 7 days range when a given POI is being opened, or the beginning of the range if it was opened before the range, inclusive.
startTime object

endTime
object

The point in the next 7 days range when a given POI is being opened, or the beginning of the range if it was opened before the range, exclusive
endTime object

startTime object

Field Description
date
string

Represents the current day in the calendar year in the POI time zone.

hour
integer

Hours are in the 24 hour format in the local time of a POI; possible values are 0 - 23.

minute
integer

Minutes are in the local time of a POI; possible values are 0 - 59.

endTime object

Field Description
date
string

Represents current day in calendar year in POI time zone.

hour
integer

Hours are in the 24 hour format in the local time of a POI; possible values are 0 - 23.

minute
integer

Minutes are in the local time of a POI; possible values are 0 - 59.

timeZone object

Field Description
ianaId
string

ID from the IANA Time Zone Database.

Response codes

The following table contains response codes signifying successful and failed Requests to an API server.

Code

Meaning & possible causes

200

OK: The search successfully returned zero or more results.

400

Bad Request: One or more parameters were incorrectly specified.

403

Forbidden: Possible causes include: Service requires SSL, Not authorized, Rate or volume limit exceeded, Unknown referer

405

Method Not Allowed: The HTTP method (GET, POST, etc.) is not supported for this request.

404/596

Not Found: The HTTP request method (GET, POST, etc.) or path is incorrect.

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 contains response headers sent back from an API server.

Header

Description

Access-Control-Allow-Origin

Ensures that clients implementing the CORS security model are able to access the response from this service.
Value: An asterisk * that signifies access to the TomTom API using the Access-Control-Allow-Origin (ACAO) header in its response indicating which origin sites are allowed.

Content-Type

Indicates the format of the response, as chosen by the client.
Format: type/subtype; charset=utf-8
Values: type/subtype is one of application/json, text/javascript, text/xml

Content-Encoding

If requested by the client, the Search service applies gzip compression to the responses with the Accept-Encoding header.
Value: gzip

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.

1{
2 "errorText": "Error parsing 'language': Language tag 'en-ES' not supported",
3 "detailedError": {
4 "code": "BadRequest",
5 "message": "Error parsing 'language': Language tag 'en-ES' not supported",
6 "target": "language"
7 },
8 "httpStatusCode": "400"
9}
1<?xml version="1.0" encoding="UTF-8"?>
2<response>
3 <errorText>Error parsing 'language': Language tag 'en-ES' not supported</errorText>
4 <detailedError>
5 <code>BadRequest</code>
6 <message>Error parsing 'language': Language tag 'en-ES' not supported</message>
7 <target>language</target>
8 </detailedError>
9 <httpStatusCode>400</httpStatusCode>
10</response>

Error response fields

Primary fields

Description

errorText
string
A human-readable description of the error.
detailedError
object

Detailed information about the error.
detailedError object

httpStatusCode
integer

Response codes signifying failed requests to an API server.

detailedError object

Field Description
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.

target
string

Optional.
Target of the particular error.
Value: The name of the request parameter causing the error.

Additional information

Indexes abbreviation values

In some cases, list of indexes can be passed as a parameter to query, which should be listed with their abbreviations, available values are:

  • Geo = Geographies - areas on map which represent administrative divison of a land ie. country, state, city.
  • PAD = Point Addresses - points on map where specific address with street name and number can be found in index, ie. Soquel Dr 2501.
  • Addr = Address ranges - for some streets there are address points that are interpolated from the beginning and end of the street, those points are represented as address ranges.
  • Str = Streets - representation of streets on the map.
  • XStr = Cross Streets (intersections) - representations of junctions; places where two streets intersect.
  • POI = Points of Interest - points on map that are worth attention and may be interesting.