The "id"
field in Places API result has already been deprecated 4 years ago. In replacement, you'll need to use the "place_id"
field moving forward which is the textual identifier that uniquely identifies a place. More info in this doc
This has also been answered in Google's Public Issue Tracker here: https://issuetracker.google.com/issues/134893143
Although the place_id is the unique identifier of a place and is recommended to use, it may change due to certain updates as per this doc. One strategy is to store the original request that returned each place ID. If a place ID becomes invalid, you can re-issue that request to get fresh results.
As of now, the place_id field would be the most recommended unique reference to a specific place.
Hope this helps!
Edit: Below is the deprecation notice that could once be found in the documentation.
Note: The id
and reference
fields are deprecated as of June 24, 2014. They are replaced by the new place ID, a unique identifier that can be used to compare places and to retrieve information about a place. The Places API currently returns a place_id
in all responses, and accepts a placeid
in the Place Details and Place Delete requests. Soon after June 24, 2015, the API will stop returning the id and reference fields in responses. Some time later, the API will no longer accept the reference in requests. We recommend that you update your code to use the new place ID instead of id and reference as soon as possible.
They do still return the ID field for some reason, but you should definitely use the place id instead.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…