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

Reverse Geocode

 

Service version: 2
Last edit: 2019.10.29

On this page

Purpose

The TomTom Reverse Geocoding API gives users a tool to translate a coordinate (for example: 37.786505, -122.3862) into a human-understandable street address, street element, or geography.

Most often, this is needed in tracking applications where you receive a GPS feed from the device or asset and you want to know the address.

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

A Request returns information for a given position. The type of Response depends on the available data:

  • address: Returns the most detailed information.
  • street element: Less detailed; returned when there is no address data.
  • geography: Returns the smallest available geographic data.

    • This is returned when there is no addess or street element data.
    • You can specify the level of geography (see entityType parameter in the Request parameters section) to get a geometry.
    • The geometry data can be fetched using the Additional Data service

HTTPS Method: GET

For ease of viewing and identification:

  • Constants and parameters enclosed in angle brackets (< >) must be replaced with their values.
  • See the following Request parameters section with the Required and Optional parameters tables for these values.

URL format

https://<baseURL>/search/<versionNumber>/reverseGeocode/<position>.<ext>?key=<Your_API_Key>[&spatialKeys=<spatialKeys>][&returnSpeedLimit=<returnSpeedLimit>][&heading=<heading>][&radius=<radius>][&number=<number>][&returnRoadUse=<returnRoadUse>][&roadUse=<roadUse>][&entityType=<entityType>][&callback=<callback>][&language=<language>][&allowFreeformNewline=<allowFreeformNewline>][&returnMatchType=<returnMatchType>][&view=<view>][&dateTime=<dateTime>][&mapcodes=<mapcodes>]

curl command format

curl 'https://<baseURL>/search/<versionNumber>/reverseGeocode/<position>.<ext>?key=<Your_API_Key>[&spatialKeys=<spatialKeys>][&returnSpeedLimit=<returnSpeedLimit>][&heading=<heading>][&radius=<radius>][&number=<number>][&returnRoadUse=<returnRoadUse>][&roadUse=<roadUse>][&entityType=<entityType>][&callback=<callback>][&language=<language>][&allowFreeformNewline=<allowFreeformNewline>][&returnMatchType=<returnMatchType>][&view=<view>][&dateTime=<dateTime>][&mapcodes=<mapcodes>]'

HTTP Request headers

The following table describes HTTP Request headers.

Optional headers
Header Description
Accept-Encoding
string
Should contain list of encodings acceptable by the client. Used to demand a compressed Response.
If specified, Content-Encoding Response header is returned
Value: gzip
Tracking-ID
string
Specifies an identifier for the Request.

  • It can be used to trace a call.
  • The value must match the regular expression '^[a-zA-Z0-9-]{1,100}$'.
  • An example of the format that matches this regular expression is UUID: (e.g. 9ac68072-c7a4-11e8-a8d5-f2801f1b9fd1). For details check RFC 4122.
  • If specified, it is replicated in the Tracking-ID Response header.
  • It is only meant to be used for support and does not involve tracking of you or your users in any form.

Value: An identifier for the Request.

▲ Return to top

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
The base URL for calling the API.
Value: api.tomtom.com
versionNumber
string
The service version.
Value: The current value is 2.
position
comma-separated string
This is specified as a comma-separated string composed by lat,lon.
Value: lat,lon
Example: 37.553,-122.453
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 TomTom API Key.
Optional parameters
Parameter Description
[spatialKeys]
boolean
Deprecated
If the spatialKeys flag is set, the Response will also contain the proprietary geo-spatial key information for a specified location.
Default value: false
March 1, 2018:

  • The spatialKeys parameter has been deprecated and will be withdrawn following a 12 month deprecation period.
  • The planned withdrawal date is March 1, 2019.
  • Following withdrawal, the spatialKeys parameter will be ignored.
[returnSpeedLimit]
boolean
Enables the return of the posted speed limit (where available).
Default value: false
[heading]
float
The directional heading of the vehicle in degrees, for travel along a segment of roadway.

  • 0 is North, 90 is East and so on.
  • The precision can include up to one decimal place.

Value: Values range from -360 to 360.

[radius]
integer
The maximum distance in meters from the specified position for the reverseGeocode to consider.
Default value: 10000 meters (10 km).
[number]
string
If a number is sent in along with the Request, the Response may include the side of the street (Left/Right), and also an offset position for that number.
Note: The number can include a character such as "94c".
Value: A number.
[returnRoadUse]
boolean
Enables the return of the roadUse[] array for reverseGeocodes at street level.
Default value: false.
[roadUse]
array
Restricts reverseGeocodes to a certain type of road use.
Value: The roadUse[] JSON array2 for reverseGeocodes can be one or more of:

[
  "LimitedAccess",
  "Arterial",
  "Terminal",
  "Ramp",
  "Rotary",
  "LocalStreet"
]

See: RFC 8259 "An array structure is represented as square brackets surrounding zero or more values (or elements). Elements are separated by commas. array = begin-array [ value *( value-separator value ) ] end-array".

[entityType]
comma-separated string
This parameter specifies the level of filtering performed on geographies.

  • Providing this parameter narrows the search for specified geography entity types.
  • The resulting Response will contain the geography ID as well as the matched entity type.
  • This ID is a token that can be used to get the geometry of that geography.
  • The following parameters are ignored when entityType is set:

    • heading
    • number
    • returnRoadUse
    • returnSpeedLimit
    • roadUse
    • returnMatchType

Values: One or more of:

  • Country
  • CountrySubdivision
  • CountrySecondarySubdivision
  • CountryTertiarySubdivision
  • Municipality
  • MunicipalitySubdivision
  • Neighbourhood
  • PostalCodeArea
[callback]
string
Specifies the JSONP callback method.
Default value: cb
[language]
string
The 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.

Default value: NGT
Deprecation notice: Support for no-NO will be removed in favour of no-NB.

[allowFreeformNewline]
boolean
The format of newlines in the formatted address.

  • If true, the address will contain newlines.
  • Otherwise, newlines will be converted to spaces.

Default value: false.

[returnMatchType]
boolean
This includes information on the type of match the geocoder achieved in the Response.
Default value: false.
[view]
string
Geopolitical View.

  • The context used to resolve the handling of disputed territories.
  • Views include Unified, along with AR, IL, IN, MA, PK, RU and TR which are respectively tailored for Argentina, Israel, India, Morocco, Pakistan, Russia and Turkey.

Default values:

  • Argentina, default view: AR, available views: Unified, IL, IN, MA, PK, RU, TR
  • India, default view: IN, available views: -
  • Morocco, default view: MA, available views: Unified, AR, IL, IN, PK, RU, TR
  • Pakistan, default view: PK, available views: Unified, AR, IL, IN, MA, RU, TR
  • Russia, default view: RU, available views: Unified, AR, IL, IN, MA, PK, TR
  • Turkey, default view: TR, available views: Unified, AR, IL, IN, MA, PK, RU
  • Others, default view: Unified, available views: AR, IL, IN, MA, PK, RU, TR

See the following section: Default view mapping.

[dateTime]
string
The date and time used to return time zone information.

  • It allows the service to decide whether the Daylight Saving Time time zone should be used or not.
  • It must conform to RFC 3339.

Value: For example:

  • 2017-12-19T16:39:57
  • 2017-12-19T16:39:57-08:00
  • 2018-10-28T00:00:00Z
[mapcodes]
comma-separated string
Enables the return of mapcodes. Can also filter the response to only show selected mapcode types. See Mapcodes in the response.
Values: One or more of:

  • Local
  • International
  • Alternative

A mapcode represents a specific location, to within a few meters. Every location on Earth can be represented by a mapcode.
Mapcodes are designed to be short, easy to recognize, remember and communicate.
Visit the Mapcode project website for more information.

▲ Return to top

Response data

Response body

For illustrative purposes the examples below are neatly indented.

  • Please note that actual Responses will vary based on the result type and the data available.
  • See the following Response field section for more information.

When requesting JSON output, the Response has the following structure:

{
  "summary": {
    "queryTime": 102,
    "numResults": 1
  },
  "addresses": [],
  "spatialKeys": []
}

Example Response for the result of the Point Address type is in the following format:

{
  "summary": {
    "queryTime": 17,
    "numResults": 1
  },
  "addresses": [
    {
      "address": {
        "buildingNumber": "2501",
        "streetNumber": "2501",
        "routeNumbers": [],
        "street": "Soquel Drive",
        "streetName": "Soquel Drive",
        "streetNameAndNumber": "2501 Soquel Drive",
        "speedLimit": "35.00MPH",
        "countryCode": "US",
        "countrySubdivision": "CA",
        "countrySecondarySubdivision": "Santa Cruz",
        "countryTertiarySubdivision": "Santa Cruz",
        "municipality": "Santa Cruz, Live Oak",
        "postalCode": "95065",
        "municipalitySubdivision": "Santa Cruz, Live Oak",
        "sideOfStreet": "L",
        "offsetPosition": "36.988430,-121.974731",
        "country": "United States",
        "countryCodeISO3": "USA",
        "freeformAddress": "2501 Soquel Drive, Santa Cruz, CA 95065",
        "boundingBox": {
          "northEast": "36.988197,-121.974752",
          "southWest": "36.988156,-121.975108",
          "entity": "position"
        },
        "extendedPostalCode": "950651900",
        "countrySubdivisionName": "California",
        "localName": "Santa Cruz"
      },
      "position": "36.988159,-121.974762",
      "roadUse": [
        "Arterial"
      ],
      "matchType": "AddressPoint",
      "mapcodes":[
        {
           "type":"Local",
           "fullMapcode":"US-CA FS.WRH3",
           "territory":"US-CA",
           "code":"FS.WRH3"
        },
        {
           "type":"International",
           "fullMapcode":"S4ZW4.990V"
        },
        {
           "type":"Alternative",
           "fullMapcode":"US-CA 4349.S8W",
           "territory":"US-CA",
           "code":"4349.S8W"
        },
        {
           "type":"Alternative",
           "fullMapcode":"US-CA JJCH.H9DF",
           "territory":"US-CA",
           "code":"JJCH.H9DF"
        },
        {
           "type":"Alternative",
           "fullMapcode":"USA JJCH.H9DF",
           "territory":"USA",
           "code":"JJCH.H9DF"
        }
      ]
    }
  ]
}

Example Response for the Geography result with entityType=PostalCodeArea filtering:

{
  "summary": {
    "queryTime": 10,
    "numResults": 1
  },
  "addresses": [
    {
      "address": {
        "routeNumbers": [],
        "countryCode": "US",
        "countrySubdivision": "CA",
        "countrySecondarySubdivision": "Santa Cruz",
        "countryTertiarySubdivision": "Santa Cruz",
        "municipality": "Santa Cruz",
        "postalCode": "95065",
        "country": "United States",
        "countryCodeISO3": "USA",
        "freeformAddress": "Santa Cruz, CA 95065",
        "boundingBox": {
          "northEast": "37.085762,-121.949375",
          "southWest": "36.983408,-122.013236",
          "entity": "position"
        },
        "countrySubdivisionName": "California"
      },
      "position": "36.988171,-121.974876",
      "dataSources": {
        "geometry": {
          "id": "00005543-3300-3c00-0000-00004dc8b8e5"
        }
      },
      "entityType": "PostalCodeArea",
      "mapcodes":[
        {
           "type":"Local",
           "fullMapcode":"US-CA FS.WRG0",
           "territory":"US-CA",
           "code":"FS.WRG0"
        },
        {
           "type":"International",
           "fullMapcode":"S4ZW4.89XV"
        },
        {
           "type":"Alternative",
           "fullMapcode":"US-CA 4349.S7L",
           "territory":"US-CA",
           "code":"4349.S7L"
        },
        {
           "type":"Alternative",
           "fullMapcode":"US-CA JJCH.H9CF",
           "territory":"US-CA",
           "code":"JJCH.H9CF"
        },
        {
           "type":"Alternative",
           "fullMapcode":"USA JJCH.H9CF",
           "territory":"USA",
           "code":"JJCH.H9CF"
        }
      ]
    }
  ]
}

Each element of the spatialKeys[] array is in the following format (Note: spatialKeys[] has been marked for deprecation):

{
  "priority": "0",
  "val": "1563238492"
}

▲ Return to top

Response fields

The following tables 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.

Primary fields
Field Description
summary{}
object
Summary information about the search that was performed.
summary{} object
addresses[]
array
The Result list, sorted in descending order by score.
addresses[] array
spatialKeys[]
array
(Deprecated)
Proprietary geo-spatial key information for a specified location.
spatialKeys[] array
March 1, 2018:

  • The spatialKeys parameter has been deprecated and will be withdrawn following a 12 month deprecation period.
  • The planned withdrawal date is March 1, 2019.
  • Following withdrawal, the spatialKeys parameter will be ignored.
summary{} object
Field Description
queryTime
integer
The time spent on resolving the query (in milliseconds).
numResults
integer
The number of Results in the response.
addresses[] array
Field Description
address{}
object
The structured address for the Result.
address{} object
position
double (LatLon)
Position of the result in a form of "latitude,longitude" coordinates.
Example: 37.553,-122.453
roadUse[]
array
List of road usage types at the address.
Zero or more of:

  • LimitedAccess
  • Arterial
  • LocalStreet
  • Terminal
  • Rotary
  • Ramp
matchType
string
Information on the type of match.
One of:

  • AddressPoint
  • HouseNumberRange
  • Street
dataSources{}
object
Optional section.
Reference ids for use with the Additional Data service.
dataSources{} object
geometry{} object
mapcodes[]
array
Optional section.
List of mapcode{} objects.
mapcode{} object
address{} object
Field Description
buildingNumber
string
The building number on the street.
streetNumber
string
The building number on the street.
routeNumbers[]
array
The codes used to unambiguously identify the street.
street
string
The street name.
streetName
string
The street name.
streetNameAndNumber
string
The street name and number.
speedLimit
string
The speed limit for the street in the form DD.DDUUU, For example:

  • 30.00KPH
  • D is a digit (for example, 30.00).
  • UUU is either KPH or MPH (whichever is correct for the address).
countryCode
string
Country (Note: This is a two-letter code, not a country name.)
countrySubdivision
string
State or Province
countrySecondarySubdivision
string
County
countryTertiarySubdivision
string
Named Area
municipality
string
City / Town
postalCode
string
Postal Code / Zip Code
municipalitySubdivision
string
Sub / Super City
sideOfStreet
string
The left or right side of the street location. This is returned only when the number parameter was defined.
offsetPosition
string
The offset position coordinates of the location.
Example: 37.553,-122.453
country
string
Country name
countryCodeISO3
string
ISO alpha-3 country code
freeformAddress
string
An address line formatted according to the formatting rules of a Result's country of origin, or in the case of a country, its full country name.
boundingBox{}
object
The bounding box of the location.
boundingBox{} object
countrySubdivisionName
string
The full name of a first level of country administrative hierarchy.

  • This field appears only in case countrySubdivision is presented in an abbreviated form.
  • Only supported 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. This field is used to build the freeformAddress property.
extendedPostalCode
string
Extended postal code (availability is dependent on the region).
boundingBox{} object
Field Description
northEast
comma-separated floats
North-east (top-left) latitude,longitude coordinate of the bounding box.
southWest
comma-separated floats
South-west (bottom-right) latitude,longitude coordinate of the bounding box.
entity
string
Entity type source of the bounding box.
Note: For reverse-geocoding this is always equal to position.
spatialKeys[] array (Deprecated)
Field Description
priority
string
Proprietary geo-spatial key information for a specified location.
val
string
Proprietary geo-spatial key information for a specified location.
dataSources{} object
Field Description
geometry{}
object
Information about the geometric shape of the result.
Only present if type == Geography.
geometry{} object
Field Description
id
string
Pass this as geometryId to the Additional Data service to fetch geometry information for this result.
mapcode{} object
Field Description
type
string
Type of mapcode. Possible values:

  • Local: the shortest possible (and easiest to remember) mapcode.
    Local mapcodes are especially useful when the user knows what territory the mapcode is in (for example, when an application is designed to be used inside just one European country or US state).
    Note that the code element of a Local mapcode is ambiguous when used without the territory element - e.g.:
    the "4J.P2" mapcode can mean the Eiffel Tower location (48.858380, 2.294440) (with the territory set to FRA), but also some place in Amsterdam-Noord, Netherlands (52.382184, 4.911021) (with the territory set to NLD).
  • International: this mapcode is unambiguous. It is also the longest.
  • Alternative: alternatives to Local mapcodes.
    Each Alternative mapcode points to slightly different coordinates due to the way mapcodes are computed (see the mapcode documentation). For example: the position from a response can be encoded as "5DM.WC" (51.759244, 19.448316) and the "VHJ.036" (51.759245, 19.448264), which are close to each other, but not exactly the same place.
fullMapcode
string
The full form of a mapcode (territory + code). It is always unambiguous.
The territory element is always in the Latin alphabet.
In an International mapcode, the territory part is empty.
territory
string
The territory element of the mapcode. The territory element is always in the Latin alphabet.
Usually, the territory is the ISO 3166-1 alpha 3 abbreviation for the country name.
However in these eight very large countries:

  • The USA,
  • Canada,
  • Mexico,
  • Brazil,
  • India,
  • Australia,
  • Russia,
  • China

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 territory codes is available here.
This field is not returned for an International mapcode.

code
string
The mapcode without the territory element. It consists of two groups of letters and digits separated by a dot.
The code is using the same language and alphabet as the response. The language parameter may be used to modify the language and alphabet of both the response and the code (for example: Cyrillic for the language 'ru-RU').
This field is not returned for the International mapcodes - use fullMapcode instead.

▲ Return to top

Default view mapping

Default view is recognised based on the country the Request came from.

Country Default view Other available views
Argentina AR Unified, IL, IN, MA, PK, RU, TR
India IN -
Morocco MA Unified, AR, IL, IN, PK, RU, TR
Pakistan PK Unified, AR, IL, IN, MA, RU, TR
Russia RU Unified, AR, IL, IN, MA, PK, TR
Turkey TR Unified, AR, IL, IN, MA, PK, RU
Others Unified AR, IL, IN, MA, PK, RU, TR

▲ 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

HTTP Response headers

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

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
Content-Encoding The Reverse Geocode service applies gzip compression to the responses if requested by the client with the Accept-Encoding header.
Value: gzip
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 identifier for the Request.

▲ Return to top

You are here