Get a location's Place ID

The /geoservices/autocomplete endpoint provides the top five matching place descriptions and IDs from Google’s database for an input string. You can use this endpoint to match on full words and substrings. The Place ID is required for using the /geoservices/place endpoint.

Request a location’s Place ID

  • Endpoint: /geoservices/autocomplete
  • Operation: POST

Request parameters

Parameter Mandatory/optional Description
input Mandatory A string containing some or all of a location’s address.
sessionId Mandatory A user-generated UUID. The ID can be used for a single session, which consists of multiple autocomplete requests and ends with a request for a place’s details via the /geoservices/place endpoint.
location Optional The geographic co-ordinates of the place you are looking up, in the form of latitude and longitude values.
country Optional Two characters that uniquely identify a country according to the ISO 3166-1 Alpha-2 standard.

For more information, please see the API documentation.

Example

This example shows how to use the /geoservices/autocomplete endpoint to get the Place ID from part of a location’s address.

Request

  • Endpoint: /geoservices/autocomplete
  • Operation: POST
{
	"input": "47 Warner",
	"sessionId": "2077dcb0-1238-4d4d-b75a-511af289fa16"
}

Response

This request returns the top five matching places:

{
	"result": {
		"predictions": [
			{
				"description": "47 Warner Street, Fortitude Valley QLD, Australia",
				"placeId": "ChIJ56eaUPJZkWsRiGOVbF9RoVA"
			},
			{
				"description": "47 Warner Road, Oropi, New Zealand",
				"placeId": "ChIJcU3eovrQbW0RsUTOtkyN2JQ"
			},
			{
				"description": "47 Warner Street, Moncton, NB, Canada",
				"placeId": "ChIJYSCOo6G-oEwRkaMuO2m2M9c"
			},
			{
				"description": "47 Warner's Lane, Ranelagh, Dublin 6, Ireland",
				"placeId": "ChIJiXBeEqMOZ0gRfVJ2ib3keFA"
			},
			{
				"description": "47 Warners Avenue, Bondi Beach NSW, Australia",
				"placeId": "ChIJf3TwNZ-tEmsRGxJEG-08Pv8"
			}
		],
		"status": "OK",
		"errorMessage": null
	}
}