Google has marked the reference
and id
fields as deprecated as of June 24th 2014, and replaced it with a single place_id
.
I've so far only seen place_id
lengths of exactly 27 characters, but wonder if there is any documentation for this length? I have been unable to find this documented anywhere.
Obviously knowing the length of the place_id
is significant for choosing an optimal database field, and therefore something I'd like to know.
From the Google Places API docs site:
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.
The documentation says that the Places API returns up to 20 results. It does not indicate that there is any way to change that limit. So, the short answer seems to be: You can't. Of course, you might be able to sort of fake it by doing queries for several locations, and then merging/de-duplicating the results.
The autocomplete request is available at no charge, and the subsequent Place Details call gets charged based on regular Place Details pricing. A Place Details request generates Data SKUs (Basic, Contact, and/or Atmosphere) – depending on the fields that are specified in the request.
There's no documentation on the specific length, but the max I have seen is length 255. This corresponds to address 488 Srinagarindra Rd., Suan Luang, Bangkok, 10250. You can check the place id here.
FYI the place id is:
ErwBNDg4IOC4luC4meC4mSDguKjguKPguLXguJnguITguKPguLTguJnguJfguKPguYwg4LmB4LiC4Lin4LiHIOC4quC4p-C4meC4q-C4peC4p-C4hyDguYDguILguJUg4Liq4Lin4LiZ4Lir4Lil4Lin4LiHIOC4geC4o-C4uOC4h-C5gOC4l-C4nuC4oeC4q-C4suC4meC4hOC4oyAxMDI1MCDguJvguKPguLDguYDguJfguKjguYTguJfguKI
The longest I've seen so far is 315 characters. I'll update this if I find any longer.
FormattedAddress: KAV.76-78, Indofood Tower, Sudirman Plaza, Jl. Jend. Sudirman No.76-78, RT.3/RW.3, Kuningan, Setia Budi, Kecamatan Setiabudi, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 10250, Indonesia
PlaceId: EsIBS0FWLjc2LTc4LCBJbmRvZm9vZCBUb3dlciwgU3VkaXJtYW4gUGxhemEsIEpsLiBKZW5kLiBTdWRpcm1hbiBOby43Ni03OCwgUlQuMy9SVy4zLCBLdW5pbmdhbiwgU2V0aWEgQnVkaSwgS2VjYW1hdGFuIFNldGlhYnVkaSwgS290YSBKYWthcnRhIFNlbGF0YW4sIERhZXJhaCBLaHVzdXMgSWJ1a290YSBKYWthcnRhIDEwMjUwLCBJbmRvbmVzaWEiJRojChYKFAoSCSH20UED9GkuEc707mF-vRHxEglLQVYuNzYtNzg
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With