We have an application where users can report incidents and want to allow searches by keyword. The Google Places API (I've tried nearby search, text search, and autocomplete) only returns businesses, but sometimes the user may be on a residential street. How do I get Places to return residential addresses?
I know the data is in there, because if you search on Google Maps, or use the geocode API, you can get an exact address.
Example (picking a random point in London): https://maps.googleapis.com/maps/api/place/nearbysearch/json?&key=[YOUR_KEY]&radius=50000&location=51.611499,-0.026750&keyword=sinclair
returns
Sinclair Pharma, 1st Floor Whitfield Court, 30-32 Whitfield Street, London
Sinclair Pharmaceuticals Ltd, Godalming Business Centre, Woolsack Way, Godalming
Sinclair Hammelton Bromley, 23 High Street, Bromley
Sinclair & Rush Ltd, 20 / 20 Business Estate, Spectrum West, Saint Laurence Avenue, Maidstone
Sinclair Hammelton Petts Wood, 9 Fairway, Orpington
Sinclair Till Flooring Co Ltd, 793 Wandsworth Road, London
etc
but
https://maps.googleapis.com/maps/api/geocode/json?&key=[YOUR_KEY]&latlng=51.611499,-0.026750
returns
148 Sinclair Rd, London E4 8PR, UK
Does using autocomplete with type=geocode or type=address do what you want (link to docs)?
https://maps.googleapis.com/maps/api/place/autocomplete/json?&key=[YOUR=KEY]&type=geocode&radius=50000&location=51.611499,-0.026750&input=5%20sinclair
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