Example

You can request Geocodes from the Placekey API the same way you request optional responses like address_placekey, building_placekey, and confidence score. Simply add “geocode” to the fields

Request

curl --location 'https://api.placekey.io/v1/placekey' \
--header 'apikey: {{apikey}}' \
--header 'Content-Type: application/json' \
--data '{
  "query": {
    "street_address": "1201 Grand Street",
    "city": "Hoboken",
    "region": "NJ",
    "postal_code": "07030",
    "iso_country_code": "US"
  },
  "options": {
    "fields": ["geocode"]
  }
}

Response

Note in the response, besides the lat and long, the location_type

{
  "query_id" : "0",
  "placekey" : "222@627-wbk-cwk",
  "geocode" : {
    "location" : {
      "lat" : 40.7525146656441,
      "lng" : -74.032666814035
    },
    "location_type" : "ROOFTOP"
  }
}

Last updated