Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Places API web service: how to set multiple types for Autocomplete

I am using Place Autocomplete in Google Places API web service, following API calls work fine:

https://maps.googleapis.com/maps/api/place/autocomplete/json?input=palo&types=(regions)&components=country:us&key=API_KEY

But I need to have autocomplete for both (regions) and address, I use this: https://maps.googleapis.com/maps/api/place/autocomplete/json?input=palo&types=(regions)|address&components=country:us&key=API_KEY

It returns:

{
"predictions" : [],
"status" : "INVALID_REQUEST"
}

What is the correct way to set multiple types?

like image 416
Andy Wan Avatar asked May 19 '15 06:05

Andy Wan


1 Answers

https://developers.google.com/places/supported_types

If nothing is specified, all types are returned. In general only a single type is allowed.

like image 191
Potney Switters Avatar answered Sep 27 '22 18:09

Potney Switters