Google Places API: Searching for names containing spaces

google-places-api

Is it possible to search for names containing spaces?

name: ['Burger King|Subway']  //fails
name: ['McDonald|Subway|Chipotle'] // works

https://maps.googleapis.com/maps/api/place/search/json?location=33.4,-112.0&radius=5000&name=McDonald|Subway|Chipotle&sensor=false&key=yourkeyhere

Thanks!

Best Answer

As SKAR said, add %22 when you have spaces. Your search term, instead of Burger King, becomes "Burger King".

URL, as suggested by SKAR:

https://maps.googleapis.com/maps/api/place/nearbysearch/xml?location=-41.21545,174.89416&radius=10000&name=%22strike%20entertainment%20centre%22&sensor=true&key=[YourKey]

Do not replace your %20 (Spaces) by %22, but add them before and after your search term.

Cheers

Related Topic