## Autocomplete a partial address `client.Geocode.Autocomplete(ctx, query) (*AutocompleteResult, error)` **get** `/api/v1/geocode/autocomplete` Autocomplete a partial address ### Parameters - `query GeocodeAutocompleteParams` - `Q param.Field[string]` Partial address query - `CountryCode param.Field[string]` ISO 3166-1 alpha-2 country code filter - `Lang param.Field[string]` Language code for localized names (e.g. en, de, fr) - `Lat param.Field[float64]` Focus latitude - `Layer param.Field[string]` Filter by layer: address, poi, or admin - `Limit param.Field[int64]` Maximum results (default 10, max 20) - `Lng param.Field[float64]` Focus longitude ### Returns - `type AutocompleteResult struct{…}` GeoJSON FeatureCollection of autocomplete suggestions - `Features []GeocodingFeature` - `Geometry GeoJsonGeometry` - `Coordinates GeoJsonGeometryCoordinatesUnion` GeoJSON coordinates array (nesting depth varies by geometry type) - `type GeoJsonGeometryCoordinatesArray []float64` - `type GeoJsonGeometryCoordinatesArray [][]float64` - `type GeoJsonGeometryCoordinatesArray [][][]float64` - `type GeoJsonGeometryCoordinatesArray [][][][]float64` - `Type GeoJsonGeometryType` - `const GeoJsonGeometryTypePoint GeoJsonGeometryType = "Point"` - `const GeoJsonGeometryTypeLineString GeoJsonGeometryType = "LineString"` - `const GeoJsonGeometryTypePolygon GeoJsonGeometryType = "Polygon"` - `const GeoJsonGeometryTypeMultiPoint GeoJsonGeometryType = "MultiPoint"` - `const GeoJsonGeometryTypeMultiLineString GeoJsonGeometryType = "MultiLineString"` - `const GeoJsonGeometryTypeMultiPolygon GeoJsonGeometryType = "MultiPolygon"` - `Properties GeocodingFeatureProperties` - `CountryCode string` ISO 3166-1 alpha-2 country code - `DisplayName string` Formatted address or place name - `DistanceM float64` Distance in meters - `OsmID int64` OpenStreetMap ID - `OsmType string` OSM element type - `Score float64` Match confidence score - `Source string` Result source (address, place, interpolation) - `Type GeocodingFeatureType` - `const GeocodingFeatureTypeFeature GeocodingFeatureType = "Feature"` - `Type AutocompleteResultType` - `const AutocompleteResultTypeFeatureCollection AutocompleteResultType = "FeatureCollection"` ### Example ```go package main import ( "context" "fmt" "github.com/plazafyi/plaza-go" "github.com/plazafyi/plaza-go/option" ) func main() { client := githubcomplazafyiplazago.NewClient( option.WithAPIKey("My API Key"), ) autocompleteResult, err := client.Geocode.Autocomplete(context.TODO(), githubcomplazafyiplazago.GeocodeAutocompleteParams{ Q: githubcomplazafyiplazago.F("q"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", autocompleteResult.Features) } ```