Skip to content
GuidesPlaygroundDashboard

Forward geocode an address

geocode.forward(GeocodeForwardParams**kwargs) -> GeocodeResult
GET/api/v1/geocode

Forward geocode an address

ParametersExpand Collapse
q: str

Address or place name

bbox: Optional[str]

Bounding box filter: south,west,north,east

country_code: Optional[str]

ISO 3166-1 alpha-2 country code filter

lang: Optional[str]

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

lat: Optional[float]

Focus latitude

layer: Optional[str]

Filter by layer: address, poi, or admin

limit: Optional[int]

Maximum results (default 20, max 100)

lng: Optional[float]

Focus longitude

ReturnsExpand Collapse
class GeocodeResult:

GeoJSON FeatureCollection of geocoding results

features: List[GeocodingFeature]
geometry: GeoJsonGeometry
coordinates: Union[List[float], List[List[float]], List[List[List[float]]], List[List[List[List[float]]]]]

GeoJSON coordinates array (nesting depth varies by geometry type)

One of the following:
List[float]
List[List[float]]
List[List[List[float]]]
List[List[List[List[float]]]]
type: Literal["Point", "LineString", "Polygon", 3 more]
One of the following:
"Point"
"LineString"
"Polygon"
"MultiPoint"
"MultiLineString"
"MultiPolygon"
properties: Properties
country_code: Optional[str]

ISO 3166-1 alpha-2 country code

display_name: Optional[str]

Formatted address or place name

distance_m: Optional[float]

Distance in meters

osm_id: Optional[int]

OpenStreetMap ID

osm_type: Optional[str]

OSM element type

score: Optional[float]

Match confidence score

source: Optional[str]

Result source (address, place, interpolation)

type: Literal["Feature"]
type: Literal["FeatureCollection"]

Forward geocode an address

import os
from plaza import Plaza

client = Plaza(
    api_key=os.environ.get("PLAZA_API_KEY"),  # This is the default and can be omitted
)
geocode_result = client.geocode.forward(
    q="q",
)
print(geocode_result.features)
Returns Examples