Forward geocode an address
client.geocode.forwardPost(GeocodeForwardPostParams { q, bbox, country_code, 6 more } params, RequestOptionsoptions?): GeocodeResult { features, type }
POST/api/v1/geocode
Forward geocode an address
import Plaza from '@plazafyi/sdk';
const client = new Plaza({
apiKey: process.env['PLAZA_API_KEY'], // This is the default and can be omitted
});
const geocodeResult = await client.geocode.forwardPost({ q: 'q' });
console.log(geocodeResult.features);{
"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"
}Returns Examples
{
"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"
}