Log in from the Google Places API using ID

I can get location information from the Google API if I know the link using:

https://maps.googleapis.com/maps/api/place/details/json?reference=CmRYAAAAciqGsTRX1mXRvuXSH2ErwW-jCINE1aLiwP64MCWDN5vkXvXoQGPKldMfmdGyqWSpm7BEYCgDm-iv7Kc2PF7QA7brMAwBbAcqMr5i1f4PwTpaovIZjysCEZTry8Ez30wpEhCNCXpynextCld2EBsDkRKsGhSLayuRyFsex6JA6NPh9dyupoTH3g&sensor=true&key=API_KEY_HERE

However, I want to get the same information using the identifier. The same place in the request above would be something like this:

https://maps.googleapis.com/maps/api/place/details/json?id=4f89212bf76dde31f092cfc14d7506555d85b5c7&sensor=true&key=API_KEY_HERE

Is it possible?

This will be part of the search filter that I create, of which the location is a part. My search parameters are passed to the URL, so I plan to do the same with the selected location from auto-complete places. Using id is much shorter than a link, so it’s more suitable for a request. If there is a better way to do this?

+7
source share
5 answers
+10
source

It is not possible to get the details of a place with an identifier, you need to use the link. as specifically indicated at the bottom of this link - http://goo.gl/KFDbl

+7
source

You can search for Place data using the PlaceID method.

https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJF7QkuDsDLz4R0rJ4SsxFl9w&key=YOUR_KEY 
+6
source

Obviously, both id and reference are deprecated.

In Google Places AutoFill Docs (August 2014):

"Note. The identifier and reference fields expire on June 24, 2014. They are replaced by a new place identifier, a unique identifier that can be used to compare places and obtain place information. The Places API currently returns place_id in all responses and takes place in requests for places and places to delete. Soon after June 24, 2015, the API will stop returning identification and reference fields in responses. After some time, the API will no longer accept the link in requests. We recommend that you update Use your code to use the new place id as soon as possible, not the id and link. "

https://developers.google.com/places/documentation/autocomplete

+3
source

Maybe not .

ID can only be used for comparison if 2 or more places are the same.

The link can only be used to find a place.

In one place there will be only one identifier and may have several links. I assume that this was done in order to distribute the load on the same record that got into the database.

A source

0
source

All Articles