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

Structured Geocode


Search API can also be accessed for structured address look up exclusively. The geocoding search index will be queried for everything above the street level data. No POIs will be returned. Note that the geocoder is very tolerant of typos and incomplete addresses. It will also handle everything from exact street addresses or street or intersections as well as higher level geographies such as city centers, counties, states etc.

Request

Format

GET https://<baseURL>/search/<versionNumber>/structuredGeocode.<ext>?key=<apiKey>&countryCode=<countryCode>[&limit=<limit>][&ofss=<ofss>][&streetNumber=<streetNumber>][&streetName=<streetName>][&crossStreet=<crossStreet>][&municipality=<municipality>][&municipalitySubdivision=<municipalitySubdivision>][&countryTertiarySubdivision=<countryTertiarySubdivision>][&countrySecondarySubdivision=<countrySecondarySubdivision>][&countrySubdivision=<countrySubdivision>][&postalCode=<postalCode>][&language=<language>][&extendedPostalCodesFor=<extendedPostalCodesFor>]

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
ext Valid response formats are JSON, JSONP, JS or XML. Yes String
countryCode 2 or 3 letter country code (e.g.: FR, ES). Yes String
key Your TomTom API Key. Yes String
[limit] Maximum number of responses that will be returned. No Integer 10
[ofs] Starting offset of the returned results within the full result set. No Integer 0
[streetNumber]

 

The street number for the structured address. No String
[streetName] The street name for the structured address. No String
[crossStreet]

 

The cross street name for the structured address. No String
[municipality] The municipality (city/town) for the structured address. No String
[municipalitySubdivision] The municipality subdivision (sub/super city) for the structured address. No String
[countryTertiarySubdivision] The named area for the structured address. No String
[countrySecondarySubdivision] The county for the structured address. No String
[countrySubdivision] The state or province for the structured address. No String
[postalCode] The zip code or postal code for the structured address. No String
[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
[extendedPostalCodesFor] indexes for which extended postal codes should be included in the results.Available values are described in 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=Geo
  • extendedPostalCodesFor=PAD,Addr
  • extendedPostalCodesFor=None

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

No String

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:

{
    "summary": {
        "query": "2501 soquel dr",
        "queryType": "NON_NEAR",
        "queryTime": 21,
        "numResults": 1,
        "offset": 0,
        "totalResults": 1,
        "fuzzyLevel": 1
    },
    "results": []
}

Each element of the results array is in the format:

{
    "type": "Point Address",
    "id": "US/PAD/p0/45619296",
    "score": 7.675,
    "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"
    },
    "position": {
        "lat": 36.98844,
        "lon": -121.97482
    },
    "viewport": {
        "topLeftPoint": {
            "lat": 36.98934,
            "lon": -121.97595
        },
        "btmRightPoint": {
            "lat": 36.98754,
            "lon": -121.97369
        }
    },
    "entryPoints": [
        {
            "type": "main",
            "position": {
                "lat": 36.98817,
                "lon": -121.97487
            }
        }
    ],
    "addressRanges": {
        "rangeLeft": "1 - 99",
        "rangeRight": "2 - 130",
        "from": {
            "lat": 37.33666,
            "lon": -121.88951
        },
        "to": {
            "lat": 37.338,
            "lon": -121.89049
        }
    },
    "dataSources": {
        "geometry": {
            "id": "0000504c-3200-4600-0000-0000478d98c6"
        }
    }
}

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
summary Summary information about the search that was performed. Summary
results Result list, sorted in descending order by score. Result[]
Summary
query Query as interpreted by the search engine. String
queryType Response type. * see response types below. String
queryTime Time spent on resolving the query. Integer
numResults Number of Results in the response. Integer
offset Starting offset of the returned Results within the full Result set. Integer
totalResults Total number of Results found. Integer
fuzzyLevel Maximum fuzzy level required to provide Results. Integer
geoBias Position used to bias the Results. LatLon
Result
type Type of Result. One of:

  • POI
  • Street
  • Geography
  • Point Address
  • Address Range
  • Cross Street
id Non-stable id for this Result. String
score Score of the Result. Larger score means that probability that a Result meets query criteria is higher. Double
dist Unit: meters. Double
address Structured address for the Result. Address
position Position of the Result. LatLon
viewport A viewport which can be used to display the Result on a map. Viewport
entrypoints List of entry points of the POI. Entrypoint[]
addressRanges Address ranges on a street segment. Available only for Results where Result type is equal to "Address Range". AddressRanges
dataSources Optional section. Reference ids for use with the Additional Data service. DataSources
Address
streetNumber The building number on the street. String
streetName The street name. String
municipalitySubdivision Sub / Super City. String
municipality City / Town. String
countrySecondarySubdivision County. String
countryTertiarySubdivision Named Area. String
countrySubdivision State or Province. String
postalCode Postal Code / Zip Code. String
extendedPostalCode Extended postal code (availability dependent on region). String
countryCode Country. String
country Country name. String
countryCodeISO3 ISO alpha-3 country code. String
freeformAddress An address line formatted according to formatting rules of Result's country of origin or in case of countries it's full country name. String
countrySubdivisionName 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. String
Viewport
topLeftPoint Top left corner of the rectangle. LatLon
btmRightPoint Bottom right corner of the rectangle. LatLon
Entrypoint
type Main entry point. One of:

  • main
  • minor
position Position of the entry point. LatLon
AddressRanges
rangeLeft An address range on the left side of a street segment (assuming looking from the "from" end toward the "to" end). String
rangeRight An address range on the right side of a street segment (assuming looking from the "from" end toward the "to" end). String
from A beginning point of a street segment. LatLon
to An end point of a street segment. LatLon
DataSources
geometry Information about the geometric shape of the result. Only present if type == Geography or POI. Geometry
Geometry
id Pass this as geometryId to the Additional Data service to fetch geometry information for this result. String
LatLon
lat Latitude. Double
lon Longitude. Double

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

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.