# Geocode ## Forward geocode an address `geocode().forward(GeocodeForwardParamsparams, RequestOptionsrequestOptions = RequestOptions.none()) : GeocodeResult` **get** `/api/v1/geocode` Forward geocode an address ### Parameters - `params: GeocodeForwardParams` - `q: String` Address or place name - `bbox: Optional` Bounding box filter: south,west,north,east - `countryCode: Optional` ISO 3166-1 alpha-2 country code filter - `lang: Optional` Language code for localized names (e.g. en, de, fr) - `lat: Optional` Focus latitude - `layer: Optional` Filter by layer: address, poi, or admin - `limit: Optional` Maximum results (default 20, max 100) - `lng: Optional` Focus longitude ### Returns - `class GeocodeResult:` GeoJSON FeatureCollection of forward geocoding results, ordered by relevance. Content-Type: `application/geo+json`. - `features: List` Geocoding results ordered by relevance score - `geometry: GeoJsonGeometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `coordinates: Coordinates` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `List` - `List>` - `List>>` - `List>>>` - `type: Type` Geometry type - `POINT("Point")` - `LINE_STRING("LineString")` - `POLYGON("Polygon")` - `MULTI_POINT("MultiPoint")` - `MULTI_LINE_STRING("MultiLineString")` - `MULTI_POLYGON("MultiPolygon")` - `properties: Properties` Geocoding result properties - `displayName: String` Formatted address or place name - `category: Optional` POI category (e.g. restaurant, cafe, park). Present for place results. - `city: Optional` City or town name. Present for address results. - `confidence: Optional` Interpolation confidence (0-1). Present only for interpolated results. - `country: Optional` Country name. Present for reverse geocode address results. - `countryCode: Optional` ISO 3166-1 alpha-2 country code - `distanceM: Optional` Distance from the query point in meters (reverse geocode / nearby only) - `fullAddress: Optional` Complete formatted address from the database. Present for reverse geocode address results. - `houseNumber: Optional` House or building number. Present for address and interpolated results. - `interpolated: Optional` Whether this result was estimated by address interpolation rather than an exact database match. - `name: Optional` Place name (raw). Present for reverse geocode place results. - `osmId: Optional` OpenStreetMap element ID (null for interpolated results) - `osmType: Optional` OSM element type (node, way, relation) - `NODE("node")` - `WAY("way")` - `RELATION("relation")` - `postcode: Optional` Postal code. Present for reverse geocode address results. - `score: Optional` Relevance score (higher is better). Incorporates text match quality, spatial proximity boost, and popularity signals. Not bounded to 0-1. - `source: Optional` Result source indicating how the result was found: structured (exact field match), bm25 (full-text search), fuzzy (trigram similarity), address (reverse geocode address), place (reverse geocode POI), interpolation (estimated from neighboring addresses) - `STRUCTURED("structured")` - `BM25("bm25")` - `FUZZY("fuzzy")` - `ADDRESS("address")` - `PLACE("place")` - `INTERPOLATION("interpolation")` - `state: Optional` State or province name. Present for reverse geocode address results. - `street: Optional` Street name. Present for address and interpolated results. - `subcategory: Optional` POI subcategory. Present for place results. - `tags: Optional` Raw OSM tags. Present for place results. - `wikipedia: Optional` Wikipedia article reference (e.g. en:Eiffel Tower). Present for notable places. - `type: Type` - `FEATURE("Feature")` - `type: Type` - `FEATURE_COLLECTION("FeatureCollection")` ### Example ```kotlin package com.plazafyi.example import com.plazafyi.client.PlazaClient import com.plazafyi.client.okhttp.PlazaOkHttpClient import com.plazafyi.models.geocode.GeocodeForwardParams import com.plazafyi.models.geocode.GeocodeResult fun main() { val client: PlazaClient = PlazaOkHttpClient.fromEnv() val params: GeocodeForwardParams = GeocodeForwardParams.builder() .q("q") .build() val geocodeResult: GeocodeResult = client.geocode().forward(params) } ``` #### Response ```json { "features": [ { "geometry": { "coordinates": [ 2.3522, 48.8566 ], "type": "Point" }, "properties": { "display_name": "221B Baker Street, London, NW1 6XE, United Kingdom", "category": "restaurant", "city": "London", "confidence": 0, "country": "United Kingdom", "country_code": "GB", "distance_m": 0, "full_address": "221B Baker Street, London, NW1 6XE, United Kingdom", "house_number": "221B", "interpolated": true, "name": "Eiffel Tower", "osm_id": 21154906, "osm_type": "node", "postcode": "NW1 6XE", "score": 0, "source": "structured", "state": "England", "street": "Baker Street", "subcategory": "italian", "tags": { "foo": "string" }, "wikipedia": "en:Eiffel Tower" }, "type": "Feature" } ], "type": "FeatureCollection" } ``` ## Forward geocode an address `geocode().forwardPost(GeocodeForwardPostParamsparams, RequestOptionsrequestOptions = RequestOptions.none()) : GeocodeResult` **post** `/api/v1/geocode` Forward geocode an address ### Parameters - `params: GeocodeForwardPostParams` - `q: String` Address or place name - `bbox: Optional` Bounding box filter: south,west,north,east - `countryCode: Optional` ISO 3166-1 alpha-2 country code filter - `lang: Optional` Language code for localized names (e.g. en, de, fr) - `lat: Optional` Focus latitude - `layer: Optional` Filter by layer: address, poi, or admin - `limit: Optional` Maximum results (default 20, max 100) - `lng: Optional` Focus longitude ### Returns - `class GeocodeResult:` GeoJSON FeatureCollection of forward geocoding results, ordered by relevance. Content-Type: `application/geo+json`. - `features: List` Geocoding results ordered by relevance score - `geometry: GeoJsonGeometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `coordinates: Coordinates` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `List` - `List>` - `List>>` - `List>>>` - `type: Type` Geometry type - `POINT("Point")` - `LINE_STRING("LineString")` - `POLYGON("Polygon")` - `MULTI_POINT("MultiPoint")` - `MULTI_LINE_STRING("MultiLineString")` - `MULTI_POLYGON("MultiPolygon")` - `properties: Properties` Geocoding result properties - `displayName: String` Formatted address or place name - `category: Optional` POI category (e.g. restaurant, cafe, park). Present for place results. - `city: Optional` City or town name. Present for address results. - `confidence: Optional` Interpolation confidence (0-1). Present only for interpolated results. - `country: Optional` Country name. Present for reverse geocode address results. - `countryCode: Optional` ISO 3166-1 alpha-2 country code - `distanceM: Optional` Distance from the query point in meters (reverse geocode / nearby only) - `fullAddress: Optional` Complete formatted address from the database. Present for reverse geocode address results. - `houseNumber: Optional` House or building number. Present for address and interpolated results. - `interpolated: Optional` Whether this result was estimated by address interpolation rather than an exact database match. - `name: Optional` Place name (raw). Present for reverse geocode place results. - `osmId: Optional` OpenStreetMap element ID (null for interpolated results) - `osmType: Optional` OSM element type (node, way, relation) - `NODE("node")` - `WAY("way")` - `RELATION("relation")` - `postcode: Optional` Postal code. Present for reverse geocode address results. - `score: Optional` Relevance score (higher is better). Incorporates text match quality, spatial proximity boost, and popularity signals. Not bounded to 0-1. - `source: Optional` Result source indicating how the result was found: structured (exact field match), bm25 (full-text search), fuzzy (trigram similarity), address (reverse geocode address), place (reverse geocode POI), interpolation (estimated from neighboring addresses) - `STRUCTURED("structured")` - `BM25("bm25")` - `FUZZY("fuzzy")` - `ADDRESS("address")` - `PLACE("place")` - `INTERPOLATION("interpolation")` - `state: Optional` State or province name. Present for reverse geocode address results. - `street: Optional` Street name. Present for address and interpolated results. - `subcategory: Optional` POI subcategory. Present for place results. - `tags: Optional` Raw OSM tags. Present for place results. - `wikipedia: Optional` Wikipedia article reference (e.g. en:Eiffel Tower). Present for notable places. - `type: Type` - `FEATURE("Feature")` - `type: Type` - `FEATURE_COLLECTION("FeatureCollection")` ### Example ```kotlin package com.plazafyi.example import com.plazafyi.client.PlazaClient import com.plazafyi.client.okhttp.PlazaOkHttpClient import com.plazafyi.models.geocode.GeocodeForwardPostParams import com.plazafyi.models.geocode.GeocodeResult fun main() { val client: PlazaClient = PlazaOkHttpClient.fromEnv() val params: GeocodeForwardPostParams = GeocodeForwardPostParams.builder() .q("q") .build() val geocodeResult: GeocodeResult = client.geocode().forwardPost(params) } ``` #### Response ```json { "features": [ { "geometry": { "coordinates": [ 2.3522, 48.8566 ], "type": "Point" }, "properties": { "display_name": "221B Baker Street, London, NW1 6XE, United Kingdom", "category": "restaurant", "city": "London", "confidence": 0, "country": "United Kingdom", "country_code": "GB", "distance_m": 0, "full_address": "221B Baker Street, London, NW1 6XE, United Kingdom", "house_number": "221B", "interpolated": true, "name": "Eiffel Tower", "osm_id": 21154906, "osm_type": "node", "postcode": "NW1 6XE", "score": 0, "source": "structured", "state": "England", "street": "Baker Street", "subcategory": "italian", "tags": { "foo": "string" }, "wikipedia": "en:Eiffel Tower" }, "type": "Feature" } ], "type": "FeatureCollection" } ``` ## Reverse geocode a coordinate `geocode().reverse(GeocodeReverseParamsparams = GeocodeReverseParams.none(), RequestOptionsrequestOptions = RequestOptions.none()) : ReverseGeocodeResult` **get** `/api/v1/geocode/reverse` Reverse geocode a coordinate ### Parameters - `params: GeocodeReverseParams` - `lang: Optional` Language code for localized names (e.g. en, de, fr) - `lat: Optional` Legacy shorthand. Latitude. Use near param instead. - `layer: Optional` Filter by layer: house or poi - `limit: Optional` Maximum results (default 1, max 20) - `lng: Optional` Legacy shorthand. Longitude. Use near param instead. - `near: Optional` Point geometry for reverse geocode (lat,lng or GeoJSON). Alternative to lat/lng params. - `radius: Optional` Search radius in meters (default 200, max 5000) ### Returns - `class ReverseGeocodeResult:` GeoJSON FeatureCollection of reverse geocoding results, ordered by distance from the query point. Content-Type: `application/geo+json`. - `features: List` Reverse geocoding results ordered by distance - `geometry: GeoJsonGeometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `coordinates: Coordinates` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `List` - `List>` - `List>>` - `List>>>` - `type: Type` Geometry type - `POINT("Point")` - `LINE_STRING("LineString")` - `POLYGON("Polygon")` - `MULTI_POINT("MultiPoint")` - `MULTI_LINE_STRING("MultiLineString")` - `MULTI_POLYGON("MultiPolygon")` - `properties: Properties` Geocoding result properties - `displayName: String` Formatted address or place name - `category: Optional` POI category (e.g. restaurant, cafe, park). Present for place results. - `city: Optional` City or town name. Present for address results. - `confidence: Optional` Interpolation confidence (0-1). Present only for interpolated results. - `country: Optional` Country name. Present for reverse geocode address results. - `countryCode: Optional` ISO 3166-1 alpha-2 country code - `distanceM: Optional` Distance from the query point in meters (reverse geocode / nearby only) - `fullAddress: Optional` Complete formatted address from the database. Present for reverse geocode address results. - `houseNumber: Optional` House or building number. Present for address and interpolated results. - `interpolated: Optional` Whether this result was estimated by address interpolation rather than an exact database match. - `name: Optional` Place name (raw). Present for reverse geocode place results. - `osmId: Optional` OpenStreetMap element ID (null for interpolated results) - `osmType: Optional` OSM element type (node, way, relation) - `NODE("node")` - `WAY("way")` - `RELATION("relation")` - `postcode: Optional` Postal code. Present for reverse geocode address results. - `score: Optional` Relevance score (higher is better). Incorporates text match quality, spatial proximity boost, and popularity signals. Not bounded to 0-1. - `source: Optional` Result source indicating how the result was found: structured (exact field match), bm25 (full-text search), fuzzy (trigram similarity), address (reverse geocode address), place (reverse geocode POI), interpolation (estimated from neighboring addresses) - `STRUCTURED("structured")` - `BM25("bm25")` - `FUZZY("fuzzy")` - `ADDRESS("address")` - `PLACE("place")` - `INTERPOLATION("interpolation")` - `state: Optional` State or province name. Present for reverse geocode address results. - `street: Optional` Street name. Present for address and interpolated results. - `subcategory: Optional` POI subcategory. Present for place results. - `tags: Optional` Raw OSM tags. Present for place results. - `wikipedia: Optional` Wikipedia article reference (e.g. en:Eiffel Tower). Present for notable places. - `type: Type` - `FEATURE("Feature")` - `type: Type` - `FEATURE_COLLECTION("FeatureCollection")` ### Example ```kotlin package com.plazafyi.example import com.plazafyi.client.PlazaClient import com.plazafyi.client.okhttp.PlazaOkHttpClient import com.plazafyi.models.geocode.GeocodeReverseParams import com.plazafyi.models.geocode.ReverseGeocodeResult fun main() { val client: PlazaClient = PlazaOkHttpClient.fromEnv() val reverseGeocodeResult: ReverseGeocodeResult = client.geocode().reverse() } ``` #### Response ```json { "features": [ { "geometry": { "coordinates": [ 2.3522, 48.8566 ], "type": "Point" }, "properties": { "display_name": "221B Baker Street, London, NW1 6XE, United Kingdom", "category": "restaurant", "city": "London", "confidence": 0, "country": "United Kingdom", "country_code": "GB", "distance_m": 0, "full_address": "221B Baker Street, London, NW1 6XE, United Kingdom", "house_number": "221B", "interpolated": true, "name": "Eiffel Tower", "osm_id": 21154906, "osm_type": "node", "postcode": "NW1 6XE", "score": 0, "source": "structured", "state": "England", "street": "Baker Street", "subcategory": "italian", "tags": { "foo": "string" }, "wikipedia": "en:Eiffel Tower" }, "type": "Feature" } ], "type": "FeatureCollection" } ``` ## Reverse geocode a coordinate `geocode().reversePost(GeocodeReversePostParamsparams = GeocodeReversePostParams.none(), RequestOptionsrequestOptions = RequestOptions.none()) : ReverseGeocodeResult` **post** `/api/v1/geocode/reverse` Reverse geocode a coordinate ### Parameters - `params: GeocodeReversePostParams` - `lang: Optional` Language code for localized names (e.g. en, de, fr) - `lat: Optional` Legacy shorthand. Latitude. Use near param instead. - `layer: Optional` Filter by layer: house or poi - `limit: Optional` Maximum results (default 1, max 20) - `lng: Optional` Legacy shorthand. Longitude. Use near param instead. - `near: Optional` Point geometry for reverse geocode (lat,lng or GeoJSON). Alternative to lat/lng params. - `radius: Optional` Search radius in meters (default 200, max 5000) ### Returns - `class ReverseGeocodeResult:` GeoJSON FeatureCollection of reverse geocoding results, ordered by distance from the query point. Content-Type: `application/geo+json`. - `features: List` Reverse geocoding results ordered by distance - `geometry: GeoJsonGeometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `coordinates: Coordinates` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `List` - `List>` - `List>>` - `List>>>` - `type: Type` Geometry type - `POINT("Point")` - `LINE_STRING("LineString")` - `POLYGON("Polygon")` - `MULTI_POINT("MultiPoint")` - `MULTI_LINE_STRING("MultiLineString")` - `MULTI_POLYGON("MultiPolygon")` - `properties: Properties` Geocoding result properties - `displayName: String` Formatted address or place name - `category: Optional` POI category (e.g. restaurant, cafe, park). Present for place results. - `city: Optional` City or town name. Present for address results. - `confidence: Optional` Interpolation confidence (0-1). Present only for interpolated results. - `country: Optional` Country name. Present for reverse geocode address results. - `countryCode: Optional` ISO 3166-1 alpha-2 country code - `distanceM: Optional` Distance from the query point in meters (reverse geocode / nearby only) - `fullAddress: Optional` Complete formatted address from the database. Present for reverse geocode address results. - `houseNumber: Optional` House or building number. Present for address and interpolated results. - `interpolated: Optional` Whether this result was estimated by address interpolation rather than an exact database match. - `name: Optional` Place name (raw). Present for reverse geocode place results. - `osmId: Optional` OpenStreetMap element ID (null for interpolated results) - `osmType: Optional` OSM element type (node, way, relation) - `NODE("node")` - `WAY("way")` - `RELATION("relation")` - `postcode: Optional` Postal code. Present for reverse geocode address results. - `score: Optional` Relevance score (higher is better). Incorporates text match quality, spatial proximity boost, and popularity signals. Not bounded to 0-1. - `source: Optional` Result source indicating how the result was found: structured (exact field match), bm25 (full-text search), fuzzy (trigram similarity), address (reverse geocode address), place (reverse geocode POI), interpolation (estimated from neighboring addresses) - `STRUCTURED("structured")` - `BM25("bm25")` - `FUZZY("fuzzy")` - `ADDRESS("address")` - `PLACE("place")` - `INTERPOLATION("interpolation")` - `state: Optional` State or province name. Present for reverse geocode address results. - `street: Optional` Street name. Present for address and interpolated results. - `subcategory: Optional` POI subcategory. Present for place results. - `tags: Optional` Raw OSM tags. Present for place results. - `wikipedia: Optional` Wikipedia article reference (e.g. en:Eiffel Tower). Present for notable places. - `type: Type` - `FEATURE("Feature")` - `type: Type` - `FEATURE_COLLECTION("FeatureCollection")` ### Example ```kotlin package com.plazafyi.example import com.plazafyi.client.PlazaClient import com.plazafyi.client.okhttp.PlazaOkHttpClient import com.plazafyi.models.geocode.GeocodeReversePostParams import com.plazafyi.models.geocode.ReverseGeocodeResult fun main() { val client: PlazaClient = PlazaOkHttpClient.fromEnv() val reverseGeocodeResult: ReverseGeocodeResult = client.geocode().reversePost() } ``` #### Response ```json { "features": [ { "geometry": { "coordinates": [ 2.3522, 48.8566 ], "type": "Point" }, "properties": { "display_name": "221B Baker Street, London, NW1 6XE, United Kingdom", "category": "restaurant", "city": "London", "confidence": 0, "country": "United Kingdom", "country_code": "GB", "distance_m": 0, "full_address": "221B Baker Street, London, NW1 6XE, United Kingdom", "house_number": "221B", "interpolated": true, "name": "Eiffel Tower", "osm_id": 21154906, "osm_type": "node", "postcode": "NW1 6XE", "score": 0, "source": "structured", "state": "England", "street": "Baker Street", "subcategory": "italian", "tags": { "foo": "string" }, "wikipedia": "en:Eiffel Tower" }, "type": "Feature" } ], "type": "FeatureCollection" } ``` ## Autocomplete a partial address `geocode().autocomplete(GeocodeAutocompleteParamsparams, RequestOptionsrequestOptions = RequestOptions.none()) : AutocompleteResult` **get** `/api/v1/geocode/autocomplete` Autocomplete a partial address ### Parameters - `params: GeocodeAutocompleteParams` - `q: String` Partial address query - `countryCode: Optional` ISO 3166-1 alpha-2 country code filter - `lang: Optional` Language code for localized names (e.g. en, de, fr) - `lat: Optional` Focus latitude - `layer: Optional` Filter by layer: address, poi, or admin - `limit: Optional` Maximum results (default 10, max 20) - `lng: Optional` Focus longitude ### Returns - `class AutocompleteResult:` GeoJSON FeatureCollection of autocomplete suggestions for partial address input. Optimized for low-latency type-ahead UIs. Content-Type: `application/geo+json`. - `features: List` Autocomplete suggestions ordered by relevance - `geometry: GeoJsonGeometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `coordinates: Coordinates` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `List` - `List>` - `List>>` - `List>>>` - `type: Type` Geometry type - `POINT("Point")` - `LINE_STRING("LineString")` - `POLYGON("Polygon")` - `MULTI_POINT("MultiPoint")` - `MULTI_LINE_STRING("MultiLineString")` - `MULTI_POLYGON("MultiPolygon")` - `properties: Properties` Geocoding result properties - `displayName: String` Formatted address or place name - `category: Optional` POI category (e.g. restaurant, cafe, park). Present for place results. - `city: Optional` City or town name. Present for address results. - `confidence: Optional` Interpolation confidence (0-1). Present only for interpolated results. - `country: Optional` Country name. Present for reverse geocode address results. - `countryCode: Optional` ISO 3166-1 alpha-2 country code - `distanceM: Optional` Distance from the query point in meters (reverse geocode / nearby only) - `fullAddress: Optional` Complete formatted address from the database. Present for reverse geocode address results. - `houseNumber: Optional` House or building number. Present for address and interpolated results. - `interpolated: Optional` Whether this result was estimated by address interpolation rather than an exact database match. - `name: Optional` Place name (raw). Present for reverse geocode place results. - `osmId: Optional` OpenStreetMap element ID (null for interpolated results) - `osmType: Optional` OSM element type (node, way, relation) - `NODE("node")` - `WAY("way")` - `RELATION("relation")` - `postcode: Optional` Postal code. Present for reverse geocode address results. - `score: Optional` Relevance score (higher is better). Incorporates text match quality, spatial proximity boost, and popularity signals. Not bounded to 0-1. - `source: Optional` Result source indicating how the result was found: structured (exact field match), bm25 (full-text search), fuzzy (trigram similarity), address (reverse geocode address), place (reverse geocode POI), interpolation (estimated from neighboring addresses) - `STRUCTURED("structured")` - `BM25("bm25")` - `FUZZY("fuzzy")` - `ADDRESS("address")` - `PLACE("place")` - `INTERPOLATION("interpolation")` - `state: Optional` State or province name. Present for reverse geocode address results. - `street: Optional` Street name. Present for address and interpolated results. - `subcategory: Optional` POI subcategory. Present for place results. - `tags: Optional` Raw OSM tags. Present for place results. - `wikipedia: Optional` Wikipedia article reference (e.g. en:Eiffel Tower). Present for notable places. - `type: Type` - `FEATURE("Feature")` - `type: Type` - `FEATURE_COLLECTION("FeatureCollection")` ### Example ```kotlin 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) } ``` #### Response ```json { "features": [ { "geometry": { "coordinates": [ 2.3522, 48.8566 ], "type": "Point" }, "properties": { "display_name": "221B Baker Street, London, NW1 6XE, United Kingdom", "category": "restaurant", "city": "London", "confidence": 0, "country": "United Kingdom", "country_code": "GB", "distance_m": 0, "full_address": "221B Baker Street, London, NW1 6XE, United Kingdom", "house_number": "221B", "interpolated": true, "name": "Eiffel Tower", "osm_id": 21154906, "osm_type": "node", "postcode": "NW1 6XE", "score": 0, "source": "structured", "state": "England", "street": "Baker Street", "subcategory": "italian", "tags": { "foo": "string" }, "wikipedia": "en:Eiffel Tower" }, "type": "Feature" } ], "type": "FeatureCollection" } ``` ## Autocomplete a partial address `geocode().autocompletePost(GeocodeAutocompletePostParamsparams, RequestOptionsrequestOptions = RequestOptions.none()) : AutocompleteResult` **post** `/api/v1/geocode/autocomplete` Autocomplete a partial address ### Parameters - `params: GeocodeAutocompletePostParams` - `q: String` Partial address query - `countryCode: Optional` ISO 3166-1 alpha-2 country code filter - `lang: Optional` Language code for localized names (e.g. en, de, fr) - `lat: Optional` Focus latitude - `layer: Optional` Filter by layer: address, poi, or admin - `limit: Optional` Maximum results (default 10, max 20) - `lng: Optional` Focus longitude ### Returns - `class AutocompleteResult:` GeoJSON FeatureCollection of autocomplete suggestions for partial address input. Optimized for low-latency type-ahead UIs. Content-Type: `application/geo+json`. - `features: List` Autocomplete suggestions ordered by relevance - `geometry: GeoJsonGeometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `coordinates: Coordinates` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `List` - `List>` - `List>>` - `List>>>` - `type: Type` Geometry type - `POINT("Point")` - `LINE_STRING("LineString")` - `POLYGON("Polygon")` - `MULTI_POINT("MultiPoint")` - `MULTI_LINE_STRING("MultiLineString")` - `MULTI_POLYGON("MultiPolygon")` - `properties: Properties` Geocoding result properties - `displayName: String` Formatted address or place name - `category: Optional` POI category (e.g. restaurant, cafe, park). Present for place results. - `city: Optional` City or town name. Present for address results. - `confidence: Optional` Interpolation confidence (0-1). Present only for interpolated results. - `country: Optional` Country name. Present for reverse geocode address results. - `countryCode: Optional` ISO 3166-1 alpha-2 country code - `distanceM: Optional` Distance from the query point in meters (reverse geocode / nearby only) - `fullAddress: Optional` Complete formatted address from the database. Present for reverse geocode address results. - `houseNumber: Optional` House or building number. Present for address and interpolated results. - `interpolated: Optional` Whether this result was estimated by address interpolation rather than an exact database match. - `name: Optional` Place name (raw). Present for reverse geocode place results. - `osmId: Optional` OpenStreetMap element ID (null for interpolated results) - `osmType: Optional` OSM element type (node, way, relation) - `NODE("node")` - `WAY("way")` - `RELATION("relation")` - `postcode: Optional` Postal code. Present for reverse geocode address results. - `score: Optional` Relevance score (higher is better). Incorporates text match quality, spatial proximity boost, and popularity signals. Not bounded to 0-1. - `source: Optional` Result source indicating how the result was found: structured (exact field match), bm25 (full-text search), fuzzy (trigram similarity), address (reverse geocode address), place (reverse geocode POI), interpolation (estimated from neighboring addresses) - `STRUCTURED("structured")` - `BM25("bm25")` - `FUZZY("fuzzy")` - `ADDRESS("address")` - `PLACE("place")` - `INTERPOLATION("interpolation")` - `state: Optional` State or province name. Present for reverse geocode address results. - `street: Optional` Street name. Present for address and interpolated results. - `subcategory: Optional` POI subcategory. Present for place results. - `tags: Optional` Raw OSM tags. Present for place results. - `wikipedia: Optional` Wikipedia article reference (e.g. en:Eiffel Tower). Present for notable places. - `type: Type` - `FEATURE("Feature")` - `type: Type` - `FEATURE_COLLECTION("FeatureCollection")` ### Example ```kotlin 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.GeocodeAutocompletePostParams fun main() { val client: PlazaClient = PlazaOkHttpClient.fromEnv() val params: GeocodeAutocompletePostParams = GeocodeAutocompletePostParams.builder() .q("q") .build() val autocompleteResult: AutocompleteResult = client.geocode().autocompletePost(params) } ``` #### Response ```json { "features": [ { "geometry": { "coordinates": [ 2.3522, 48.8566 ], "type": "Point" }, "properties": { "display_name": "221B Baker Street, London, NW1 6XE, United Kingdom", "category": "restaurant", "city": "London", "confidence": 0, "country": "United Kingdom", "country_code": "GB", "distance_m": 0, "full_address": "221B Baker Street, London, NW1 6XE, United Kingdom", "house_number": "221B", "interpolated": true, "name": "Eiffel Tower", "osm_id": 21154906, "osm_type": "node", "postcode": "NW1 6XE", "score": 0, "source": "structured", "state": "England", "street": "Baker Street", "subcategory": "italian", "tags": { "foo": "string" }, "wikipedia": "en:Eiffel Tower" }, "type": "Feature" } ], "type": "FeatureCollection" } ``` ## Batch geocode multiple addresses `geocode().batch(GeocodeBatchParamsparams, RequestOptionsrequestOptions = RequestOptions.none()) : GeocodeBatchResponse` **post** `/api/v1/geocode/batch` Batch geocode multiple addresses ### Parameters - `params: GeocodeBatchParams` - `addresses: List` ### Returns - `class GeocodeBatchResponse:` Batch geocoding result. Each entry in `results` is a FeatureCollection corresponding to the input address at the same index. Order is preserved. - `count: Long` Number of addresses processed (always equals length of results) - `results: List` Array of FeatureCollections, one per input address. Empty FeatureCollections indicate no match. - `features: List` Geocoding results ordered by relevance score - `geometry: GeoJsonGeometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `coordinates: Coordinates` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `List` - `List>` - `List>>` - `List>>>` - `type: Type` Geometry type - `POINT("Point")` - `LINE_STRING("LineString")` - `POLYGON("Polygon")` - `MULTI_POINT("MultiPoint")` - `MULTI_LINE_STRING("MultiLineString")` - `MULTI_POLYGON("MultiPolygon")` - `properties: Properties` Geocoding result properties - `displayName: String` Formatted address or place name - `category: Optional` POI category (e.g. restaurant, cafe, park). Present for place results. - `city: Optional` City or town name. Present for address results. - `confidence: Optional` Interpolation confidence (0-1). Present only for interpolated results. - `country: Optional` Country name. Present for reverse geocode address results. - `countryCode: Optional` ISO 3166-1 alpha-2 country code - `distanceM: Optional` Distance from the query point in meters (reverse geocode / nearby only) - `fullAddress: Optional` Complete formatted address from the database. Present for reverse geocode address results. - `houseNumber: Optional` House or building number. Present for address and interpolated results. - `interpolated: Optional` Whether this result was estimated by address interpolation rather than an exact database match. - `name: Optional` Place name (raw). Present for reverse geocode place results. - `osmId: Optional` OpenStreetMap element ID (null for interpolated results) - `osmType: Optional` OSM element type (node, way, relation) - `NODE("node")` - `WAY("way")` - `RELATION("relation")` - `postcode: Optional` Postal code. Present for reverse geocode address results. - `score: Optional` Relevance score (higher is better). Incorporates text match quality, spatial proximity boost, and popularity signals. Not bounded to 0-1. - `source: Optional` Result source indicating how the result was found: structured (exact field match), bm25 (full-text search), fuzzy (trigram similarity), address (reverse geocode address), place (reverse geocode POI), interpolation (estimated from neighboring addresses) - `STRUCTURED("structured")` - `BM25("bm25")` - `FUZZY("fuzzy")` - `ADDRESS("address")` - `PLACE("place")` - `INTERPOLATION("interpolation")` - `state: Optional` State or province name. Present for reverse geocode address results. - `street: Optional` Street name. Present for address and interpolated results. - `subcategory: Optional` POI subcategory. Present for place results. - `tags: Optional` Raw OSM tags. Present for place results. - `wikipedia: Optional` Wikipedia article reference (e.g. en:Eiffel Tower). Present for notable places. - `type: Type` - `FEATURE("Feature")` - `type: Type` - `FEATURE_COLLECTION("FeatureCollection")` ### Example ```kotlin package com.plazafyi.example import com.plazafyi.client.PlazaClient import com.plazafyi.client.okhttp.PlazaOkHttpClient import com.plazafyi.models.geocode.GeocodeBatchParams import com.plazafyi.models.geocode.GeocodeBatchResponse fun main() { val client: PlazaClient = PlazaOkHttpClient.fromEnv() val params: GeocodeBatchParams = GeocodeBatchParams.builder() .addAddress("string") .build() val response: GeocodeBatchResponse = client.geocode().batch(params) } ``` #### Response ```json { "count": 0, "results": [ { "features": [ { "geometry": { "coordinates": [ 2.3522, 48.8566 ], "type": "Point" }, "properties": { "display_name": "221B Baker Street, London, NW1 6XE, United Kingdom", "category": "restaurant", "city": "London", "confidence": 0, "country": "United Kingdom", "country_code": "GB", "distance_m": 0, "full_address": "221B Baker Street, London, NW1 6XE, United Kingdom", "house_number": "221B", "interpolated": true, "name": "Eiffel Tower", "osm_id": 21154906, "osm_type": "node", "postcode": "NW1 6XE", "score": 0, "source": "structured", "state": "England", "street": "Baker Street", "subcategory": "italian", "tags": { "foo": "string" }, "wikipedia": "en:Eiffel Tower" }, "type": "Feature" } ], "type": "FeatureCollection" } ] } ``` ## Domain Types ### Autocomplete Result - `class AutocompleteResult:` GeoJSON FeatureCollection of autocomplete suggestions for partial address input. Optimized for low-latency type-ahead UIs. Content-Type: `application/geo+json`. - `features: List` Autocomplete suggestions ordered by relevance - `geometry: GeoJsonGeometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `coordinates: Coordinates` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `List` - `List>` - `List>>` - `List>>>` - `type: Type` Geometry type - `POINT("Point")` - `LINE_STRING("LineString")` - `POLYGON("Polygon")` - `MULTI_POINT("MultiPoint")` - `MULTI_LINE_STRING("MultiLineString")` - `MULTI_POLYGON("MultiPolygon")` - `properties: Properties` Geocoding result properties - `displayName: String` Formatted address or place name - `category: Optional` POI category (e.g. restaurant, cafe, park). Present for place results. - `city: Optional` City or town name. Present for address results. - `confidence: Optional` Interpolation confidence (0-1). Present only for interpolated results. - `country: Optional` Country name. Present for reverse geocode address results. - `countryCode: Optional` ISO 3166-1 alpha-2 country code - `distanceM: Optional` Distance from the query point in meters (reverse geocode / nearby only) - `fullAddress: Optional` Complete formatted address from the database. Present for reverse geocode address results. - `houseNumber: Optional` House or building number. Present for address and interpolated results. - `interpolated: Optional` Whether this result was estimated by address interpolation rather than an exact database match. - `name: Optional` Place name (raw). Present for reverse geocode place results. - `osmId: Optional` OpenStreetMap element ID (null for interpolated results) - `osmType: Optional` OSM element type (node, way, relation) - `NODE("node")` - `WAY("way")` - `RELATION("relation")` - `postcode: Optional` Postal code. Present for reverse geocode address results. - `score: Optional` Relevance score (higher is better). Incorporates text match quality, spatial proximity boost, and popularity signals. Not bounded to 0-1. - `source: Optional` Result source indicating how the result was found: structured (exact field match), bm25 (full-text search), fuzzy (trigram similarity), address (reverse geocode address), place (reverse geocode POI), interpolation (estimated from neighboring addresses) - `STRUCTURED("structured")` - `BM25("bm25")` - `FUZZY("fuzzy")` - `ADDRESS("address")` - `PLACE("place")` - `INTERPOLATION("interpolation")` - `state: Optional` State or province name. Present for reverse geocode address results. - `street: Optional` Street name. Present for address and interpolated results. - `subcategory: Optional` POI subcategory. Present for place results. - `tags: Optional` Raw OSM tags. Present for place results. - `wikipedia: Optional` Wikipedia article reference (e.g. en:Eiffel Tower). Present for notable places. - `type: Type` - `FEATURE("Feature")` - `type: Type` - `FEATURE_COLLECTION("FeatureCollection")` ### Geocode Result - `class GeocodeResult:` GeoJSON FeatureCollection of forward geocoding results, ordered by relevance. Content-Type: `application/geo+json`. - `features: List` Geocoding results ordered by relevance score - `geometry: GeoJsonGeometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `coordinates: Coordinates` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `List` - `List>` - `List>>` - `List>>>` - `type: Type` Geometry type - `POINT("Point")` - `LINE_STRING("LineString")` - `POLYGON("Polygon")` - `MULTI_POINT("MultiPoint")` - `MULTI_LINE_STRING("MultiLineString")` - `MULTI_POLYGON("MultiPolygon")` - `properties: Properties` Geocoding result properties - `displayName: String` Formatted address or place name - `category: Optional` POI category (e.g. restaurant, cafe, park). Present for place results. - `city: Optional` City or town name. Present for address results. - `confidence: Optional` Interpolation confidence (0-1). Present only for interpolated results. - `country: Optional` Country name. Present for reverse geocode address results. - `countryCode: Optional` ISO 3166-1 alpha-2 country code - `distanceM: Optional` Distance from the query point in meters (reverse geocode / nearby only) - `fullAddress: Optional` Complete formatted address from the database. Present for reverse geocode address results. - `houseNumber: Optional` House or building number. Present for address and interpolated results. - `interpolated: Optional` Whether this result was estimated by address interpolation rather than an exact database match. - `name: Optional` Place name (raw). Present for reverse geocode place results. - `osmId: Optional` OpenStreetMap element ID (null for interpolated results) - `osmType: Optional` OSM element type (node, way, relation) - `NODE("node")` - `WAY("way")` - `RELATION("relation")` - `postcode: Optional` Postal code. Present for reverse geocode address results. - `score: Optional` Relevance score (higher is better). Incorporates text match quality, spatial proximity boost, and popularity signals. Not bounded to 0-1. - `source: Optional` Result source indicating how the result was found: structured (exact field match), bm25 (full-text search), fuzzy (trigram similarity), address (reverse geocode address), place (reverse geocode POI), interpolation (estimated from neighboring addresses) - `STRUCTURED("structured")` - `BM25("bm25")` - `FUZZY("fuzzy")` - `ADDRESS("address")` - `PLACE("place")` - `INTERPOLATION("interpolation")` - `state: Optional` State or province name. Present for reverse geocode address results. - `street: Optional` Street name. Present for address and interpolated results. - `subcategory: Optional` POI subcategory. Present for place results. - `tags: Optional` Raw OSM tags. Present for place results. - `wikipedia: Optional` Wikipedia article reference (e.g. en:Eiffel Tower). Present for notable places. - `type: Type` - `FEATURE("Feature")` - `type: Type` - `FEATURE_COLLECTION("FeatureCollection")` ### Geocoding Feature - `class GeocodingFeature:` GeoJSON Feature representing a geocoding result. The geometry is always a Point. Properties include the formatted display name, OSM metadata, confidence score, and source type. - `geometry: GeoJsonGeometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `coordinates: Coordinates` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `List` - `List>` - `List>>` - `List>>>` - `type: Type` Geometry type - `POINT("Point")` - `LINE_STRING("LineString")` - `POLYGON("Polygon")` - `MULTI_POINT("MultiPoint")` - `MULTI_LINE_STRING("MultiLineString")` - `MULTI_POLYGON("MultiPolygon")` - `properties: Properties` Geocoding result properties - `displayName: String` Formatted address or place name - `category: Optional` POI category (e.g. restaurant, cafe, park). Present for place results. - `city: Optional` City or town name. Present for address results. - `confidence: Optional` Interpolation confidence (0-1). Present only for interpolated results. - `country: Optional` Country name. Present for reverse geocode address results. - `countryCode: Optional` ISO 3166-1 alpha-2 country code - `distanceM: Optional` Distance from the query point in meters (reverse geocode / nearby only) - `fullAddress: Optional` Complete formatted address from the database. Present for reverse geocode address results. - `houseNumber: Optional` House or building number. Present for address and interpolated results. - `interpolated: Optional` Whether this result was estimated by address interpolation rather than an exact database match. - `name: Optional` Place name (raw). Present for reverse geocode place results. - `osmId: Optional` OpenStreetMap element ID (null for interpolated results) - `osmType: Optional` OSM element type (node, way, relation) - `NODE("node")` - `WAY("way")` - `RELATION("relation")` - `postcode: Optional` Postal code. Present for reverse geocode address results. - `score: Optional` Relevance score (higher is better). Incorporates text match quality, spatial proximity boost, and popularity signals. Not bounded to 0-1. - `source: Optional` Result source indicating how the result was found: structured (exact field match), bm25 (full-text search), fuzzy (trigram similarity), address (reverse geocode address), place (reverse geocode POI), interpolation (estimated from neighboring addresses) - `STRUCTURED("structured")` - `BM25("bm25")` - `FUZZY("fuzzy")` - `ADDRESS("address")` - `PLACE("place")` - `INTERPOLATION("interpolation")` - `state: Optional` State or province name. Present for reverse geocode address results. - `street: Optional` Street name. Present for address and interpolated results. - `subcategory: Optional` POI subcategory. Present for place results. - `tags: Optional` Raw OSM tags. Present for place results. - `wikipedia: Optional` Wikipedia article reference (e.g. en:Eiffel Tower). Present for notable places. - `type: Type` - `FEATURE("Feature")` ### Reverse Geocode Result - `class ReverseGeocodeResult:` GeoJSON FeatureCollection of reverse geocoding results, ordered by distance from the query point. Content-Type: `application/geo+json`. - `features: List` Reverse geocoding results ordered by distance - `geometry: GeoJsonGeometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `coordinates: Coordinates` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `List` - `List>` - `List>>` - `List>>>` - `type: Type` Geometry type - `POINT("Point")` - `LINE_STRING("LineString")` - `POLYGON("Polygon")` - `MULTI_POINT("MultiPoint")` - `MULTI_LINE_STRING("MultiLineString")` - `MULTI_POLYGON("MultiPolygon")` - `properties: Properties` Geocoding result properties - `displayName: String` Formatted address or place name - `category: Optional` POI category (e.g. restaurant, cafe, park). Present for place results. - `city: Optional` City or town name. Present for address results. - `confidence: Optional` Interpolation confidence (0-1). Present only for interpolated results. - `country: Optional` Country name. Present for reverse geocode address results. - `countryCode: Optional` ISO 3166-1 alpha-2 country code - `distanceM: Optional` Distance from the query point in meters (reverse geocode / nearby only) - `fullAddress: Optional` Complete formatted address from the database. Present for reverse geocode address results. - `houseNumber: Optional` House or building number. Present for address and interpolated results. - `interpolated: Optional` Whether this result was estimated by address interpolation rather than an exact database match. - `name: Optional` Place name (raw). Present for reverse geocode place results. - `osmId: Optional` OpenStreetMap element ID (null for interpolated results) - `osmType: Optional` OSM element type (node, way, relation) - `NODE("node")` - `WAY("way")` - `RELATION("relation")` - `postcode: Optional` Postal code. Present for reverse geocode address results. - `score: Optional` Relevance score (higher is better). Incorporates text match quality, spatial proximity boost, and popularity signals. Not bounded to 0-1. - `source: Optional` Result source indicating how the result was found: structured (exact field match), bm25 (full-text search), fuzzy (trigram similarity), address (reverse geocode address), place (reverse geocode POI), interpolation (estimated from neighboring addresses) - `STRUCTURED("structured")` - `BM25("bm25")` - `FUZZY("fuzzy")` - `ADDRESS("address")` - `PLACE("place")` - `INTERPOLATION("interpolation")` - `state: Optional` State or province name. Present for reverse geocode address results. - `street: Optional` Street name. Present for address and interpolated results. - `subcategory: Optional` POI subcategory. Present for place results. - `tags: Optional` Raw OSM tags. Present for place results. - `wikipedia: Optional` Wikipedia article reference (e.g. en:Eiffel Tower). Present for notable places. - `type: Type` - `FEATURE("Feature")` - `type: Type` - `FEATURE_COLLECTION("FeatureCollection")`