0
votes

Google offers two methods of retrieving results for reverse geocoding - a web service API:

https://maps.googleapis.com/maps/api/geocode/json?address=place_id:xxxxxxxxxxx&key=YOUR_API_KEY

or a Javascript map API:

https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap

I am finding place_id values that return results with the latter (js) but not the former (web service) - the return value is ZERO_RESULTS (The request did not encounter any errors but, but returned no results). Are there restrictions in place with the web service?

An example place_id value that works with #2 (js) and not #1 (web service): ChIJY01wxrsV64YR40ZRS9kaz_U

Web service (#1): https://google-developers.appspot.com/maps/documentation/utils/geocoder/embed

Javascript service (#2): https://google-developers.appspot.com/maps/documentation/javascript/examples/full/geocoding-place-id

1

1 Answers

1
votes

There shouldn't be any restrictions on place_ids for the Geocoding API, from what I know of. I tested out your inquiry

https://maps.googleapis.com/maps/api/geocode/json?place_id=ChIJY01wxrsV64YR40ZRS9kaz_U&key=[YOUR_API_KEY]

and I was able to get the appropriate information (not the ZERO RESULTS you encountered).

The Web service (#1) you cited is for Geocoding, not Reverse Geocoding. If you plot the "227 Bedford" to it, you can check thru inspect console that it has the same place_id.