Suggest
Purpose
Delivers as-you-type suggestions for important or nearby locations and related discoverable concepts.
Use this endpoint to provide a short list of contextualized, explainable suggestions relevant to the current state of the user's query-typing session.
Results are optimized for listing-based displays.
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: POST
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.
https://{baseURL}/maps/orbis/places/suggest
https://api.tomtom.com/maps/orbis/places/suggest
1curl -X POST 'https://api.tomtom.com/maps/orbis/places/suggest' \2 -H 'TomTom-Api-Key: {Your_API_Key}' \3 -H 'TomTom-Api-Version: 3' \4 -H 'Attributes: results' \5 -H 'Content-Type: application/json' \6 -d '{7 "query": "restau",8 "origin": {9 "type": "point",10 "coordinates": [ 13.4312, 54.3927 ]11 },12 "preferences": {13 "geometry": {14 "type": "point",15 "coordinates": [ 13.4312, 54.3927 ]16 }17 }18 }'
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 |
|---|---|
| Base URL for calling the API.
|
| An API Key valid for the requested service. See: How do I get a TomTom API Key? |
| Version of the API. The API version MUST be specified in all requests. |
| A comma-separated list of response attributes to return. Nested attributes are specified in dot notation. Multiple attributes sharing the same parent can be grouped together using parentheses.
Examples:
|
Optional parameters | Description |
|---|---|
| A unique identifier that must be a 36-character hyphenated UUID (v4 or v7) in the format |
| 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. |
| Sequence of preferred response IETF BCP 47 language tags compliant with RFC 7231 (section 5.3.5). |
| The standard HTTP Accept header indicating the media type(s) the client is able to understand. HTTP reference |
Request body
The following table describes the JSON request body parameters.
Content Type: application/json
Required: false
Description: Additional request parameters.
Request body parameters | Description |
|---|---|
| Text query, typically a partial search query typed-in thus far. Expected to return useful suggestions matching the query text. |
| The position from which result distances are calculated, populating the
Example: |
| Maximum number of results to return. |
| Geopolitical view. The context used to resolve the handling of addressing schemes in disputed territories.
The default and available values depend on the country where the request is made in. If valid value but non available one is used the 403 error is raised. Possible values and defaults(per request-origin country) are as follows:
When not specified, the appropriate geopolitical view is applied based on the origin location of the request. |
| Filters to apply to suggest requests. Filter parameters narrow the set of candidate results and do not affect result ranking or ordering.
|
| Preferences for results.
|
Response data
Response body - JSON
See the response body example and the response field documentation below for more information.
1{2 "results": [3 {4 "more": {5 "operation": "discover",6 "requestBody": null,7 "poiTypes": [8 "charging_location"9 ],10 "origin": {11 "type": "point",12 "coordinates": [13 0.0098,14 51.493415 ]16 }17 },18 "type": "poi",19 "title": "string",20 "subtitles": [21 "string"22 ],23 "distanceInMeters": 024 }25 ]26}
Response fields
The following table describes all of the fields that can appear in a response.
Field | Description |
|---|---|
| A list of suggestions for the current state of the user's query-typing session. Each result can be one of the following types: |
Common result properties | |
| Field | Description |
| Unique identifier of the result. |
| Type of the result. |
| Localized display title for the result. |
| An ordered list of localized text lines that help to understand the result, such as providing additional information or display a colloquial, region-specific address. |
| Distance of the result from the origin in meters. |
| Follow-up request information for getting more details. Contains |
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. |
poi result (Place of Interest) | |
| Field | Description |
| Types of places of interest associated with this place of interest. Each object contains |
| Brands associated with this place of interest. Each object contains |
area result | |
| Field | Description |
| Type of area. |
Response codes
The following table contains response codes sent back from an API server.
Code | Meaning & possible causes |
|---|---|
| OK: A list of suggestions. |
| Bad Request: The request was invalid. |
| Forbidden: The API Key is missing, inactive, invalid, not entitled to use this API, or the geopolitical view is not available for the request origin. |
| Not Found: The requested resource could not be found. |
| 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 data table contains response headers sent back from an API server.
Header | Description |
|---|---|
Session-Id | A unique identifier that must be a 36-character hyphenated UUID (v4 or v7) in the format |
Tracking-Id | A unique identifier for tracking the request across services. If the client provided a Tracking-Id in the request header, this value is echoed back. If not provided, TomTom systems will generate a tracking identifier automatically. This identifier enables effective request tracing and correlation in logs. |
Indicates the format of the response as chosen by the client. | |
The HTTP Content-Language representation header is used to describe the language(s) intended for the audience. |
Error response
When an error occurs, the response contains detailed error information.
1{2 "detailedError": {3 "code": "string",4 "message": "string",5 "target": "string",6 "details": [7 {8 "code": "string",9 "message": "string",10 "target": "string"11 }12 ],13 "innerError": {14 "code": "string",15 "innerError": {}16 }17 }18}
Field | Description |
|---|---|
detailedError object | |
| Field | Description |
| A unique identifier for this particular occurrence of the problem that SHOULD be human-readable. |
| It is intended as an aid to developers and is not suitable for exposure to end users. Do not build logic on the content of this field and rely on the |
| The target of the error (e.g., the name of the property in error). |
| Additional details about the error. |
| The contents of this object are service-defined. Each nested |