localitiesAutocomplete

fun localitiesAutocomplete(input: String, types: List<LocalitiesTypes>? = null, componentsCountries: List<String>? = null, language: String? = null, location: LatLng? = null, radius: Int? = null, data: Data? = null, extended: Extended? = null, customDescription: Map<LocalitiesTypes, String>? = null): List<LocalitiesAutocompleteResponse>?

Autocomplete for Localities Autocomplete on worldwide suggestions for a for text-based geographic searches. It can match on full words as well as substrings. You can therefore send queries as the user types, to provide on-the-fly city names, postal codes or suburb name suggestions. >⚠️ To retrieve fields marked as deprecated in response schema, please read #operation/localitiesDetails

Return

LocalitiesAutocompleteCollectionResponse

Parameters

input

The text string on which to search, for example: "london" or "123 Cross Road". The Woosmap Localities API will return predictions matches based on this string and order the results based on their perceived relevance.

types

The types of suggestion to return. Not specifying any type will only query locality and postal_code. (optional)

componentsCountries

A grouping of countries to which you would like to restrict your results. Countries must be passed as an ISO 3166-1 Alpha-2 or Alpha-3 compatible country code. For example: fr or fra would restrict your results to places within France. (optional)

language

The language code, using ISO 3166-1 Alpha-2 country codes, indicating in which language the results should be returned, if possible. If language is not supplied, the Localities service will use english as default language. No language necessary for postal_code request. (optional)

location

This parameter is used to add a bias to the autocomplete feature. The location defines the point around which to retrieve results in priority. It must be specified in the latitude,longitude string format. (optional)

radius

This parameter may be used in addition to the location parameter to define the distance in meters within which the API will return results in priority. Results outside of the defined area may still be displayed. Default radius if this parameter is not set is 100 000. (optional)

data

Two values for this parameter: standard or advanced. By default, if the parameter is not defined, value is set as standard. The advanced value opens suggestions to worldwide postal codes in addition to postal codes for Western Europe. A dedicated option subject to specific billing on your license is needed to use this parameter. Please contact us if you are interested in using this parameter and you do not have subscribed the proper option yet. (optional)

extended

If set, this parameter allows a refined search over locality names that bears the same postal code. By triggering this parameter, integrators will benefit from a search spectrum on the locality type that includes postal codes. To avoid confusion, it is recommended not to activate this parameter along with the postal_code type which could lead to duplicate locations. Also, the default description returned by the API changes to name (postal code), admin_1, admin_0. It is only available for France and Italy. (optional)

customDescription

This parameter allows to choose the description format for all or some of the suggestion types selected. The custom formats are described as follows (available fields depend on the returned type): custom_description=type_A:"{field_1}, {field_2}, [...]"|type_B:"{field_1}, {field_2}, [...]" (optional)

Throws

If the request is not correctly configured

Rethrows the OkHttp execute method exception

If the API returns an informational or redirection response

ClientException

If the API returns a client error response

ServerException

If the API returns a server error response