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

Reverse Geocode

 

Service version: 2.0
Last edit: 2019.02.01

On this page

Purpose

This endpoint translates coordinates into human-readable addresses.

  • There may be times when you need to translate a coordinate (example: 37.786505, -122.3862) into a human-understandable street address.
  • Most often this is needed in tracking applications where you receive a GPS feed from the device or asset, and wish to know the address where the point is located.
  • This endpoint will return address information for a position.

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

For identification purposes:

  • Required constants and parameters are shown in bold text.
  • Optional parameters are shown in plain text.
https://api.tomtom.com/search/2/reverseGeocode/37.8328,-122.27669.json?key=*****&spatialKeys=true&returnSpeedLimit=true&heading=0&radius=100&number=120&returnRoadUse=true &roadUse=LocalStreet&callback=json

curl command

curl -X GET "https://api.tomtom.com/search/2/reverseGeocode/37.8328,-122.27669.json?key=*****
  &spatialKeys=true
  &returnSpeedLimit=true
  &heading=0
  &radius=100
  &number=120
  &returnRoadUse=true
  &roadUse=LocalStreet
  &callback=json"
-H "accept: */*"

▲ 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 may be used.
  • A parameter's data type is beneath its name.
  • 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
integer
The service version number.
Value: The current value is 2.
position
string
This is specified as a comma separated string composed by lat., lon. (e.g., 37.337,-121.89).
Value: latitude,longitude
ext
string
Valid response formats.
Value: JSON, JSONP, JS, or XML.
key
string
An API Key valid for the requested service.
Value: Your valid API Key.
Optional parameters
Parameter Description
spatialKeys
boolean
Deprecated
If the spatialKeys flag is set, the response will also contain 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, API requests that include the spatialKeys parameter will receive a HTTP 400 error in response.
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.
Value: A number.
returnRoadUse
boolean
Returns 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[] array for reverseGeocodes can be one or more of:

[
  "LimitedAccess",
  "Arterial",
  "Terminal",
  "Ramp",
  "Rotary",
  "LocalStreet"
]
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 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.
  • View values include Unified, along with AR, IN, PK, IL, and MA which are respectively tailored for Argentina, India, Pakistan, Israel, and Morocco.

Default value: 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

▲ 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 section for more information.

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

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

Each element of the addresses[] array is in the following format:

{
    "address": {
        "buildingNumber": "2515",
        "streetNumber": "2515",
        "routeNumbers": [],
        "street": "Soquel Dr",
        "streetName": "Soquel Dr",
        "streetNameAndNumber": "2515 Soquel Dr",
        "speedLimit": "35.00MPH",
        "countryCode": "US",
        "countrySubdivision": "CA",
        "countrySecondarySubdivision": "Santa Cruz",
        "countryTertiarySubdivision": "Santa Cruz",
        "municipality": "Live Oak",
        "postalCode": "95065",
        "municipalitySubdivision": "Santa Cruz, Live Oak",
        "sideOfStreet": "L",
        "offsetPosition": "",
        "country": "United States Of America",
        "countryCodeISO3": "USA",
        "freeformAddress": "2515 Soquel Dr, Live Oak, CA 95065",
        "boundingBox": {
          "northEast": "46.940190,-98.777560",
          "southWest": "46.931190,-98.790740",
          "entity": "position"
        },
        "extendedPostalCode": "950651999",
        "countrySubdivisionName": "California"
    },
    "position": "36.988171,-121.974879",
    "roadUse": [
        "Arterial"
    ],
    "matchType": "AddressPoint",
    "dataSources": {
        "geometry": {
          "id": "00005543-3400-3c00-0000-00004e05c152"
        }
    }
}

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.
addresses
array
The Result list, sorted in descending order by score.
spatialKeys
array
Deprecated
Proprietary geo-spatial key information for a specified location.
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, API requests that include the spatialKeys parameter will receive a HTTP 400 error in response.
summary{} object
Field Description
queryTime
integer
The time spent on resolving the query.
numResults
integer
The number of Results in the response.
addresses[] array
Field Description
address
string
The structured address for the Result.
position
double (LatLon)
The position of the Result.
roadUse
array
List of road usage types at the address.
Zero or more of:

  • LimitedAccess
  • Arterial
  • LocalStreet
  • Terminal
  • Rotary
  • Ramp</li>
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.
 
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
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.
offsetPosition
string
The offset position coordinates of the location.
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.
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.
extendedPostalCode
string
Extended postal code (availability dependent on region).
boundingBox{} object
Field Description
northEast
string
North-east (top-left) latitude, longitude coordinate of the bounding box.
southWest
string
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
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 or POI.
geometry
Field Description
id
string
Pass this as geometryId to the Additional Data service to fetch geometry information for this result.
LatLon
Field Description
lat
double
Latitude
lon
double
Longitude

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

Header Description
Access-Control-Allow-Origin Ensures that clients implementing the CORS security model are able to access the response from this service.
Value: *
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

▲ Return to top