Structured Geocode
Purpose
The structured geocode endpoint allows you to pass address components such as house number (houseNumber), street (street) and city (municipality) as separate query parameters instead of a single query string. You can specify some or all address components in the request.
This enables more accurate filtering, reduces ambiguity, and ensures that only documents consistent with the provided structured fields are considered. As a result, the Structured Geocode endpoint returns the most relevant match based on the specific address components supplied in the request.
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/structuredGeocode?countryCodeIso2={countryCodeIso2}&position={position}&radiusInMeters={radiusInMeters}&types={types}&areaTypes={areaTypes}&geopoliticalView={geopoliticalView}&maxResults={maxResults}&countrySubdivision={countrySubdivision}&countrySecondarySubdivision={countrySecondarySubdivision}&countryTertiarySubdivision={countryTertiarySubdivision}&municipality={municipality}&municipalitySubdivision={municipalitySubdivision}&postalCode={postalCode}&street={street}&houseNumber={houseNumber}&bbox={bbox}https://api.tomtom.com/maps/orbis/places/structuredGeocode?street=De%20Ruijterkade&houseNumber=154&postalCode=1011%20AC&municipality=Amsterdam&countryCodeIso2=NLcurl 'https://api.tomtom.com/maps/orbis/places/structuredGeocode?street=De%20Ruijterkade&houseNumber=154&postalCode=1011%20AC&municipality=Amsterdam&countryCodeIso2=NL'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 |
|---|---|
| Base URL for calling the API. |
| A country code in ISO 3166-1 alpha-2 format.
This will limit the search to the specified country.
The choice of view may restrict which countries are available.
Visit the Geocoding API Market Coverage page
for a list of all the countries supported by
the Geocoding API engine. |
| Optional parameters | Description |
|---|---|
| A position used to bias the search to. |
| This parameter can be only set when the |
| A comma-separated list of location types to filter the results.
Value: A comma-separated list of location types. |
| A comma-separated list of sub-types of location type ‘area’ to filter the results.
Value: A comma-separated list of area types. |
| Geopolitical view. The context used to resolve the handling of disputed territories. |
| Maximum number of results to return. |
| A first-level administrative subdivision name of a country or an ISO 3166-2 code. |
| A second-level administrative subdivision of a country. |
| A third-level administrative subdivision of a country. |
| A city, town, or municipality. |
| A subdivision of a municipality. |
| A postal code or extended postal code. |
| A street name. |
| A house number. |
| The corners of the area to report on, expressed in the EPSG:4326 projection.
|
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 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 documentation for more information. When requesting JSON output the response has the following structure:
{ "results": []}Where each element of the results array is in the following format:
{ "id": "a1tgyOViGEeZLkAtZWsQtg", "type": "address", "title": "2501 Soquel Dr, Santa Cruz, CA 95065", "distanceInMeters": 0, "position": { "type": "Point", "coordinates": [-121.97482, 36.98844] }, "address": { "country": "United States Of America", "countryCodeIso2": "US", "countrySubdivision": "CA", "countrySubdivisionCodeIso": "US-CA", "countrySecondarySubdivision": "Santa Cruz", "countryTertiarySubdivision": "Santa Cruz", "municipality": "Santa Cruz", "municipalitySubdivision": "Live Oak", "neighborhood": "Santa Cruz", "postalCode": "95065", "extendedPostalCode": "950652023", "street": "Soquel Dr", "houseNumber": "2501" }, "accessPoints": [ { "position": { "type": "Point", "coordinates": [-121.97487, 36.98817] } } ]}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.
|
| Localized display title for the result. |
| This is the great-circle distance, the shortest path between two points on a sphere to returned entity from position. Only present if position parameter is set in the request. |
| The position of the result in GeoJSON format.
|
| The structured address for the result.
|
| Sub-type of the type=area only present for such result types. One of: country, countrySubdivision, countrySecondarySubdivision, countryTertiarySubdivision, municipality, municipalitySubdivision, municipalitySecondarySubdivision, postalCode, neighborhood |
| List of access points of the location.
|
| address object | |
| Field | Description |
| Country name. |
| ISO 3166-1 alpha-2 country code.
Example: |
| State or province. |
| ISO 3166-2 country subdivision code.
Example: |
| 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. |
| 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. |
4XX | Bad Request: Client error. |
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 |
| 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": "Empty countryCodeIso2 parameter" }}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). |