Andy Wan
Andy Wan

Reputation: 71

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?

Upvotes: 7

Views: 5000

Answers (1)

Potney Switters
Potney Switters

Reputation: 3062

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

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

Upvotes: 2

Related Questions