Premium Geocoding API
Purpose
The TomTom Premium Geocoding API is a forward geocoding service that returns highly accurate address coordinates along with expanded address features required for last-mile delivery, such as the closest parking points, floor numbering, and building entrances (data not provided by standard geocoding). This enables, for example, address verification, route planning, and to-the-door navigation. Premium geocoding therefore guides couriers to the customer’s door for faster and more successful deliveries, compared to the standard geocoded location available in regular geocoding.
Premium responses will be returned wherever applicable (Apartments/Complexes) if no premium content is available, the response will be a standard Geocode response, charged at the standard price.
Run this endpoint
You can easily run this and other endpoints. Go to the TomTom API Explorer page and follow the directions.
To enable the premium content on your account/key, please contact Sales Team.
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
https://{baseURL}/search/{versionNumber}/premiumGeocode/{query}.{ext}?key={Your_API_Key}&unit={unitInfo}&limit={limit}&ofs={ofs}&lat={lat}&lon={lon}&countrySet={countrySet}&radius={radius}&topLeft={topLeft}&btmRight={btmRight}&language={language}&extendedPostalCodesFor={extendedPostalCodesFor}&view={view}&mapcodes={mapcodes}&entityTypeSet={entityTypeSet}
URL request example
https://api.tomtom.com/search/2/premiumGeocode/3401%20S%20Lamar%20Blvd%2C%20Austin%2C%20TX.json?key={Your_API_Key}&unit=3441
curl command request example
curl 'https://api.tomtom.com/search/2/premiumGeocode/3401%20S%20Lamar%20Blvd%2C%20Austin%2C%20TX.json?key={Your_API_Key}&unit=3441'
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 |
---|---|
string | Base URL for calling the API. Values:
|
string | Service version number. Value: The current value is |
string | Query string (can include unit info). Must be properly URL encoded. Value: A properly URL encoded query string. |
string | A valid response format: Values: |
string | An API Key valid for the requested service. Value: Your valid |
Optional parameters | Description |
---|---|
| unit details for the detailed address search (e.g., |
| The maximum number of responses that will be returned. |
| The starting offset of the returned results within the full result set. The total number of results can be no more than 2000. If you want to receive all the results, you need to limit the number of results by using, for example the radius parameter. |
| Latitude, e.g., |
| Longitude, e.g., |
| Comma separated string of country codes in ISO 3166-1 alpha-2 or alpha-3 code formats (e.g., |
| If |
| Top-left position of the bounding box. This is specified as a comma-separated string composed by lat,lon (e.g., |
| Bottom-right position of the bounding box. This is specified as a comma-separated string composed by lat,lon (e.g., |
| Language in which search results should be returned. It should be one of the TomTom IETF Supported Language Tags , case insensitive. When data in the specified language is not available for a specific field or the language is not specified, the language best matched with your query is used. |
| Indexes for which extended postal codes should be included in the results. Available values are described in Additional Information indexes abbreviation values section. The value should be a comma-separated list of index types (in any order) or "None" for no indexes. By default, extended postal codes are included for all indexes except Geo. Extended postal code lists for geographies can be quite long, so they have to be explicitly requested when needed. Extended postal code is returned as the
|
view string | Geopolitical View. The context used to resolve the handling of disputed territories. Views include
|
| Enables the return of a comma-separted mapcodes list. It can also filter the response to only show selected mapcode types. See mapcodes 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.
Usage examples:
|
| A comma-separated list of entity types which can be used to restrict the result to the Geography result of a specific entity type.
If
Usage examples:
|
Request headers
Optional headers | Description |
---|---|
Enables response compression. Value: | |
Tracking-ID | Specifies an identifier for the request. It can be used to trace a call.
The value must match the regular expression
Value: An |
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:
1{2 "summary": {3 "query": "2501 soquel dr santa cruz ca 95065",4 "queryType": "NON_NEAR",5 "queryTime": 8,6 "numResults": 1,7 "offset": 0,8 "totalResults": 1,9 "fuzzyLevel": 1,10 "geoBias": {11 "lat": 36.98844,12 "lon": -121.9748313 },14 "content": "standard"15 },16 "results": []17}
Where each element of the results
array is in the following format:
1{2 "summary": {3 "query": "3401 s lamar blvd apartment 3441 austin tx",4 "queryType": "NON_NEAR",5 "queryTime": 1315,6 "numResults": 2,7 "offset": 0,8 "totalResults": 2,9 "fuzzyLevel": 1,10 "content": "premium"11 },12 "results": [13 {14 "content": "premium",15 "type": "Point Address",16 "id": "r63Ckl7uJ7CwF-WfY051Rw",17 "score": 12.0779495239,18 "matchConfidence": {19 "score": 0.715031047551594320 },21 "address": {22 "streetNumber": "3401",23 "streetName": "South Lamar Boulevard",24 "municipality": "Austin",25 "neighbourhood": "South Lamar",26 "countrySecondarySubdivision": "Travis",27 "countrySubdivision": "TX",28 "countrySubdivisionName": "Texas",29 "countrySubdivisionCode": "TX",30 "postalCode": "78704",31 "extendedPostalCode": "78704-5805",32 "countryCode": "US",33 "country": "United States",34 "countryCodeISO3": "USA",35 "freeformAddress": "3401 South Lamar Boulevard, Austin, TX 78704",36 "localName": "Austin",37 "unit": "3441"38 },39 "addressDetails": {40 "numberOfUnits": 279,41 "numberOfBuildings": 1,42 "floorNumber": 4,43 "hasElevator": true,44 "hasStair": true,45 "hasParking": true,46 "wallHeight": 347 },48 "position": {49 "lat": 30.23966941103544,50 "lon": -97.7870413835025551 },52 "viewport": {53 "topLeftPoint": {54 "lat": 30.24153,55 "lon": -97.7869956 },57 "btmRightPoint": {58 "lat": 30.23973,59 "lon": -97.7849160 }61 },62 "entryPoints": [63 {64 "type": "route",65 "functions": [66 "PARKING"67 ],68 "pathToNext": "WALKING",69 "position": {70 "lat": 30.24054777888027,71 "lon": -97.7859605822256172 }73 },74 {75 "type": "route",76 "functions": [77 "ENTRANCE"78 ],79 "pathToNext": "WALKING",80 "position": {81 "lat": 30.240719797674036,82 "lon": -97.7857976595405683 }84 },85 {86 "type": "route",87 "functions": [88 "ELEVATOR"89 ],90 "pathToNext": "WALKING",91 "position": {92 "lat": 30.24062750793042,93 "lon": -97.7858574810523694 }95 }96 ]97 },98 {99 "content": "standard",100 "type": "Point Address",101 "id": "TOm8JKsIsfWSLBUZ1LciiA",102 "score": 8.4066877365,103 "matchConfidence": {104 "score": 0.5494750373252423105 },106 "address": {107 "streetNumber": "3401",108 "streetName": "North Lamar Boulevard",109 "municipality": "Austin",110 "neighbourhood": "West Campus",111 "countrySecondarySubdivision": "Travis",112 "countrySubdivision": "TX",113 "countrySubdivisionName": "Texas",114 "countrySubdivisionCode": "TX",115 "postalCode": "78705",116 "extendedPostalCode": "78705-1115",117 "countryCode": "US",118 "country": "United States",119 "countryCodeISO3": "USA",120 "freeformAddress": "3401 North Lamar Boulevard, Austin, TX 78705",121 "localName": "Austin"122 },123 "position": {124 "lat": 30.30278,125 "lon": -97.74438126 },127 "viewport": {128 "topLeftPoint": {129 "lat": 30.30368,130 "lon": -97.74542131 },132 "btmRightPoint": {133 "lat": 30.30188,134 "lon": -97.74334135 }136 },137 "entryPoints": [138 {139 "type": "main",140 "position": {141 "lat": 30.30295,142 "lon": -97.74455143 }144 }145 ]146 }147 ]148}
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 |
object | Summary information about the search that was performed. summary object |
array | The result list, sorted in descending order by score. |
summary object | |
Field | Description |
string | The query as interpreted by the search engine. |
string | Response type. Can be
|
integer | Time spent on resolving the query. |
integer | The number of results in the response. |
integer | The starting offset of the returned results within the full result set. |
integer | The total number of results found. |
integer | The maximum fuzzy level required to provide results. |
object | The position used to bias the results: Latitude, Longitude |
string | Indicates if premium content in the response. Value: One of:
|
results array | |
Field | Description |
string | Indicates if premium content returned in the given result. Value: One of:
|
string | Type of result. Value: One of:
|
string | the non-stable unique id for this result. |
double | The score of the result. A larger score means there is a probability that a result meeting the query criteria is higher.
|
object | The confidence of the result's textual match with the query. matchConfidence object |
double | Unit: meters. This is the distance to an object if |
object | The structured address for the result. address object |
object | The additional premium details around the address. addressDetails object |
object | The position of the result: Latitude, Longitude.
|
array | List of mapcodes object |
object | A viewport which can be used to display the result on a map. viewport object |
object | Optional section. Only present if type == Geography. A bounding box which can be used to display the result on a map defined by minimum and maximum longitudes and latitudes. boundingBox object |
array | A list of entry points. Standard content - This is a list of points that give access to the Address. Premium content - These are sequenced array of waypoints intended to be used for delivery or navigation leading up to the house, building or unit address. entryPoints array |
object | The address ranges on a street segment. Available only for results where the result type is equal to Address Range. addressRanges object |
object | An optional section. These are unique reference ids for use with the Additional Data service. dataSources object |
address object | |
Field | Description |
string | The building number on the street. |
string | The street name. |
string | Sub / Super City |
string | City / Town |
string | County |
string | Named Area |
string | State or Province |
string | Postal Code / Zip Code |
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. Note: This field only appears for geographies having
|
string | Extended postal code (availability dependent on region). |
string | A country's code (Note: This is a two-letter code, not a country name.). |
string | Country name |
string | ISO alpha-3 country code |
string | An address line formatted according to the formatting rules of the
result's country of origin. In the case of countries, its full
country name. For the USA, in the case of geographies with
|
string | The full name of the first level of country administrative hierarchy.
This field appears only in case |
string |
|
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. |
string | This refers to the next level of address granularity. Usually, apartment unit number. For example, in the USA, this is the second line of the address. |
addressDetails object | |
Field | Description |
integer | Number of units in the Apartment/Complex. |
integer | Number of buildings in the Apartment/Complex. |
integer | Floor of the current unit. |
boolean | Flag for elevator availability. |
boolean | Flag for stairs availability. |
boolean | Flag for parking availability. |
string | Name of the Apartment/Complex. |
integer | Wall height of the boundary walls. |
matchConfidence object | |
Field | Description |
double | Represents the overall textual match score, in the range of [0..1], where 1 means a perfect match and 0 - no match. Example:
Score is calculated on primary address components only; the secondary address line is not considered |
mapcodes object | |
Field | Description |
string | Type of mapcode:
|
string | The full form of a mapcode ( |
string | The
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
|
string | The mapcode without the |
viewport object | |
Field | Description |
object | Top-left corner of the rectangle: |
object | Bottom-right corner of the rectangle: |
boundingBox object | |
Field | Description |
object | Top-left position of the bounding box: |
object | Bottom-right position of the bounding box: |
entryPoints array | |
Field | Description |
string | The main entry point. One of:
|
array | If present, represents the type of access for the Address. Standard content, the Entrypoint type is
Premium content, the entrypoint type is
|
string | The navigational modality to the next entryPoint. One of:
|
object | Position of the entry point. |
addressRanges object | |
Field | Description |
string | An address range on the left side of a street segment (assuming looking from the "from" end toward the "to" end). |
string | An address range on the right side of a street segment (assuming looking from the "from" end toward the "to" end). |
object | The beginning point of a street segment: Latitude, Longitude |
object | The end point of a street segment: Latitude, Longitude |
dataSources object | |
Field | Description |
object | Information about the geometric shape of the result. Only present if
|
geometry | |
Field | Description |
string | Pass this as |
LatLon | |
Field | Description |
float | Latitude. min/max: -90 to +90 |
float | Longitude. min/max: -180 to +180 |
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 |
| OK : The search successfully returned zero or more results. |
| Bad Request : One or more parameters were incorrectly specified. |
| Forbidden : Possible causes include:
|
| Method Not Allowed : The HTTPS method ( |
| Not Found : The HTTPS request method ( |
| Too Many Requests : The API Key is over QPS (Queries per second). |
| 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 |
---|---|
Ensures that clients implementing the CORS security model are able to access the response from this service. Value: An asterisk | |
Indicates the format of the response, as chosen by the client. Format: Values: | |
If requested by the client, the Search service applies gzip compression to the responses with the Accept-Encoding header. Value: | |
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 |
Error response
The error response content type depends on the ext
parameter.
1{2 "errorText": "Error parsing 'language': Language tag 'en-ES' not supported",3 "detailedError": {4 "code": "BadRequest",5 "message": "Error parsing 'language': Language tag 'en-ES' not supported",6 "target": "language"7 },8 "httpStatusCode": "400"9}
1<?xml version="1.0" encoding="UTF-8"?>2<response>3 <errorText>Error parsing 'language': Language tag 'en-ES' not supported</errorText>4 <detailedError>5 <code>BadRequest</code>6 <message>Error parsing 'language': Language tag 'en-ES' not supported</message>7 <target>language</target>8 </detailedError>9 <httpStatusCode>400</httpStatusCode>10</response>
Error response fields
Primary fields | |
---|---|
Field | Description |
string | A human-readable description of the error. |
object | Detailed information about the error. detailedError object |
integer | HTTP response codes signifying failed requests to an API server. |
detailedError object | |
Field | Description |
string | One of a server-defined set of error codes. |
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. |
string | Optional. Target of the particular error. Value: The name of the request parameter causing the error. |
Additional information
Indexes abbreviation values
In some cases, a list of indexes can be passed as a parameter to query, which should be listed with their abbreviations, available values are:
Geo
= Geographies - areas on map which represent administrative divison of a land i.e., country, state, city.PAD
= Point Addresses - points on a map where a specific address with a street name and number can be found in the index, i.e., Soquel Dr 2501.Addr
= Address ranges - for some streets there are address points that are interpolated from the beginning and end of the street, those points are represented as address ranges.Str
= Streets - representation of streets on the map.XStr
= Cross Streets (intersections) - representations of junctions; places where two streets intersect.