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.
The type of response depends on the available data:
You can easily run this and other endpoints. Go to the TomTom API Explorer page and follow the directions.
Request data HTTPS Method:GET
For ease of viewing and identification:
The following table describes the parameters that can be used in a request.
Required parameters
Description
baseURL
string
Base URL for calling the API.
Values:
api.tomtom.com
kr-api.tomtom.com
(see the Region-specific content page)
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
. See: How do I get a TomTom API Key?
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.
Values: 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 house 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
Note
The number can include a character such as "94c".
Deprecated
Support for the
number
parameter will be removed.
returnRoadClass
comma-separated string
Enables the return of the roadClass
array for reverseGeocodes
at street level.
Value:
Functional
Represents a classification of roads based on the importance that the constituting roads have in the total road network.
Note
Right now, the service supports only a single value, but in future, it may change.
returnRoadUse
boolean
Enables the return of the roadUse
array for reverseGeocodes
at street level.
Default value: false
.
Deprecated
Support for the
returnRoadUse
parameter will be removed.
roadUse
array
Restricts reverseGeocodes
to a certain type of road use.
Value: The roadUse JSON array for reverseGeocodes
can be one or more of:
roadUse JSON array
["LimitedAccess", "Arterial", "Terminal", "Ramp", "Rotary", "LocalStreet"]
Deprecated
Support for the
roadUse
parameter will be removed.
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 matched entity type. The following parameters are ignored when entityType
is set:
heading
number
returnRoadClass
returnRoadUse
returnSpeedLimit
roadUse
returnMatchType
Values: One or more of:
Country
CountrySubdivision
CountrySecondarySubdivision
CountryTertiarySubdivision
Municipality
MunicipalitySubdivision
MunicipalitySecondarySubdivision
Neighbourhood
PostalCodeArea
callback
string
Specifies the callback method.
Default value: cb
language
string
The language in which the reverse geocode result should be returned. It should be one of the TomTom IETF Supported Languages tags, case insensitive. When data in a specified language is not available for a specific field, the default language is used.
Default value: NGT
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
Geopolitical View. The context used to resolve the handling of disputed territories. Views include Unified
, along with AR
, IL
, IN
, MA
, PK
, RU
, TR
, and CN
which are respectively tailored for Argentina, Israel, India, Morocco, Pakistan, Russia, Turkey, and China.
Default values:
AR
, other available views: Unified
, IL
, IN
, MA
, PK
, RU
, TR
, CN
IN
, other available views: -MA
, other available views: Unified
, AR
, IL
, IN
, PK
, RU
, TR
, CN
PK
, other available views: Unified
, AR
, IL
, IN
, MA
, RU
, TR
, CN
RU
, other available views: Unified
, AR
, IL
, IN
, MA
, PK
, TR
, CN
TR
, other available views: Unified
, AR
, IL
, IN
, MA
, PK
, RU
, CN
CN
, other available views: Unified
, AR
, IL
, IN
, MA
, PK
, RU
, TR
Unified
, other available views: AR
, IL
, IN
, MA
, PK
, RU
, TR
, CN
mapcodes
comma-separated string
Enables the return of mapcodes. Can also filter the response to only show selected mapcode types. See mapcode in the response. 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.
Values: One or more of: Local
, International
, and Alternative
.
filter
string
Excludes a certain group of inspected address-carrying elements in order to find the closest match to a requested point. Right now service supports only single value, but in future it may change.
Value : BackRoads
BackRoads : Roads that do not have an official name and any other kind of address information attached: unaddressable paths, forest paths, tracks, commercial driveways used as service roads, hiking paths, etc. Use of this filter is advised in cases where obtaining accurate address is top priority. It should not be used in a 'vehicle/asset tracking' use case or in road elements 'matching/focus' use case(s).
The following table describes HTTP request headers.
Optional headers
Description
Enables response compression.
Value: gzip
Tracking-ID
Specifies an identifier for the request.
'^[a-zA-Z0-9-]{1,100}$'
.9ac68072-c7a4-11e8-a8d5-f2801f1b9fd1
).Value: An identifier
for the request.
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 fields section for more information. When requesting JSON output, the response has the following structure:
Example response for the result of the Point Address
type is in the following format:
Example response for the Geography result with entityType=PostalCodeArea
filtering:
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
Descriptionsummary
object
Summary information about the search that was performed.
summary object
addresses
array
The result list containing a single record.
addresses array
summary object
Field DescriptionqueryTime
integer
The time spent on resolving the query (in milliseconds).numResults
integer
The number of results in the response. The current version of the API returns a maximum of 1 result.addresses array
Field Descriptionaddress
object
The structured address for the result.
address object
position
double (LatLon)
Position of the result in the form of "latitude,longitude" coordinates. Position of the entry point. Position on the street where you can enter the location.
Example: 37.553,-122.453
roadClass
array
Optional field. It can be returned only if the 'returnRoadClass' input parameter is used.
Road classes at the address.
roadclass object
roadUse
array
Optional field. It can be returned only if the 'returnRoadUse' input parameter is used.
List of road usage types at the address.
Zero or more of:
LimitedAccess
Arterial
LocalStreet
Terminal
Rotary
Ramp
Publicly Accessible
Not Publicly Accessible
Pedestrian Mall
Service Vehicles Only
Walkway
POI Entry Point
Car-Park
Unidentified
Slip-Road
Frontage Road
Special Traffic Figure
Entrance Ramp
Exit Ramp
Entrace & Exit Ramp
Highway Interchange
Parallel Ramp
Deprecated
Support for
roadUse
will be removed.
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. It can be returned only if the 'mapcodes' input parameter is used.
List of mapcode
objects.
mapcode object
id
string
A stable, unique id for a given entity.
address object
Field DescriptionbuildingNumber
string
Deprecated
The building number on the street.
Deprecated
Use
streetNumber
instead.
building
string
The building name or code of the address. This can be a descriptive name, an alphanumeric string, or even a single alphabetic character or numerical digit.
streetNumber
string
The building number on the street.routeNumbers
array
The codes used to unambiguously identify the street.street
string
Deprecated
The street name.
Deprecated
Use
streetName
instead.
streetName
string
The street name.streetNameAndNumber
string
The street name and number.speedLimit
string
The speed limit for the street in the form (D)(D)D.DDUUU, For example:
(D)(D)D.DD is a number with two decimal places (for example: 5.00, 30.00 or 120.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 ProvincecountrySecondarySubdivision
string
CountycountryTertiarySubdivision
string
Named Areamunicipality
string
City / TownpostalName
string
An address component which represents the name for a postal code that is related to a single administrative area, city, town, or other populated place. Only present when the parameter entityType == PostalCodeArea
.
postalCode
string
Postal Code / Zip CodemunicipalitySubdivision
string
Sub CitymunicipalitySecondarySubdivision
string
Sub Sub Cityneighbourhood
string
NeighbourhoodsideOfStreet
string
The left or right side of the street location. This can be returned only when the number
parameter was defined.
Deprecated
Support for
sideOfStreet
will be removed.
offsetPosition
string
The location of the building for the given number
. This can be returned only when the number
parameter was defined.
Example: 37.553,-122.453
Deprecated
Support for
offsetPosition
will be removed.
country
string
Country namecountryCodeISO3
string
ISO 3166-1 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.
countrySubdivisionCode
string
countrySubdivisionCode
prefixed by countryCode
and the hyphen ( countryCode-countrySubdivisionCode
) forms the ISO 3166-2 code. countrySubdivisionCode
examples: TX
for Texas, SCT
for Scotland, ON
for Ontario, ZE
for Zeeland and BB
for Brandenburg.
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.
extendedPostalCode
string
Extended postal code (availability is dependent on the region).boundingBox object
Field DescriptionnorthEast
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 string: 'position'.
roadClass object
Field Descriptiontype
string
Possible values:
Functional
Represents a classification of roads based on the importance that the constituting roads have in the total road network.
values
array
Possible values:
for type Functional
Motorway
Includes all roads officially designated as members of an internationally, nationally, and/or regionally important network of limited-access highways.
Trunk
Includes all roads of high importance (but not officially assigned as motorways) that are part of a connection for international and national traffic and transport.
Primary
Includes all roads used to travel between neighboring regions of a country.
Secondary
Includes all roads used to travel between different parts of the same region.
Tertiary
Includes:
Street
Includes all roads that only have a destination function. Such roads reach a particular address or destination (e.g., dead-end streets, roads inside a living area, alleys [narrow roads between buildings], or roads found in a park or garden).
Ferry
Includes all ferry routes.
Other
Includes all other roads that are less important for the navigation system.
Note
For the
Functional
type, the service always returns a single element from possible values.
dataSources object
Field Descriptiongeometry
object
Information about the geometric shape of the result. Only present if type == Geography
.
geometry object
geometry object
Field Descriptionid
string
Pass this as geometryId
to the Additional Data service to fetch geometry information for this result.
mapcode object
Field Descriptiontype
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:
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 at Territories for mapcodes. 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.
Default view is recognized based on the country the request came from.
Country
Default view
Other available views
ArgentinaAR
Unified
, IL
, IN
, MA
, PK
, RU
, TR
, CN
IN
-
MA
Unified
, AR
, IL
, IN
, PK
, RU
, TR
, CN
PK
Unified
, AR
, IL
, IN
, MA
, RU
, TR
, CN
RU
Unified
, AR
, IL
, IN
, MA
, PK
, TR
, CN
TR
Unified
, AR
, IL
, IN
, MA
, PK
, RU
, CN
CN
Unified
, AR
, IL
, IN
, MA
, PK
, RU
, TR
Unified
AR
, IL
, IN
, MA
, PK
, RU
, TR
, CN
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:
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.
429
Too Many requests : The API Key is over QPS (Queries per second).
5xx
Server Error : The service was unable to process your request. Contact support to resolve the issue.
The following data table contains response headers sent back from an API server.
Header
Description
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.
Indicates the format of the response, as chosen by the client.
Format: type/subtype; charset=utf-8
Values: type/subtype
is one of: application/json
, text/javascript
, or text/xml
.
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.
The content type of an error response depends on the requested output format (.json
or .xml
).
Primary fields
Description
error
string
A human-readable description of the error code. It is intended as an aid to developers and is not suitable for exposure to end users.
httpStatusCode
integer
HTTP error code.detailedError
object
Detailed information about the error.
detailedError object
detailedError object
Field Descriptioncode
string
One of the defined error codes.
message
string
A human-readable representation of the error code. It is intended as an aid to developers and is not suitable for exposure to end users.
target
string
Optional. Target of the particular error.
Value: The name of the request parameter.
Error code hierarchyA list of predefined, hierarchical, human-readable error codes. The httpStatusCode
relates to HTTP error codes. An error code in detailedError
can redefine httpStatusCode
to one of the codes described in this section. In the future, the list may be extended with additional codes.
Error code
Description
BadRequest
The code for requests which ended with HTTP 400 Bad Request
.
Forbidden
The code for requests which ended with HTTP 403 Forbidden
.
InternalServerError
The code for requests which ended with HTTP 500 Internal Server Error
. The service cannot handle the request right now, an unexpected condition was encountered.
ServerTimeout
The code for requests which ended with HTTP 504 Gateway Timeout
. The service cannot handle the request right now, this is certainly a temporary state.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4