googlemaps / openapi-specification

OpenAPI specification for Google Maps Platform API
Apache License 2.0
102 stars 86 forks source link

Places API radius doesn't work in text search #184

Closed maestrolsj closed 3 years ago

maestrolsj commented 3 years ago

Environment details

image

Steps to reproduce

  1. radius get ignored in the request below
  2. It shows New York place data

Code example

const URI = encodeURI
(
https://maps.googleapis.com/maps/api/place/textsearch/json?query=%22best%20Internist%22&key=secret&fileds=place_id,formatted_address,name,rating,opening_hours/open_now,geometry,business_status,price_level,pagetoken,photos&language=en-us&location=52.516282,13.3131672&radius=5000
);

const { data } = await axios(URI, {
method: 'GET',
});
jpoehnelt commented 3 years ago

It works without the quotes. Radius is only a suggestion to "bias" and "prefer" specific results. The query in quotes seems to make it higher priority compared to location and radius.

https://github.com/googlemaps/openapi-specification/blob/main/specification/parameters/places/radius.yml#L17

Also, &fields= is not supported with text search.

maestrolsj commented 3 years ago

Thank you for the good answer ! It helps a lot

On Mon, 23 Aug 2021 at 17:50, Justin Poehnelt @.***> wrote:

It works without the quotes. Radius is only a suggestion to "bias" and "prefer" specific results. The query in quotes seems to make it higher priority compared to location and radius.

https://github.com/googlemaps/openapi-specification/blob/main/specification/parameters/places/radius.yml#L17

Also, &fields= is not supported with text search.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/googlemaps/openapi-specification/issues/184#issuecomment-903894832, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD5O6O4R6CMUPN54FOBKPUTT6JU3RANCNFSM5CTLDIUA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

jpoehnelt commented 3 years ago

Working on updating the description for location and radius to mention this for text search. ref b/138782156

maestrolsj commented 3 years ago

Awesome, thanks!

On Mon 23. Aug 2021 at 21:31, Justin Poehnelt @.***> wrote:

Working on updating the description for location and radius to mention this for text search. ref b/138782156

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/googlemaps/openapi-specification/issues/184#issuecomment-904061072, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD5O6O3GTJH3EFPNENKFFL3T6KOX7ANCNFSM5CTLDIUA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

github-actions[bot] commented 3 years ago

:tada: This issue has been resolved in version 1.16.10 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

maestrolsj commented 3 years ago

Awesome, thanks for the update!

On Thu 26. Aug 2021 at 23:49, github-actions[bot] @.***> wrote:

🎉 This issue has been resolved in version 1.16.10 🎉

The release is available on:

Your semantic-release https://github.com/semantic-release/semantic-release bot 📦🚀

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/googlemaps/openapi-specification/issues/184#issuecomment-906766480, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD5O6O6EL23INUETD5CZWHDT62ZGVANCNFSM5CTLDIUA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.