Get a location's geographic co-ordinates

The /geoservices/geocode endpoint provides the geographic co-ordinates (longitude and latitude) for one or more addresses provided in a request.

These co-ordinates can be used to pinpoint a place or position on a map. You can pass the location or the address in different formats, including Place IDs and Plus Codes. As this API is concerned with geographic latitudes and longitudes, additional address elements (such as business names, unit, suite or floor numbers, etc.) should be avoided in the request.

Request a place’s geographic co-ordinates

  • Endpoint: /geoservices/geocode
  • Operation: POST

Request parameters

Parameter Mandatory/optional Description
addresses Mandatory The names of the locations for which you want to obtain latitude and longitude co-ordinates. You can specify addresses from different countries as per the format used by the national postal service of the country.
language Optional The language in which to return the addresses. This must be in the form of a language code, which can be obtained from this list.

For more information, please see the API documentation.

Example

This example shows how to obtain the geographic co-ordinates of two locations using the geoservices/geocode endpoint:

Request

  • Endpoint: /geoservices/geocode
  • Operation: POST
{
	"addresses": [
		"47 Warner Street, Fortitude Valley QLD, Australia", 
		"47 Warner Road, Oropi, New Zealand"
	]
}

Response

{
	"result": [
		{
			"GeocodeSuccess": {
				"address": "47 Warner St, Fortitude Valley QLD 4006, Australia",
				"latlng": {
					"lat": -27.4569042,
					"lng": 153.0349271
				}
			}
		},
		{
			"GeocodeSuccess": {
				"address": "47 Warner Road, Oropi 3173, New Zealand",
				"latlng": {
					"lat": -37.777978,
					"lng": 176.1429521
				}
			}
		}
	]
}