Fuzzy Search
Purpose
The generic, default service is Fuzzy Search which handles the most fuzzy of inputs containing any combination of Indexes abbreviation values. See the Indexes abbreviation values section at the bottom of this page.
This Search service is the canonical single line search. The service is a seamless combination of POI
, PAD
, Addr
, Geo
, Str
, XStr
search and geocoding. The service can be weighted with a contextual position (lat,lon
pair), or fully constrained by a position
and radius
, or it can be executed more generally without any geo biasing anchor point. It can also be used for predictive search by "guessing" user intentions.
The default behavior will be to search the entire world. If you want the result for a specific region(-s) use the countrySet
parameter, for example: countrySet=US,MX,USA,MEX
. See the Search API Market Coverage page for a list of all the countries supported by the Search API engine. Note: Most Search queries default to maxFuzzyLevel=2
to gain performance and also reduce unusual results. This new default can be overridden as needed per request by passing the parameter maxFuzzyLevel=3
or maxFuzzyLevel=4
in the query string.
Run this endpoint
You can easily run this and other endpoints. Go to the TomTom API Explorer page and follow the directions.
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.
Important note: this request will only work when the coordinates are the only elements in the {query}
parameter.
https://{baseURL}/search/{versionNumber}/search/{query}.{ext}?key={Your_API_Key}&typeahead={typeahead}&limit={limit}&ofs={ofs}&countrySet={countrySet}&lat={lat}&lon={lon}&radius={radius}&topLeft={topLeft}&btmRight={btmRight}&geobias={geobias}language={language}&idxSet={idxSet}&extendedPostalCodesFor={extendedPostalCodesFor}&minFuzzyLevel={minFuzzyLevel}&maxFuzzyLevel={maxFuzzyLevel}&categorySet={categorySet}&brandSet={brandSet}&connectorSet={connectorSet}&fuelSet={fuelSet}&vehicleTypeSet={vehicleTypeSet}&view={view}&openingHours={openingHours}&timeZone={timeZone}&mapcodes={mapcodes}&relatedPois={relatedPois}&minPowerKW={minPowerKW}&maxPowerKW={maxPowerKW}&entityTypeSet={entityTypeSet}
https://api.tomtom.com/search/2/search/123%20main%20st.json?key={Your_API_Key}
curl 'https://api.tomtom.com/search/2/search/123%20main%20st.json?key={Your_API_Key}'
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.
|
| Service version. |
| A valid response format. |
| An API Key valid for the requested service. See: How do I get a TomTom API Key? |
Optional parameters | Description |
---|---|
| The query string. It must be properly URL-encoded. |
| If the |
| Maximum number of responses that will be returned. |
| Starting offset of the returned results within the full result set. |
| Comma separated string of country codes in ISO 3166-1 alpha-2 or alpha-3
code formats (e.g., FR,ES or FRA,ESP). This will limit the search to the
specified countries. The choice of view may restrict which countries are
available. |
| Latitude, e.g., |
| Longitude, e.g., |
| If |
| Top-left position of the bounding box. Note: the
|
| Bottom-right position of the bounding box. Note: The
|
| Location bias for search, which can be specified in different shapes. Location bias is used to communicate a location preference to the search engine - for example, to bias search results to the user's viewport. Currently two types are supported: point and rectangle. Value: Colon-separated key-value pair, composed of type of shape as a key and the encoded shape as a value. Each shape has its own encoding format:
Usage examples:
Notes:
|
| Language in which search results should be returned. It should be one of
the TomTom supported
IETF language 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. |
| Indexes for which extended postal codes should be included in the
results.
|
| Minimum fuzzyness level to be used. |
| Maximum fuzzyness level to be used. |
| A comma-separated list of indexes which should be utilized for the
search.
|
| 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:
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
|
| List of opening hours for a POI (Points of Interest). |
| Used to indicate the mode in which the timeZone object should be
returned. |
| Enables the return of a comma-separated mapcodes list. 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 the Geography result of a specific entity type. If
Usage examples:
|
Request headers
Optional headers | Description |
---|---|
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 - JSON
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": 99,6 "numResults": 10,7 "offset": 0,8 "totalResults": 4427,9 "fuzzyLevel": 1,10 "geoBias": {11 "lat": 36.98844,12 "lon": -121.9748313 },14 "queryIntent": []15 },16 "results": []17}
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": 5,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": 731501520 }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": 031 },32 "endTime": {33 "date": "2019-02-05",34 "hour": 21,35 "minute": 036 }37 },38 {39 "startTime": {40 "date": "2019-02-06",41 "hour": 7,42 "minute": 043 },44 "endTime": {45 "date": "2019-02-06",46 "hour": 21,47 "minute": 048 }49 },50 {51 "startTime": {52 "date": "2019-02-07",53 "hour": 7,54 "minute": 055 },56 "endTime": {57 "date": "2019-02-07",58 "hour": 21,59 "minute": 060 }61 },62 {63 "startTime": {64 "date": "2019-02-08",65 "hour": 7,66 "minute": 067 },68 "endTime": {69 "date": "2019-02-08",70 "hour": 21,71 "minute": 072 }73 },74 {75 "startTime": {76 "date": "2019-02-09",77 "hour": 7,78 "minute": 079 },80 "endTime": {81 "date": "2019-02-09",82 "hour": 21,83 "minute": 084 }85 },86 {87 "startTime": {88 "date": "2019-02-10",89 "hour": 7,90 "minute": 091 },92 "endTime": {93 "date": "2019-02-10",94 "hour": 12,95 "minute": 096 }97 },98 {99 "startTime": {100 "date": "2019-02-10",101 "hour": 14,102 "minute": 0103 },104 "endTime": {105 "date": "2019-02-10",106 "hour": 21,107 "minute": 0108 }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.97483161 },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.97596196 },197 "btmRightPoint": {198 "lat": 36.98754,199 "lon": -121.9737200 }201 },202 "entryPoints": [203 {204 "type": "main",205 "position": {206 "lat": 36.98817,207 "lon": -121.97487208 }209 },210 {211 "type": "minor",212 "functions": ["FrontDoor"],213 "position": {214 "lat": 52.30987,215 "lon": 4.76093216 }217 }218 ],219 "addressRanges": {220 "rangeLeft": "1 - 3",221 "rangeRight": "2 - 12",222 "from": {223 "lat": 51.16561,224 "lon": 19.48489225 },226 "to": {227 "lat": 51.16545,228 "lon": 19.4863229 }230 },231 "chargingPark": {232 "connectors": [233 {234 "connectorType": "IEC62196Type2CCS",235 "ratedPowerKW": 22.2,236 "currentA": 32,237 "currentType": "AC3",238 "voltageV": 380239 },240 {241 "connectorType": "Tesla",242 "ratedPowerKW": 43.2,243 "currentA": 16,244 "currentType": "AC3",245 "voltageV": 480246 }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 the order that they appear in the response.
Primary fields | 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. |
| Response type. Can be |
| 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. |
| List of detected query intents. |
Query intent object | |
Field | Description |
| Type of query intent. One of:
|
| Details of query intent. Depends on the query intent type. See coordinate intent details, nearby intent details, W3W intent details, bookmark intent details |
Coordinate intent details object | |
Field | Description |
| Latitude of the (parsed) user input coordinate. See LatLon. The results will be places nearby this coordinate.
If |
| Longitude of the (parsed) user input coordinate. See LatLon. |
Nearby intent details object | |
Field | Description |
| Latitude of the place, near which the user searches for something. See LatLon. For example, for the input |
| Longitude of the place, near which the user searches for something. See LatLon. |
| Normalized phrase referring to what the user is searching for near some place. For example, for the input |
| Normalized phrase referring to where the user is searching for some place.
For example, for the input |
W3W intent details object | |
Field | Description |
| What3words address. For example, for the query |
Bookmark details object | |
Field | Description |
| One of: |
results array | |
Field | Description |
| Type of result. One of: |
| 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 of the result. A larger score means there is a probability that a result meeting the query criteria is higher. |
| 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. address object |
| Position of the result: |
| List of |
| A viewport which can be used to display the result on a map. |
| Optional section. Only present if |
| 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 chargingPark |
| 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 POI. |
| Telephone number. |
| The list of POI brands. |
| Website URL. |
| The list of POI categories.
|
| The list of the most specific POI categories. |
| List of opening hours for a POI (Points of Interest). |
| The list of POI category classifications. |
| Time zone information for the POI. |
categorySet array | |
Field | Description |
| Category id. A 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. |
boundingBox object | |
Field | Description |
| Top-left position of the bounding box. |
| Bottom-right position of the bounding box. |
entryPoints array | |
Field | Description |
| The main entry point. One of: |
| If present, represents the type of access for the POI. Example:
|
| Position of the entry point. |
addressRanges object | |
Field | Description |
| An address range on the left side of a street segment (assuming looking from the "from" end toward the "to" end). |
| An address range on the right side of a street segment (assuming looking from the "from" end toward the "to" end). |
| 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: 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 |
| 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 POI is being opened, or
the beginning of the range if it was opened before the range, inclusive. |
| 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. |
startTime object, endTime object | |
Field | Description |
| Represents current day in calendar year in POI time zone. |
| Hours are in the 24 hour format in the local time of a POI; possible
values are |
| Minutes are in the local time of a POI; possible values are
|
timeZone object | |
Field | Description |
| ID from the IANA Time Zone Database. |
Response codes
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:
|
| 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 data 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. Format:
| |
If requested by the client, the Search service applies gzip compression
to the responses with the
Accept-Encoding
header. | |
Tracking-ID | 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 | |
---|---|
Field | 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. Target of the particular error. |
Additional information
Coordinates in query
Fuzzy search will also detect if the user has entered coordinates as a query text. In such a case, the search will switch to the reverse geocoding mode, looking for entities closest to the specified location. Coordinates in format
[+-]<LATITUDE>[,; ][one or more space][+-]<LONGITUDE>
can be used together with the radius
parameter (if the radius
parameter is not provided as the default, radius value is equal to 2 km
).
<LATITUDE> - latitude value in format <value><.><value>. Range: +-90.0.<LONGITUDE> - longitude value in format <value><.><value>. Range: +-180.0.
Examples
12.123,14.5672
12.123;14.5672
12.123 14.5672
12.345678° N, 14.56789° E
12°34'56.7" N, 14°01'02.3" E
12°34.567' N, 14°56.789' W
Mapcodes in query
Fuzzy Search will also detect if the user has entered mapcodes as a query text. All mapcode types are supported:
Local
Alternative
International
Mapcodes in format
<TERRITORY>[space]<CODE>
<TERRITORY>
- the value is ISO 3166-1 alpha 3 abbreviation for the country name.- All alphabets are supported.
- It can be omitted when
International
mapcode is queried (for more details see the territory element).
<CODE>
- the value consists of two groups of letters and digits separated by a dot (for more details see the code element).
Examples
US-CA FS.WRH3
USA JJCH.H9DF
S4ZW4.990V
Indexes abbreviation values
In some cases, a list of indexes can be passed as a parameter to a query, which should be listed with their abbreviations. Available values are:
Geo
= Geographies - areas on a map which represent administrative division of a land i.e., country, state, city.PAD
= Point Addresses - points on a map where a specific address with a street name and number can be found in the index, i.e., 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.