Getting Unit/Suite Numbers In Google Places Autocomplete

Services

26/01/2023


It is possible to get the unit/suite/door numbers etc. for any address in any country. This information is shared through the subpremise type returned by the Places API. Knowing this, it begs the question how does one get it when entering an address? 🤷‍♀️

Unfortunately, it depends very much on each country and I couldn't find any specifics on this (maybe you know better 👀). For instance, in Austria, it's common to write an address in the following format.

TEXT
Street address [house number]/[unit number]/[floor number]/[door number]

This will yield no result with Google Places and instead it will return Street address [house number]. However, there exists another more verbose format in Austria.

TEXT
Street address [house number], Stiege [unit number], Stockwerk [floor number], Top [door number]

If you were to provide it like this to Google Places (as I found out by coincidence 🤦‍♀️), you will receive the information correctly in subpremise.


WRITTEN BY

Code and stuff