5

I'm making use of google's Place Autocomplete API to get list of cities, https://developers.google.com/places/web-service/autocomplete.

Problem is when I search "Bombay", it should return the new city name "Mumbai". Same for "Calcutta" instead "Kolkata" and "Madras" to "Chennai".

Google Place Search api returns all the right renamed city names but unfortunately it's not for autocomplete use.

Teo Choong Ping
  • 12,512
  • 18
  • 64
  • 91

2 Answers2

2

In Text search API you will get new names : https://maps.googleapis.com/maps/api/place/autocomplete/json?key=YOUR_KEY&types=city&query=Bombay

So If you can use above API you can use.

In autocomplete add types=(cities) but it returning old names only, I think google data is not updated.

https://maps.googleapis.com/maps/api/place/autocomplete/json?key=YOUR_KEY&types=(cities)&input=Bombay

Naveen Kumar M
  • 7,497
  • 7
  • 60
  • 74
  • Thank you. We have explored text search API but we need it on the autocomplete. A workaround is to have all result returned to go through the text search but it's grossly inefficient. – Teo Choong Ping Jul 20 '16 at 03:12
0

I think the fool proof solution for this is to use Google place autocomplete and get a list of predictions. Then use the first prediction's place_id as an input for Google Place details

Step 1 enter image description here Step 2 enter image description here

Yuvi
  • 419
  • 7
  • 12