Google Places API autocomplete specific city

autocompletegoogle-maps-android-api-2google-places-api

I have some questions about google places api for android.

This is the request that is being called:

https://maps.googleapis.com/maps/api/place/autocomplete/json?sensor=false&key=API_KEY&components=country:hr&language=hr&input=lad

The issue is that I want only addresses within specific city. Is that possible?

Here is the quote from
Google Places API autocomplete
that suggests that it should work.

Blockquote the (regions) type collection instructs the Place service to return any result matching the following types:

  • locality
  • sublocality
  • postal_code
  • country
  • administrative_area1
  • administrative_area2

Blockquote the (cities) type collection instructs the Place service to return results that match either locality or administrative_area3.

So I would like to specify citry or a postal code in order to filter only addreses from that city.

–EDIT–

This approach doesn't work either.

maps.googleapis.com/maps/api/place/autocomplete/json?sensor=false&key=API_KEY&types=geocode&location=45.811093,15.974121&radius=12000&components=country:hr&language=hr&input=lad

Best Answer

Solution

I've added CIty name in input string

city_name+street like Zagreb+fal in order to get all the streets from Zagreb with fal* in their name.

It seems to be working oke.

Related Topic