## Forward geocode an address `client.Geocode.Forward(ctx, query) (*GeocodeResult, error)` **get** `/api/v1/geocode` Forward geocode an address ### Parameters - `query GeocodeForwardParams` - `Q param.Field[string]` Address or place name - `Bbox param.Field[string]` Bounding box filter: south,west,north,east - `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 20, max 100) - `Lng param.Field[float64]` Focus longitude ### Returns - `type GeocodeResult struct{…}` GeoJSON FeatureCollection of geocoding results - `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 GeocodeResultType` - `const GeocodeResultTypeFeatureCollection GeocodeResultType = "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"), ) geocodeResult, err := client.Geocode.Forward(context.TODO(), githubcomplazafyiplazago.GeocodeForwardParams{ Q: githubcomplazafyiplazago.F("q"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", geocodeResult.Features) } ```