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

Low Bandwidth Search


When building apps for mobile conserving bandwidth is extremely important. We have a shortened endpoint with a more compressed and concise response structure to help both save bandwidth and add some convenience to the client side parsing.

Request

Format

GET https://<baseURL>/search/<versionNumber>/s/<query>.<ext>?key=<apiKey>[&typeahead=<typeahead>][&limit=<limit>][&ofs=<ofs>][&lat=<lat>][&lon=<lon>][&countrySet=<countrySet>][&radius=<radius>][&topLeft=<topLeft>][&btmRight=<btmRight>][&language=<language>][&idxSet=<idxSet>][&view=<view>]
GET https://<baseURL>/search/<versionNumber>/cS/<category>.<ext>?key=<apiKey>[&typeahead=<typeahead>][&limit=<limit>][&ofs=<ofs>][&lat=<lat>][&lon=<lon>][&countrySet=<countrySet>][&radius=<radius>][&topLeft=<topLeft>][&btmRight=<btmRight>][&language=<language>][&idxSet=<idxSet>][&view=<view>]

Parameters

The table below 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.

Parameter Description Req'd? Type / Values Default value Max value
baseURL Base URL for calling the API. Yes api.tomtom.com
versionNumber Service version number. The current value is 2. Yes 2
query/category Query/Category string. Must be properly URL encoded. Yes String
ext Valid response formats are JSON, JSONP, JS or XML. Yes String
key Your TomTom API key. Yes String
[typeahead] If the "typeahead" flag is set, the query will be interpreted as a partial input and the search will enter predictive mode. No Boolean false
[limit] Maximum number of responses that will be returned. No Integer 10 100
[ofs] Starting offset of the returned results within the full result set. No Integer 0 1900
[lat] 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.
No Float
[lon] 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.
No Float
[countrySet] 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 and incompatible combinations will return error 400. No String
[radius] If radius and position are set, the results will be constrained to the defined area. The radius parameter is specified in meters.  No Integer
[topLeft] Top left position of the bounding box. This is specified as a comma separated string composed by lat., lon. (e.g.: 37.553,-122.453).
NOTE: Point-Radius parameters and Bounding box parameters are mutually exclusive, point radius parameters take precedence when both are passed in.
No Position
[btmRight] Bottom right position of the bounding box. This is specified as a comma separated string composed by lat., lon. (e.g.: 37.553,-122.453).
NOTE: Point-Radius parameters and Bounding box parameters are mutually exclusive, point radius parameters take precendence when both are passed in.
No Position
[language] Language in which search results should be returned. Should be one of supported IETF language tags, case insensitive. When data in specified language is not available for a specific field, default langauge is used. No String
[idxSet] The 'idxSet' parameter allows for fine tuning L2 by specifying which indexes to utilize for the search. The predefined 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)

Usage examples:

  • idxSet=POI (search Points Of Interest only)
  • idxSet=PAD,Addr (search addresses only)
No String
[view] Geopolitical View. The context used to resolve handling disputed territories. Views include Unified, along with IN, PK, IL and MA, which are tailored for India, Pakistan, Israel and Morocco, respectively. No String Unified.
IN overrides in India.

Response

Format

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 response field documentation below for more information.

When requesting JSON output the response has the following structure:

    {
        "s": 200,
        "sum": {
            "q": "pizza",
            "t": "NON_NEAR"
        },
        "r": []
    }
    

Each element of the results array is in the format:

    {
        "id": "US/POI/p0/9033556",
        "tp": "POI",
        "etp": "",
        "a1": "2501 Soquel Dr",
        "a2": "Santa Cruz, CA 95065",
        "cc": "US",
        "nm": "Upper Crust Pizza & Pasta",
        "ph": "+(1)-(831)-4762333",
        "ul": "www.uppercrustsc.com/",
        "ps": "36.98844 -121.97483",
        "gh": "9q962ms9k2yx",
        "ct": [
            "pizza",
            "restaurant"
        ],
        "cst": [
            {
                "cd": "RESTAURANT",
                "ns": [
                    {
                        "nl": "en-US",
                        "na": "pizza"
                    },
                    {
                        "nl": "en-US",
                        "na": "restaurant"
                    }
                ]
            }
        ]
    }
    

Response fields

The tables below describe 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.

Field Description Type / Values
Response
s Response status code. 200 denotes success. 200
sum Summary information about the search that was performed. Summary
r Result list, sorted in descending order by score. Result[]
Summary
q Query as interpreted by the search engine. String
t Response type. * see response types below. String
Result
id Non-stable id for this Result. String
tp Type of Result. One of:

  • POI
  • Street
  • Geography
  • Point Address
  • Cross Street
etp Optional section. Only present if type == Geography. One of:

  • County
  • CountrySubdivision
  • CountrySecondarySubdivision
  • CountryTertiarySubdivision
  • Municipality
  • MunicipalitySubdivision
  • Neighbourhood
  • PostalCodeArea
a1 Address line 1. String
a2 Address line 2. String
cc Country. String
nm Name of the POI. String
ph Telephone number. String
ul Website URL. String
ps Position. String
gh Geohash. String
ct The list of POI categories.
DEPRECATED1: Use cst instead.
Category[]
cst The list of POI category classifications. Classification[]
Classification
cd Fixed top level category code. Category Code
ns List of category names with locale code. information. Currently only "en-US" locale is returned. Name[]
Name
nl Locale code of this category name. String
na Category name in given locale. String

Response codes

Code Meaning and 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.

Response headers

Header Description Value
Access-Control-Allow-Origin Ensures that clients that implement the CORS security model are able to access the response from this service. *
Content-Type Indicates the format of the response, as chosen by the client. Format: type/subtype; charset=utf-8 type/subtype is one of:

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

1May 1, 2018: The ct response field has been deprecated and will be withdrawn following a 12 month deprecation period. The planned withdrawal date is May 1, 2019.