CrossStreet Lookup

Service version: 2
Last edit: 2024.01.30

Purpose

This endpoint returns address information and coordinates for a position to the nearest intersection. There may be times when you need to translate a coordinate (for 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 an asset, and wish to know the position and address information of the nearest intersection/crossroad to its initial position.

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:

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

URL request format

get
URL request format
https://{baseURL}/search/{versionNumber}/reverseGeocode/crossStreet/{position}.{ext}?key={Your_API_Key}&limit={limit}&radius={radius}&language={language}&allowFreeformNewline={allowFreeformNewline}&view={view}

URL request example

get
URL request example
https://api.tomtom.com/search/2/reverseGeocode/crossStreet/37.786505,-122.3862.json?key={Your_API_Key}

curl command request example

get
curl command request example
curl 'https://api.tomtom.com/search/2/reverseGeocode/crossStreet/37.786505,-122.3862.json?key={Your_API_Key}'

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.
  • The order of request parameters is not important.

Required parameters

Description

baseURL


string

Base URL for calling the API.


Values:

versionNumber


string

The service version number.


Value: The current version number value is 2.

position


string

This is specified as a comma separated string composed by lat,lon (e.g., 37.337,-121.89 ).


Value: A comma separated string composed by 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 API Key.

Optional parameters

Description

limit


integer

The maximum number of responses that will be returned.


Default value: 1 (when the [limit] parameter is absent)


Maximum value: 100

radius


integer

The maximum distance in meters from the specified position for the reverseGeocode to consider.


Default value: 10000 meters (10 km).

language


string

The language in which the search results 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


Deprecation notice


Support for no-NO will be removed in favour of nb-NO.

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.

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:

  • Argentina, default view: AR, available views: Unified, IL, IN, MA, PK, RU, TR, CN

  • India, default view: IN, available views: -

  • Morocco, default view: MA, available views: Unified, AR, IL, IN, PK, RU, TR, CN

  • Pakistan, default view: PK, available views: Unified, AR, IL, IN, MA, RU, TR, CN

  • Russia, default view: RU, available views: Unified, AR, IL, IN, MA, PK, TR, CN

  • Turkey, default view: TR, available views: Unified, AR, IL, IN, MA, PK, RU, CN

  • China, default view: CN, available views: Unified, AR, IL, IN, MA, PK, RU, TR

  • Others, default view: Unified, available views: AR, IL, IN, MA, PK, RU, TR, CN

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 fields section for more information. When requesting JSON output the response has the following structure:

Response structure - JSON
1{
2 "summary": {
3 "numResults": 1,
4 "queryTime": 176
5 },
6 "addresses": []
7}

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

Addresses array elements format - JSON
1{
2 "address": {
3 "streetName": "Bryant Street & The Embarcadero",
4 "crossStreet": "Bryant Street",
5 "municipality": "San Francisco",
6 "neighbourhood": "South Beach",
7 "countrySecondarySubdivision": "San Francisco",
8 "countrySubdivision": "CA",
9 "countrySubdivisionName": "California",
10 "countrySubdivisionCode": "CA",
11 "postalCode": "94111",
12 "countryCode": "US",
13 "country": "United States",
14 "countryCodeISO3": "USA",
15 "freeformAddress": "Bryant Street & The Embarcadero, San Francisco, CA 94111",
16 "localName": "San Francisco",
17 "street": "The Embarcadero"
18 },
19 "position": "37.787075,-122.3877"
20}

Response fields

The following table describes 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

Result list, sorted in descending order by score.


addresses array

summary object

FieldDescription

numResults


integer

The number of results in the response.

queryTime


integer

Time spent on resolving the query.

addresses array

FieldDescription

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

address object

FieldDescription

streetName


string

The street name.

crossStreet


string

The street being crossed.

municipalitySubdivision


string

Sub / Super City

municipality


string

City / Town

municipalitySecondarySubdivision


string

Sub Sub City

neighbourhood


string

Neighbourhood

countrySecondarySubdivision


string

County

countryTertiarySubdivision


string

Named Area.

countrySubdivision


string

State or Province

postalCode


string

Postal Code / Zip Code

countryCode


string

Country (Note: This is a two-letter code, not a country name.)

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 case of countries, its full country name.

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.

countrySubdivisionName


string

A full name of the first level of a country administrative hierarchy. This field appears only in case countrySubdivision is presented in an abbreviated form. Supported only for USA, Canada, and Great Britain.

street


string

The street name.

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

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

China

CN

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

Others

Unified

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

Response codes

The following 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
  • Over QPS (Queries per second), or over QPD (Queries per day)
  • 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.

429

Too Many Requests : The API Key is over the QPS (Queries per second) limit.

5xx

Server Error : The service was unable to process your request. Contact support to resolve the issue.

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