rahul
rahul

Reputation: 2661

How to get result for cities via google places api?

I am developing an application in which I am trying to get only cities names via google places api but the api is returning all the related results to related keyword.Below is the url I am using https://maps.googleapis.com/maps/api/place/autocomplete/json?input=jai&types=geocode&sensor=false&types=regions&key=AIzaSyAJP9EH1TnS5pYo-xEpQPEvBpbLXed8ets

Upvotes: 0

Views: 1009

Answers (1)

kasoban
kasoban

Reputation: 2167

I am not entirely sure if this is what you want to do, but remove the two types= parameters from your GET request and put types=(cities) instead.

See this: https://maps.googleapis.com/maps/api/place/autocomplete/json?input=jai&types=(cities)&sensor=false&key=AIzaSyAJP9EH1TnS5pYo-xEpQPEvBpbLXed8ets

Upvotes: 2

Related Questions