Geometry Search
Public Preview Notice
Important notes:
- This TomTom Orbis Maps Search API document collection is in Public Preview. Go to the Public Preview - what is it? page to see what this means.
- This API is powered by TomTom Orbis Maps.
- See the TomTom Orbis Maps documentation for more information.
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.
For performance reasons and large data sets, you may use Content-Encoding: gzip
, Content-Type: application/json
, and Accept-Encoding: gzip
headers together with the compressed payload.
POST
is recommended for all datasets.POST
requests require theContent-Type
header to be set toapplication/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":600016 },17 {18 "type":"CIRCLE",19 "position":"37.31205,-121.36434",20 "radius":100021 }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":600015 },16 {17 "type":"CIRCLE",18 "position":"37.31205,-121.36434",19 "radius":100020 }21]
Request data
HTTPS Method: POST
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.
Important note: Either apiVersion
parameter or TomTom-Api-Version
header needs to be present.
https://{baseURL}/maps/orbis/places/geometrySearch/{query}.{ext}?key={Your_API_Key}&apiVersion={apiVersion}&geometryList={geometryList}&limit={limit}&language={language}&idxSet={idxSet}&extendedPostalCodesFor={extendedPostalCodesFor}&categorySet={categorySet}&brandSet={brandSet}&connectorSet={connectorSet}&fuelSet={fuelSet}&vehicleTypeSet={vehicleTypeSet}&view={view}&openingHours={openingHours}&timeZone={timeZone}&mapcodes={mapcodes}&minPowerKW={minPowerKW}&maxPowerKW={maxPowerKW}&entityTypeSet={entityTypeSet}
1https://api.tomtom.com/maps/orbis/places/geometrySearch/pizza.json?key={Your_API_Key}&apiVersion=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":600015 },16 {17 "type":"CIRCLE",18 "position":"37.31205,-121.36434",19 "radius":100020 }21]
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":600016 },17 {18 "type":"CIRCLE",19 "position":"37.31205,-121.36434",20 "radius":100021 }22 ]23}' 'https://api.tomtom.com/maps/orbis/places/geometrySearch/pizza.json?key={Your_API_Key}&apiVersion=1'
HTTPS Method: GET
https://{baseURL}/maps/orbis/places/geometrySearch/{query}.{ext}?key={Your_API_Key}&apiVersion={apiVersion}&lat={lat}&lon={lon}&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}&minPowerKW={minPowerKW}&maxPowerKW={maxPowerKW}&entityTypeSet={entityTypeSet}
1https://api.tomtom.com/maps/orbis/places/geometrySearch/pizza.json?key={Your_API_Key}&apiVersion=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":600015 },16 {17 "type":"CIRCLE",18 "position":"37.31205,-121.36434",19 "radius":100020 }21]
1curl 'https://api.tomtom.com/maps/orbis/places/geometrySearch/pizza.json?key={Your_API_Key}&apiVersion=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":600015 },16 {17 "type":"CIRCLE",18 "position":"37.31205,-121.36434",19 "radius":100020 }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 |
---|---|
| Base URL for calling the API.
|
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).
The format is as in the example above. The circle radius unit is in meters and must be greater than get Example vertices list/array of geometries - JSON
|
Optional parameters | Description |
---|---|
| Service version. |
| The query string. It must be properly URL-encoded. |
| The maximum number of responses that will be returned. |
| 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. |
float | Latitude, e.g., |
float | Longitude, e.g., |
| 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
Extended postal code is returned as an |
| The
Values: See the preceding list of pre-defined indexes.
|
| 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.
|
| A comma-separated list of brand names which could be used to restrict
the result to Points Of Interest of specific brands.
|
| 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.
|
| 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). |
| 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). |
| A comma-separated list of fuel types which could be used to restrict the
result to the Points Of Interest of specific fuels. If
Usage examples:
|
| A comma-separated list of vehicle types that could be used to restrict the
result to the Points Of Interest of specific vehicles. If
Usage examples:
|
| Geopolitical View. The context used to resolve the handling of disputed
territories. Views include only |
| List of opening hours for a POI (Points of Interest). |
| Used to indicate the mode in which the |
| 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.
|
| An optional parameter that provides the possibility to return related
Points Of Interest.
|
| 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
Usage examples:
|
Request headers
Optional headers | Description |
---|---|
TomTom-Api-Version | Service version. |
Enables response compression. | |
Tracking-ID | Specifies an identifier for the request. It can be used to trace a call.
The value must match the regular expression
|
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 "queryTime": 82,5 "numResults": 10,6 "totalResults": 479,7 "geoBias": {8 "lat": 36.98844,9 "lon": -121.9748310 }11 },12 "results": []13}
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 "entityType": "Municipality",7 "poi": {8 "name": "Upper Crust Pizza & Pasta",9 "phone": "+(1)-(831)-4762333",10 "url": "www.uppercrustsc.com/",11 "brands": [12 {13 "name": "Upper Crust"14 }15 ],16 "categorySet": [17 {18 "id": 731501519 }20 ],21 "openingHours": {22 "mode": "nextSevenDays",23 "timeRanges": [24 {25 "startTime": {26 "date": "2019-02-05",27 "hour": 7,28 "minute": 029 },30 "endTime": {31 "date": "2019-02-05",32 "hour": 21,33 "minute": 034 }35 },36 {37 "startTime": {38 "date": "2019-02-06",39 "hour": 7,40 "minute": 041 },42 "endTime": {43 "date": "2019-02-06",44 "hour": 21,45 "minute": 046 }47 },48 {49 "startTime": {50 "date": "2019-02-07",51 "hour": 7,52 "minute": 053 },54 "endTime": {55 "date": "2019-02-07",56 "hour": 21,57 "minute": 058 }59 },60 {61 "startTime": {62 "date": "2019-02-08",63 "hour": 7,64 "minute": 065 },66 "endTime": {67 "date": "2019-02-08",68 "hour": 21,69 "minute": 070 }71 },72 {73 "startTime": {74 "date": "2019-02-09",75 "hour": 7,76 "minute": 077 },78 "endTime": {79 "date": "2019-02-09",80 "hour": 21,81 "minute": 082 }83 },84 {85 "startTime": {86 "date": "2019-02-10",87 "hour": 7,88 "minute": 089 },90 "endTime": {91 "date": "2019-02-10",92 "hour": 12,93 "minute": 094 }95 },96 {97 "startTime": {98 "date": "2019-02-10",99 "hour": 14,100 "minute": 0101 },102 "endTime": {103 "date": "2019-02-10",104 "hour": 21,105 "minute": 0106 }107 }108 ]109 },110 "timeZone": {111 "ianaId": "Europe/Andorra"112 },113 "features": [114 {115 "order": 0,116 "category": "company_or_office",117 "group": "business"118 },119 {120 "order": 1,121 "category": "theater",122 "group": "cultural"123 }124 ]125 },126 "address": {127 "streetNumber": "2501",128 "streetName": "Soquel Dr",129 "municipalitySubdivision": "Santa Cruz, Live Oak",130 "municipality": "Santa Cruz, Live Oak",131 "countrySecondarySubdivision": "Santa Cruz",132 "countryTertiarySubdivision": "Santa Cruz",133 "countrySubdivision": "CA",134 "postalCode": "95065",135 "extendedPostalCode": "950652023",136 "countryCode": "US",137 "country": "United States Of America",138 "countryCodeISO3": "USA",139 "freeformAddress": "2501 Soquel Dr, Santa Cruz, CA 95065",140 "countrySubdivisionName": "California",141 "localName": "Santa Cruz"142 },143 "position": {144 "lat": 36.98844,145 "lon": -121.97483146 },147 "mapcodes": [148 {149 "type": "Local",150 "fullMapcode": "US-CA FS.WRH3",151 "territory": "US-CA",152 "code": "FS.WRH3"153 },154 {155 "type": "International",156 "fullMapcode": "S4ZW4.990V"157 },158 {159 "type": "Alternative",160 "fullMapcode": "US-CA 4349.S8W",161 "territory": "US-CA",162 "code": "4349.S8W"163 },164 {165 "type": "Alternative",166 "fullMapcode": "US-CA JJCH.H9DF",167 "territory": "US-CA",168 "code": "JJCH.H9DF"169 },170 {171 "type": "Alternative",172 "fullMapcode": "USA JJCH.H9DF",173 "territory": "USA",174 "code": "JJCH.H9DF"175 }176 ],177 "viewport": {178 "topLeftPoint": {179 "lat": 36.98934,180 "lon": -121.97596181 },182 "btmRightPoint": {183 "lat": 36.98754,184 "lon": -121.9737185 }186 },187 "entryPoints": [188 {189 "type": "main",190 "position": {191 "lat": 36.98817,192 "lon": -121.97487193 }194 },195 {196 "type": "minor",197 "functions": ["FrontDoor"],198 "position": {199 "lat": 52.30987,200 "lon": 4.76093201 }202 }203 ],204 "addressRanges": {205 "rangeLeft": "1 - 3",206 "rangeRight": "2 - 12",207 "from": {208 "lat": 51.16561,209 "lon": 19.48489210 },211 "to": {212 "lat": 51.16545,213 "lon": 19.4863214 }215 },216 "chargingPark": {217 "connectors": [218 {219 "connectorType": "IEC62196Type2CCS",220 "ratedPowerKW": 22.2,221 "currentA": 32,222 "currentType": "AC3",223 "voltageV": 380224 },225 {226 "connectorType": "Tesla",227 "ratedPowerKW": 43.2,228 "currentA": 16,229 "currentType": "AC3",230 "voltageV": 480231 }232 ]233 },234 "dataSources": {235 "chargingAvailability": {236 "id": "442009000132285"237 },238 "parkingAvailability": {239 "id": "00000000-0005-36de-0009-20d4467654e2"240 },241 "fuelPrice": {242 "id": "1:cf81fe50-6218-11ea-a677-d05099d5f839"243 },244 "geometry": {245 "id": "00004e4c-3100-3c00-0000-0000685e23c7"246 }247 }248}
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 information about the search that was performed. |
| Result list, sorted in descending order by score. |
summary object | |
Field | Description |
| Query as interpreted by the search engine. |
| Time spent on resolving the query. |
| Number of results in the response. |
| Starting offset of the returned results within the full result set.
|
| Total number of results found. |
| Maximum fuzzy level required to provide results.
|
| Position used to bias the results. |
results array | |
Field | Description |
| Type of result. |
| A stable unique id for the POI index, and a non-stable unique id for the
other indexes. |
| Score of the result. |
| Unit: meters. This is the distance to an object if |
| Information about the original data source of the result.
|
| Optional section. Only present if
|
| Information about the Points of Interest in the result. Optional
section. Only present if |
| List of related Points Of Interest.
|
| Structured address for the result. |
| Position of the result: |
| List of mapcode objects |
| A viewport which can be used to display the result on a map. |
| List of entry points of the POI. |
| Address ranges on a street segment. Available only for results where the
result type is equal to "Address Range". |
| A list of |
| Optional section. Reference ids for use with the
Additional Data
service. |
| Optional section. List of fuel types served by the petrol station. |
| Optional section. List of vehicle types supported by the petrol station. |
poi object | |
Field | Description |
| Name of the |
| Telephone number. |
| The list of |
| Website URL. |
| The list of the most specific |
| List of opening hours for a |
| The list of
|
| Time zone information for the |
| The list of the POI features. |
categorySet array | |
Field | Description |
| Category id. Full list of available categories is available under the POI Categories endpoint. |
brands array | |
Field | Description |
| Brand name. |
classifications array | |
Field | Description |
| Fixed top level category code. Supported Category Codes |
| List of category names with locale code information. Currently only the
|
names array | |
Field | Description |
| Locale code of this category name. |
| Category name in given locale. |
relatedPois object | |
Field | Description |
| Relation type: |
| Pass this as |
address object | |
Field | Description |
| The building number on the street. |
| The street name. |
| Sub City |
| Sub Sub City |
| Neighbourhood |
| City / Town. |
| County. |
| Named Area. |
| State or Province. |
| Postal Code / Zip Code. |
| 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
|
| Extended postal code (availability dependent on region). |
| Country. Note: this is a two-letter code, not a country name. |
| Country name. |
| ISO alpha-3 country code. |
| 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
|
| The full name of the first level of a country's administrative
hierarchy. This field appears only in case
|
|
|
| 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 of mapcode. |
| The full form of a mapcode ( |
| The
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
|
| The mapcode without the |
viewport object | |
Field | Description |
| Top-left corner of the rectangle: |
| Bottom-right corner of the rectangle: |
entryPoints array | |
Field | Description |
| The main entry point. One of: |
| If present, represents the type of access for the |
| Position of the entry point: |
addressRanges object | |
Field | Description |
| An address range on the left side of a street segment |
| An address range on the right side of a street segment |
| A beginning point of a street segment. |
| An end point of a street segment. |
chargingPark object | |
Field | Description |
| A list of connectors available in the Points Of Interest of an Electric
Vehicle Station type. |
connectors array | |
Field | Description |
| Type of the connector available in Electric Vehicle Station. See the: List of supported connector types. |
| Rated power of the connector in kilowatts (kW). |
| Current value of the connector in amperes (A). |
| Current type of the connector. |
| Voltage of the connector in Volts (V). |
dataSources object | |
Field | Description |
| Information about the charging stations availability. Only present if
|
| Information about the parking site availability. Only present if
|
| Information about the fuel station prices. Only present if
|
| Information about the geometric shape of the result. Only present if
|
chargingAvailability object | |
Field | Description |
| Pass this as |
parkingAvailability object | |
Field | Description |
string | Pass this as |
fuelPrice object | |
Field | Description |
| Pass this as |
geometry object | |
Field | Description |
| Pass this as |
| Name of an additional data provider. |
LatLon | |
Field | Description |
| Latitude. min/max: |
| Longitude. min/max: |
openingHours object | |
Field | Description |
| Mode used in the request. |
| List of time ranges for the next 7 days. |
timeRanges array | |
Field | Description |
| The point in the next 7 days range when a given |
| The point in the next 7 days range when a given |
startTime object | |
Field | Description |
| Represents the current day in the calendar year in the |
| Hours are in the 24 hour format in the local time of a |
| Minutes are in the local time of a |
endTime object | |
Field | Description |
| Represents current day in calendar year in |
| Hours are in the 24 hour format in the local time of a |
| Minutes are in the local time of a |
timeZone object | |
Field | Description |
| ID from the IANA Time Zone Database. |
features array | |
Field | Description |
| The order is a 0-based value indicating relative order. The order defines the importance of the category. |
| The POI feature category. |
| The group of the POI feature category. |
Response codes
The following table contains response codes signifying successful and failed requests to an API server.
Code | Meaning & possible causes |
---|---|
| OK : The search successfully returned zero or more results. |
| Bad Request : One or more parameters were incorrectly specified. |
| Forbidden : Possible causes include: Service requires SSL, Not authorized, Rate or volume limit exceeded, Unknown referer |
| Method Not Allowed : The HTTP method ( |
| Not Found : The HTTP request method ( |
| Too Many Requests : The API Key is over QPS (Queries per second). |
| 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 |
---|---|
Ensures that clients implementing the CORS security model are able to
access the response from this service. | |
Indicates the format of the response, as chosen by the client. | |
If requested by the client, the Search service applies gzip compression
to the responses with the Accept-Encoding header. | |
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 |
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 |
---|---|
| A human-readable description of the error. |
| Detailed information about the error. |
| Response codes signifying failed requests to an API server. |
detailedError object | |
Field | Description |
| One of a server-defined set of error codes. |
| 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. |
| Optional. |
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.