Google Place AutoComplete API Returns Invalid Place ID

Starting today (or yesterday), the Google Place Autocomplete web service ( https://developers.google.com/places/web-service/autocomplete ) returns an invalid place identifier (place_id). Does anyone know how to get the correct place id from the autocomplete API?

For example, the place identifier for New York ChIJOwg_06VPwokRYv534QaPC8g(according to the place details API), but the autocomplete API returns ChIJOwg_06VPwokRYv534QaPC8iaBilOZXcgWW9yayBDaXR5LCBOZXcgWW9yaywgVmVyZW5pZ2RlIFN0YXRlbgas place_id. The beginning of the line is almost the same, except for the last character of the "correct" place id (g).

Is this a mistake or is Google changing its place identifiers? Unfortunately, I can not find anything related to this problem.

+4
source share
1 answer

Some place identifiers from the Place Autofill API have been changed due to a recent issue: https://code.google.com/p/gmaps-api-issues/issues/detail?id=11107 . Longer identifiers must be accepted by all Maps APIs (but see Disclaimer at https://code.google.com/p/gmaps-api-issues/issues/detail?id=11107#c30 ).

Unfortunately, this will be for some time. The way to get a “short” place identifier corresponding to a long one is to issue a “Place Details” request with a long place identifier (the returned result will contain the short place identifier).

0
source

Source: https://habr.com/ru/post/1664663/


All Articles