I have an application that uses the places API to help find places near destinations (like London). I prefer using nearby because it allows me to focus on one area, and it's also cheaper compared to text searches.
Unfortunately, I get answers that don't make a lot of sense. As an example, if I search for:
name=London Eye
I get zero results (with or without quotes around it).
But if I search by keyword:
keyword=ferris wheel
London Eye is returned. Here are the relevant queries:
- https://maps.googleapis.com/maps/api/place/nearbysearch/json?key=[API_KEY]&sensor=false&location=51.52864165,-0.10179430&radius=47022&name=%22london%20eye%22
- https://maps.googleapis.com/maps/api/place/nearbysearch/json?key=[API_KEY]&sensor=false&location=51.52864165,-0.10179430&radius=47022&keyword=ferris%20wheel
Is there some rhyme or reason to this?
Best Answer
Well, issue is that you are using the wrong parameter.
Check the documentation and you'll see that parameter you should be using is
keyword
instead ofname
It will be then:
And that's working for me!
EDIT:
As I said, if you try:
You get as return a lot of results better than using those parameters alone.
UPDATE
As of 2018 the
name
parameter was deprecated in favor of thekeyword
parameter, so from now on it is recommended to use onlykeyword
parameter in your requests.The documentation currently reads
source: https://developers.google.com/places/web-service/search#PlaceSearchRequests