Skip to content
GuidesPlaygroundDashboard

Autocomplete a partial address

geocode().autocomplete(GeocodeAutocompleteParamsparams, RequestOptionsrequestOptions = RequestOptions.none()) : AutocompleteResult
GET/api/v1/geocode/autocomplete

Autocomplete a partial address

ParametersExpand Collapse
params: GeocodeAutocompleteParams
q: String

Partial address query

countryCode: Optional<String>

ISO 3166-1 alpha-2 country code filter

lang: Optional<String>

Language code for localized names (e.g. en, de, fr)

lat: Optional<Double>

Focus latitude

layer: Optional<String>

Filter by layer: address, poi, or admin

limit: Optional<Long>

Maximum results (default 10, max 20)

lng: Optional<Double>

Focus longitude

ReturnsExpand Collapse
class AutocompleteResult:

GeoJSON FeatureCollection of autocomplete suggestions

features: List<GeocodingFeature>
geometry: GeoJsonGeometry
coordinates: Coordinates

GeoJSON coordinates array (nesting depth varies by geometry type)

One of the following:
List<Double>
List<List<Double>>
List<List<List<Double>>>
List<List<List<List<Double>>>>
type: Type
One of the following:
POINT("Point")
LINE_STRING("LineString")
POLYGON("Polygon")
MULTI_POINT("MultiPoint")
MULTI_LINE_STRING("MultiLineString")
MULTI_POLYGON("MultiPolygon")
properties: Properties
countryCode: Optional<String>

ISO 3166-1 alpha-2 country code

displayName: Optional<String>

Formatted address or place name

distanceM: Optional<Double>

Distance in meters

osmId: Optional<Long>

OpenStreetMap ID

osmType: Optional<String>

OSM element type

score: Optional<Double>

Match confidence score

source: Optional<String>

Result source (address, place, interpolation)

type: Type
type: Type

Autocomplete a partial address

package com.plazafyi.example

import com.plazafyi.client.PlazaClient
import com.plazafyi.client.okhttp.PlazaOkHttpClient
import com.plazafyi.models.geocode.AutocompleteResult
import com.plazafyi.models.geocode.GeocodeAutocompleteParams

fun main() {
    val client: PlazaClient = PlazaOkHttpClient.fromEnv()

    val params: GeocodeAutocompleteParams = GeocodeAutocompleteParams.builder()
        .q("q")
        .build()
    val autocompleteResult: AutocompleteResult = client.geocode().autocomplete(params)
}
Returns Examples