Sorry, you need to enable JavaScript to visit this website.

Fuzzy Search

 

Service version: 2
Last edit: 2019.03.28

On this page

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.

  • This 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
  • See Market Coverage Search for a list of all the countries supported by the Search 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.

  1. Go to the TomTom API Explorer page.
  2. Click an endpoint.
    1. Click Try it out.
    2. Enter/select all required parameter values and any optional parameter values.
    3. At the bottom of the form, click Execute.
  3. Review the Response.

Request data

HTTPS Method: GET

URL format

Important note: This Request will only work when the coordinates are the only elements in the <query> part.

GET 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>][&language=<language>][&idxSet=<idxSet>][&extendedPostalCodesFor=<extendedPostalCodesFor>][&minFuzzyLevel=<minFuzzyLevel>][&maxFuzzyLevel=<maxFuzzyLevel>][&view=<view>]

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, which are highlighted with [square brackets], 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
Parameter Description
baseURL
string
Base URL for calling the API.
Value: api.tomtom.com
versionNumber
string
Service version number.
Value: The current value is 2.
query
string
Query string.
Value:

  • Must be properly URL encoded.
  • A user can provide latitude and longitude coordinates directly in the query.
  • Details can be found in the Coordinates in query section.
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.
Optional parameters
Parameter Description
[typeahead]
boolean
If the "typeahead" flag is set, the query will be interpreted as a partial input, and the search will enter predictive mode.
Default value: false
[limit]
integer
Maximum number of responses that will be returned.
Default value: 10
Maximum value: 100
[ofs]
integer
Starting offset of the returned results within the full result set.
Default value: 0
Maximum value: 1900
[countrySet]
string
Comma separated string of country codes (e.g., FR,ES).

  • This will limit the search to the specified countries.
  • The choice of view may restrict which countries are available.

Value: FR,ES,etc.

[lat]
float
Latitude, e.g., lat=37.337 lat,lon where results should be biased.
Note: supplying a lat/lon without a radius will only bias the search results to that area.
Value: 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.
Note: supplying a lat/lon without a radius will only bias the search results to that area.
Value: min/max: -180 to +180
Reference: Latitude, Longitude and Coordinate System Grids
[radius]
integer
Value: A radius in meters.
If radius and position are set:

  • The results will be constrained to the defined area.
  • The radius parameter is specified in meters.
[topLeft]
string
Top left position of the bounding box.
Note: The [topLeft] parameter should always go along with the [btmRight] parameter as they both define the bounding box. Value: A comma-separated string composed by lat,lon.

  • This is specified as a comma-separated string composed by lat,lon. (e.g., 37.553,-122.453).
  • Important note: Point-Radius parameters and Bounding box parameters are mutually exclusive.
  • Point radius parameters take precedence when both are passed.
[btmRight]
string
Bottom right position of the bounding box.
Note: The [btmRight] parameter should always go along with the [topLeft] parameter as they both define the bounding box. Value: A comma-separated string composed by lat,lon.

  • This is specified as a comma-separated string composed by lat,lon (e.g., 37.553,-122.453).
  • Important note: Point-Radius parameters and Bounding box parameters are mutually exclusive.
  • Point radius parameters take precedence when both are passed.
[language]
string
Language in which search results should be returned.

  • Should be one of the TomTom supported IETF language tags, case insensitive
  • When data in a specified language is not available for a specific field, the default language is used.

Value: One of the TomTom supported IETF language tags.

[extendedPostalCodesFor]
string
Indexes for which extended postal codes should be included in the results.
Value: A comma-separated list of index types (in any order).

  • Available values are described in the Additional information: Indexes abbreviation values section.
  • 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.

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.

[minFuzzyLevel]
integer
Minimum fuzzyness level to be used.
Default value: 1
Maximum value: 4
[maxFuzzyLevel]
integer
Maximum fuzzyness level to be used.
Default value: 2
Maximum value: 4
[idxSet]
string
A comma-separated list of indexes which should be utilized for the search.
Value: A comma-separated list of index types (in any order).

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 Points Of Interest of specific categories. The list of categories can be discovered using POI Categories endpoint.
Value: A comma-separated list of category identifiers (in any order).

  • Item order does not matter.
  • 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 category either Italian or 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).

  • Item order does not matter.
  • 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 "," in their name should be put into quotes, for example: "A,B,C Comma".

Usage examples:

  • brandSet=Tomtom (search Points Of Interest of ¨Tomtom¨ brand)
  • brandSet=Tomtom,Foobar (search Points Of Interest of ¨Tomtom¨ brand OR ¨Foobar¨ brand)
  • brandSet=¨A,B,C Comma¨ (search Points Of Interest of ¨A,B,C Comma¨ brand)
[connectorSet]
string
A comma-separated list of connector types which could be used to restrict the result to Points Of Interest of type Electric Vehicle Station supporting specific connector types. List of supported connector types
Value: A comma-separated list of connector types (in any order).

  • Item order does not matter.
  • 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)
[view]
string
Geopolitical view. The context used to resolve handling disputed territories.

  • Views include Unified, along with IN, PK, IL, MA and AR, which are respectively tailored for India, Pakistan, Israel, Morocco, and Argentina.
  • When this parameter is not used, the defaulting behavior will assign the following views. India: IN, Pakistan: PK, Morocco: MA, Argentina: AR, others: Unified.

Default values:

  • Argentina, default view: AR, available views: Unified, IL, IN, MA, PK
  • India, default view: IN, available views: -
  • Morocco, default view: MA, available views: Unified, AR, IL, IN, PK
  • Pakistan, default view: PK, available views: Unified, AR, IL, IN, MA
  • Others, default view: Unified, available views: AR, IL, IN, MA, PK
[openingHours]
string
List of opening hours for a POI (Points of Interest).

  • nextSevenDays mode shows the opening hours for next week, starting with the current day in the local time of the POI.

Value:

  • openingHours=nextSevenDays

▲ Return to top

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:

{
  "summary": {
    "query": "pizza",
    "queryType": "NON_NEAR",
    "queryTime": 99,
    "numResults": 10,
    "offset": 0,
    "totalResults": 4427,
    "fuzzyLevel": 1,
    "geoBias": {
      "lat": 36.98844,
      "lon": -121.97483
    }
  },
  "results": []
}

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

{
  "type": "POI",
  "id": "US/POI/p0/9033556",
  "score": 5,
  "dist": 0,
  "info": "search:ta:840061001865142-US",
  "entityType": "Municipality",
  "poi": {
      "name": "Upper Crust Pizza & Pasta",
      "phone": "+(1)-(831)-4762333",
      "url": "www.uppercrustsc.com/",
      "brands": [
        {
          "name": "Upper Crust"
        }
      ],
      "categorySet": [
        {
          "id": 7315015
        }
      ],
      "categories": [
          "pizza",
          "restaurant"
      ],
      "classifications": [
        {
          "code": "RESTAURANT",
          "names": [
            {
              "nameLocale": "en-US",
              "name": "pizza"
            },
            {
              "nameLocale": "en-US",
              "name": "restaurant"
            }
         ]
      }
    ]
  },
  "address": {
    "streetNumber": "2501",
    "streetName": "Soquel Dr",
    "municipalitySubdivision": "Santa Cruz, Live Oak",
    "municipality": "Santa Cruz, Live Oak",
    "countrySecondarySubdivision": "Santa Cruz",
    "countryTertiarySubdivision": "Santa Cruz",
    "countrySubdivision": "CA",
    "postalCode": "95065",
    "extendedPostalCode": "950652023",
    "countryCode": "US",
    "country": "United States Of America",
    "countryCodeISO3": "USA",
    "freeformAddress": "2501 Soquel Dr, Santa Cruz, CA 95065",
    "countrySubdivisionName": "California",
    "localName": "Santa Cruz"
  },
  "position": {
    "lat": 36.98844,
    "lon": -121.97483
  },
  "viewport": {
    "topLeftPoint": {
      "lat": 36.98934,
      "lon": -121.97596
    },
    "btmRightPoint": {
      "lat": 36.98754,
      "lon": -121.9737
    }
  },
  "entryPoints": [
    {
      "type": "main",
      "position": {
        "lat": 36.98817,
        "lon": -121.97487
      }
    }
  ],
  "addressRanges": {
    "rangeLeft": "1 - 3",
    "rangeRight": "2 - 12",
    "from": {
      "lat": 51.16561,
      "lon": 19.48489
    },
    "to": {
      "lat": 51.16545,
      "lon": 19.4863
    }
  },
  "dataSources": {
    "geometry": {
      "id": "00004e4c-3100-3c00-0000-0000685e23c7"
    },
  "openingHours": {
    "mode": "NEXT_SEVEN_DAYS",
    "timeRanges": [
      {
        "startTime": {
          "date": "2019-02-05",
          "hour": 7,
          "minute": 0
        },
        "endTime": {
          "date": "2019-02-05",
          "hour": 21,
          "minute": 0
        }
      },
      {
        "startTime": {
          "date": "2019-02-06",
          "hour": 7,
          "minute": 0
        },
        "endTime": {
          "date": "2019-02-06",
          "hour": 21,
          "minute": 0
        }
      },
      {
        "startTime": {
          "date": "2019-02-07",
          "hour": 7,
          "minute": 0
        },
        "endTime": {
          "date": "2019-02-07",
          "hour": 21,
          "minute": 0
        }
      },
      {
        "startTime": {
          "date": "2019-02-08",
          "hour": 7,
          "minute": 0
        },
        "endTime": {
          "date": "2019-02-08",
          "hour": 21,
          "minute": 0
        }
      },
      {
        "startTime": {
          "date": "2019-02-09",
          "hour": 7,
          "minute": 0
        },
        "endTime": {
          "date": "2019-02-09",
          "hour": 21,
          "minute": 0
        }
      },
      {
        "startTime": {
          "date": "2019-02-10",
          "hour": 7,
          "minute": 0
        },
        "endTime": {
          "date": "2019-02-10",
          "hour": 12,
          "minute": 0
        }
      },
      {
        "startTime": {
          "date": "2019-02-10",
          "hour": 14,
          "minute": 0
        },
        "endTime": {
          "date": "2019-02-10",
          "hour": 21,
          "minute": 0
        }
      }
    ]
  }
}
}

▲ Return to top

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.
  • 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
comma separated string composed by lat,lon
Position used to bias the Results:
LatLon double
Example: 37.819722,-122.478611
results[] array
Field Description
type
string
Type of Result. One of:

  • POI
  • Street
  • Geography
  • Point Address
  • Address Range
  • Cross Street
id
string
Non-stable id for this Result.
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. One of:

  • County
  • CountrySubdivision
  • CountrySecondarySubdivision
  • CountryTertiarySubdivision
  • Municipality
  • MunicipalitySubdivision
  • Neighbourhood
  • PostalCodeArea
poi
object
Optional section. Only present if type == POI.
poi{} object
address
object
Structured address for the Result.
address{} object
position
object
Position of the Result:
LatLon
Example: 37.819722,-122.478611
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{} object
addressRanges
object
Address ranges on a street segment.
Available only for Results where the
Result type is equal to "Address Range".
addressRanges{} 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.
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
classifications
array
The list of POI category classifications.
classifications[] array
openingHours
object
List of opening hours for a POI (Points of Interest).
openingHours{} object
categorySet[] array
Field Description
id
number
Category id. Full list of available categories is available under POI Categories endpoint.
brands[] array
Field Description
name
string
Brand name.
classifications[] array
Field Description
code
string
Fixed top level category code. Category Code
names
array
List of category names with locale code information.
Currently only "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.
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
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 formatting
rules of a Result's country of origin,or in case
of countries its full country name.
countrySubdivisionName
string
A full name of a first level of country administrative hierarchy.

  • This field appears only in case countrySubdivision is presented in an abbreviated form.
  • Supported only for USA, Canada and Great Britain.
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.
viewport{} object
Field Description
topLeftPoint
comma separated string composed by lat,lon
Top left corner of the rectangle:
LatLon double
btmRightPoint
comma separated string composed by lat,lon
Bottom right corner of the rectangle:
LatLon double
entryPoints[] array
Field Description
type
string
Main entry point: One of:

  • main
  • minor
position
string
Position of the entry point:
LatLon double
Example: 37.819722,-122.478611
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
string
A beginning point of a street segment:
LatLon double
to
string
An end point of a street segment:
LatLon double
dataSources{} object
Field Description
geometry
object
Information about the geometric shape of the result. Only present if type == Geography or POI.
id
string
Pass this as geometryId to the Additional Data service to fetch geometry information for this result.
LatLon
Field Description
lat
float
Latitude. Reference: Latitude, Longitude and Coordinate System Grids
lon
float
Longitude. Reference: Latitude, Longitude and Coordinate System Grids
openingHours{} object
mode
string
Mode used in the Request.
timeRanges
array
List of time ranges for the next 7 days.
timeRanges[] array
timeRanges[] array
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, endTime{} object
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.

▲ Return to top

HTTP Response codes

The following data 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.
5xx Server Error: The service was unable to process your Request. Contact support to resolve the issue.

▲ Return to top

Response headers

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

Response headers
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
Value: type/subtype is one of:

  • application/json
  • text/javascript
  • text/xml

Additional information

Coordinates in query

Fuzzy search will also detect if the user has entered coordinates as a query text. In such 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

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

▲ Return to top

You are here