Reverse Geocode
Purpose
The TomTom Orbis Maps Reverse Geocoding API Reverse Geocode endpoint gives users a tool to translate a coordinate (for example: -122.3862, 37.786505) 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:
- 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 address or street element data.
- You can specify the level of geography (see the areaTypes parameter in the request parameters section) to get a geometry.
Request data
HTTPS Method: GET
For ease of viewing and identification:
- Constants and parameters enclosed in curly brackets { } must be replaced with their values.
- Please see the following Request parameters section with the required and optional parameters tables for their values. The generic request format is as follows.
Important note: TomTom-Api-Version header is required for this version.
https://{baseURL}/maps/orbis/places/reverseGeocode?position={position}&radiusInMeters={radiusInMeters}&areaTypes={areaTypes}&vehicleHeadingInDegrees={vehicleHeadingInDegrees}&geopoliticalView={geopoliticalView}https://api.tomtom.com/maps/orbis/places/reverseGeocode?position=5.22377,52.1578316&radiusInMeters=100&vehicleHeadingInDegrees=0curl 'https://api.tomtom.com/maps/orbis/places/reverseGeocode?position=5.22377,52.157831&radiusInMeters=100&vehicleHeadingInDegrees=0' -H "TomTom-Api-Version:2" -H "TomTom-Api-Key:{Your_API_Key}" -H "Attributes:results"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.
- 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 | Description |
|---|---|
string | Base URL for calling the API. Value: |
| This is specified as a comma-separated string composed by longitude and latitude. |
| Optional parameters | Description |
|---|---|
| The maximum distance in meters from the specified
|
| A comma-separated list of ‘area’ sub-types used to filter the results.
Available values:
Value: A comma-separated list of area types. |
| The directional heading of the vehicle (degrees, 0..359). |
geopoliticalViewstring | Geopolitical view. The context used to resolve the handling of addressing schemes in disputed territories.
Value: A geopolitical view code. |
Request headers
The following tables describes HTTP request headers.
| Required headers | Description |
|---|---|
| TomTom-Api-Key | An API Key valid for the requested service. |
| TomTom-Api-Version | Version of the API. The API version MUST be specified in all requests. |
| Attributes | A list of response fields to return, specified in dot-notation. Nested fields are expressed using
Note:
Examples:
|
| Optional headers | Description |
|---|---|
| Tracking-Id | A unique identifier for tracking the request across services. The client should provide a globally unique value, preferably a UUID (v4 or v7). While any string format is accepted, the tracking ID must be unique to enable effective request tracing and correlation in logs. |
| Accept-Language | Sequence of preferred response IETF BCP 47 language tags compliant with RFC 7231 (section 5.3.5). |
| Accept | The standard HTTP Accept header indicating the media type(s) the client is able to understand. |
| Accept-Encoding | Enables response compression. |
| Attributes-Exclude | A list of response fields to omit from the response, specified in dot-notation. Nested fields are expressed using
Notes:
Examples:
|
Response data
Response body
For illustrative purposes the following examples 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:
{ "results": []}Example response for the result of the Point Address type is in the following format:
{ "results": [ { "id": "bWDVPAAQT6667EoGx_kMcQ", "type": "address", "title": "4320 Payne Avenue, Cleveland, OH 44103", "position": { "type": "Point", "coordinates": [ -81.656548, 41.510887 ] }, "address": { "country": "United States", "countryCodeIso2": "US", "countrySubdivision": "OH", "countrySubdivisionCodeIso": "US-OH", "countrySecondarySubdivision": "Cuyahoga", "municipality": "Cleveland", "neighborhood": "Goodrich Park", "postalCode": "44103", "extendedPostalCode": "44103-2329", "street": "Payne Avenue", "houseNumber": "4320" }, "accessPoints": [ { "position": { "type": "Point", "coordinates": [ -81.6567403, 41.5112742 ] } } ] } ]}Example response for the Geography result with areaTypes=postalCode filtering:
{ "results": [ { "id": "xs8Xg3uNDJSj4uqwbT2fZA", "type": "area", "areaType": "postalCode", "title": "Santa Cruz, CA 95065", "position": { "type": "Point", "coordinates": [ -121.974876, 36.988171 ] }, "address": { "country": "United States", "countryCodeIso2": "US", "countrySubdivision": "CA", "countrySubdivisionCodeIso": "US-CA", "countrySecondarySubdivision": "Santa Cruz", "municipality": "Santa Cruz", "postalCode": "95065", "postalName": "Santa Cruz" } } ]}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 |
| The result list. |
| results array | |
| Field | Description |
| Unique identifier of the result. It can change between new data releases. |
| Type of result.
|
| The type of area returned. One of:
|
| Localized display title for the result. |
| The position of the result in GeoJSON format. |
| The structured address for the result. |
| List of access points of the location. Access points are
always on the road network. |
| address object | |
| Field | Description |
| Country name. |
| ISO 3166-1 alpha-2 country code. |
| State or province. |
| ISO 3166-2 country subdivision code. |
| County. |
| Named area. |
| City or town. |
| Subdivision of a city. |
| Smaller subdivision of a city. |
| Neighborhood. |
| Postal code (ZIP code). |
| 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. |
| Extended postal code (availability dependent on region). |
| Name of the street. |
| The building number on the street. |
| The codes used to unambiguously identify the street. |
| position object (GeoJSON Point) | |
| Field | Description |
| GeoJSON type. |
| A GeoJSON position: [longitude, latitude] optionally followed by elevation in meters. |
| accessPoints array | |
| Field | Description |
| Position of the access point in GeoJSON format |
Default view mapping
Default view is recognized based on the country the request came from.
Country | Default view | Other available views |
|---|---|---|
| Argentina |
|
|
| India |
|
|
| Morocco |
|
|
| Pakistan |
|
|
| Russia |
|
|
| Turkey |
|
|
| China |
|
|
| Taiwan |
|
|
| Serbia |
|
|
| Others |
|
|
Response codes
The following data table contains HTTP response codes signifying successful and failed requests to an API server.
| Successful and failed response codes | |
|---|---|
| Code | Meaning & possible causes |
200 | OK: The search successfully returned zero or more results. |
400 | Bad Request: Client error. |
403 | Forbidden: The supplied API Key is not valid for this request. |
429 | Too Many Requests: Too many requests were sent in a given amount of time for the supplied API Key. |
500 | Internal Server Error: There is a problem with the TomTom Reverse Geocoding API service. |
503 | Service Unavailable: TomTom Reverse Geocoding API service is unable to receive any request. |
Response headers
The following 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 |
| Content-Type | Indicates the format of the response, as chosen by
the client. |
| Content-Encoding | If requested by the client, the Search service applies
gzip compression to the responses with the Accept-Encoding
header. |
| Content-Language | The HTTP Content-Language representation header is used to describe the language(s) intended for the audience, so users can differentiate it according to their own preferred language. For example, Content-Language: de-DE indicates that the document is intended for German language speakers. The document may be written in English, not German, as part of a language course for German speakers. To indicate the language the document is written in, use the lang attribute instead. If no Content-Language is specified, the default is that the content is intended for all language audiences. Multiple language tags are also possible, as well as applying the Content-Language header to various media types and not only to textual documents. |
| 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. |
Error response
{ "detailedError": { "code": "BAD_REQUEST", "message": "Invalid request: invalid position: latitude/longitude out of range.", "target": "position" }}Error response fields
| Primary fields | |
|---|---|
| Field | Description |
| Detailed error information. |
| detailedError object | |
| Field | Description |
| A unique identifier for this particular occurrence of the problem that SHOULD be human-readable. |
| A description of the error. It is intended as an aid to developers and is not suitable for exposure to end users. |
| Optional. The target of the error (e.g., the name of the property in error). |