A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.tomtom.com/search-api/search-api-documentation-reverse-geocoding/reverse-geocode below:

Reverse Geocode | Reverse Geocoding API

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.

The type of response depends on the available data:

Run this endpoint

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:

URL request format URL request example curl command request example Request parameters

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:

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?

Optional parameters Description

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:


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:

Values: One or more of:

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
string

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:

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

Accept-Encoding

Enables response compression.

Value: gzip

Tracking-ID

Specifies an identifier for the request.

Value: An identifier for the request.

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

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 containing a single record.

addresses array

summary object

Field Description

queryTime

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 Description

address

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:


Deprecated

Support for roadUse will be removed.

matchType

string

Information on the type of match. One of:

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 Description

buildingNumber

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:

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

postalName

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 Code

municipalitySubdivision

string

Sub City

municipalitySecondarySubdivision

string

Sub Sub City

neighbourhood

string

Neighbourhood

sideOfStreet

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 name

countryCodeISO3

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 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 string: 'position'.

roadClass object

Field Description

type

string

Possible values:

values

array

Possible values:

Note

For the Functional type, the service always returns a single element from possible values.

dataSources object

Field Description

geometry

object

Information about the geometric shape of the result. Only present if type == Geography.
geometry object

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:

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 mapping

Default view is recognized based on the country the request came from.

Country

Default view

Other available views

Argentina

AR

Unified, IL, IN, MA, PK, RU, TR, CN

India

IN

-

Morocco

MA

Unified, AR, IL, IN, PK, RU, TR, CN

Pakistan

PK

Unified, AR, IL, IN, MA, RU, TR, CN

Russia

RU

Unified, AR, IL, IN, MA, PK, TR, CN

Turkey

TR

Unified, AR, IL, IN, MA, PK, RU, CN

China

CN

Unified, AR, IL, IN, MA, PK, RU, TR

Others

Unified

AR, IL, IN, MA, PK, RU, TR, CN

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:

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

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

Values: type/subtype is one of: application/json, text/javascript, or 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.

Error response

The content type of an error response depends on the requested output format (.json or .xml).

Error response fields

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 Description

code

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 hierarchy

A 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