Google places APIs nearby for inconsistent results

I found that a close search returns inconsistent results.

I once ran this request (go client lib). He returned me 4 results. Considering,

Keyword = Resorts + World + Sentosa + Equarius + 8 + Sentosa + Gateway & location = 1.2564% 2C103.8189 & rankby = distance & type = rooms

https://gist.github.com/haibin/20e01d38c10d4da9275439c549a2db91

I ran this request one more day (go client lib). He returned me 5 results. Considering,

keyword = Resorts + World + Sentosa + Equarius + 8 + Sentosa + Gateway & language = ep & location = 1.2564% 2C103.8189 & rankby = distance & type = accommodation

https://gist.github.com/haibin/b40e4952b7fddace78d6c37a19542a40

I fulfilled this request today (curl). He returned me 1 result. Considering,

keywords = Resorts% 20World% 20Sentosa% 20Equarius% 208% 20Sentosa% 20 Gateway & language = ep & location = 1.2564% 2C103.8189 & rankby = distance & type = rooms

https://gist.github.com/haibin/a65a6d03ace05898913e306840307bdb

Any idea why?

+5
source share
1 answer

Perhaps an error occurred in the google google API when using the rankby=distance parameter, which skips any result or search in a "limited radius"

As with running curl with these options

 https://maps.googleapis.com/maps/api/place/nearbysearch/json?key=MY_KEY&keyword=Resorts+World+Sentosa+Equarius+8+Sentosa+Gateway&location=1.2564%2C103.8189&rankby=distance&type=lodging 

he returned only one result, as u said.

But when I worked with the radius parameter, it returns more results as accepted

 https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=1.2564,103.8189&type=lodging&keyword=Resorts+World+Sentosa+Equarius+8+Sentosa+Gateway&key=MY_KEY&radius=300 

You get more results via go lib because maybe they fixed it in this or something like that

For more information, you can solve the following problems:

The Google Places API is next to the search rank, passing a few nearby places

http://www.itgo.me/a/3468386017980994007/google-places-api-nearby-search-rankby-distance-skipping-some-nearest-places

Hope this helps you.

+2
source

Source: https://habr.com/ru/post/1262799/


All Articles