Launched: Place IDs in the Google Geocoding API

The Google Geocoding API now returns Place IDs in the response and can also be queried with Place IDs. Place IDs identify a unique place in the Google Places database and on Google Maps and can be used to ensure that multiple APIs are referencing the same place. Now developers can use Place IDs across the Google Maps Roads API, Geocoding API, the Places library in the Google Maps Javascript API, and the Google Places API.

Traditionally, developers reference locations on a map as latitudinal and longitudinal coordinates. However, different APIs can translate the same latlng to different addresses, and the translation from latlngs to addresses can also change over time. Place IDs provide a way to consistently reference the same location across multiple APIs. By using Place IDs in your app, the locations you reference become more consistent and apps become more reliable and user-friendly.

For example, when using latlngs to reference locations, the Google Maps Roads API only ever returns drivable roads, whereas the Google Geocoding API prefers to return the addresses of buildings. If your app used the Roads API to snap to a road, and then queried Geocoding API with a latlng to get the road name, the Geocoding API may have returned a neighboring road depending on the nearest building. With this launch, you can now query Geocoding API with the Place ID of the road returned by Roads API, ensuring that you’re getting the name of the correct road.

We’ve started adding support for Place IDs across the Google Maps APIs in order to standardize the way locations are handled between APIs. To learn more about using Place IDs, take a look at our documentation to learn how to retrieve a place using the place ID, handle multiple place IDs, and more.

Posted by Elena Kelareva, Product Manager, Google Maps APIs