Will Lopez
Will Lopez

Reputation: 2119

How to get google places api to return nearby hotels

I'm trying to put together a google places call to do a nearby search just for hotels. I tried using the types parm but the closest type to hotel I found was lodging which produced no results. So then I tried using the name parm and the same zero result. Am I missing something or is places not meant to perform a search of this type. I increased the radius to a number I'm certain that there are other hotels (2 should have been fine).

//maps.googleapis.com/maps/api/place/nearbysearch/json?location=32.800870,-96.830803&radius=25&name=Marriot%20Sheraton%20W&key=

Result from call:

{
  html_attributions: [ ],
  results: [ ],
  status: "ZERO_RESULTS"
}

Thanks!

Upvotes: 0

Views: 9832

Answers (1)

pushbit
pushbit

Reputation: 1268

The radius of 25m appears to be too small and the name is not a subset of any place names in the area. Were you trying to get any places with a name of Marriot, Sheraton, or W? I don't believe the implementation works that way and instead it looks for a place with "Marriot Sheraton W" in the name.

If you change radius to 400 and name to Sheraton, then you do get the nearby "Sheraton Suites Market Center Dallas".

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=32.800870,-96.830803&radius=400&name=Sheraton&key=[key]

Upvotes: 4

Related Questions