Closed timwangmusic closed 1 year ago
Hi, can some one take a look at the issue?
Hi, can some one take a look at the issue?
Can u offer a curl request for it? Then I can try it on my side.
Sorry for late response. I tried this call https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&rankby=prominence&type=restaurant&radius=5000&key=YOUR_API_KEY
. I still can see that the opening_hours field only contains a Boolean value { open_now: true }
Maybe this is intended? The original issue was not about the REST API, but the maps Golang client. From the type OpeningHours struct it is not obvious at all that users should expect Periods []OpeningHoursPeriod
field to be nil.
Our project recently updated to use the latest release 1.3.2
but still seeing this behavior.
opening_hours.weekday_text
and opening_hours.periods
are not available through Search, as documented at https://developers.google.com/maps/documentation/places/web-service/place-data-fields#places-api-fields-support.
The reference documentation for the returned PlaceOpeningHours object confirms what @timwangmusic is seeing, that what is left is open_now
.
Thanks @wangela for the investigation. So I think for API users the procedure to get details around a location is first do nearby search and use place details API to get place details with place ID?
@timwangmusic sorry for missing your question. Yes, get the Place ID from the search results and use that Place ID to request Place Details.
Environment details
Steps to reproduce
maps.PlacesSearchResponse.Results.OpeningHours
nil
, and for others theWeekdayText
andPeriods
slice lengths are zeroCode example
Comment: are we supposed to always use DetailedSearch to get the
OpeningHours
info?