I am attempting to retrieve the places information based on the code samples however, I am not able to get the hours of operation. The demo web app in AWS shows this as a value that is useable.
This is what I am trying:
// Build the search text from parameters
String searchText = String.format("%s %s %s %s", name, addressLine1, city, state);
// Create search request
SearchPlaceIndexForTextRequest searchRequest = SearchPlaceIndexForTextRequest.builder()
.indexName(placesIndex)
.text(searchText)
.build();
// Execute search
SearchPlaceIndexForTextResponse searchResponse = locationClient.searchPlaceIndexForText(searchRequest);
if (searchResponse.hasResults() && !searchResponse.results().isEmpty()) {
// Get the first result's place ID
Optional<SearchForTextResult> results = searchResponse.results().stream().findFirst();
String placeId = results.get().placeId();
logger.debug("place id: {}", placeId);
// Create get place request
GetPlaceRequest placeRequest = GetPlaceRequest.builder()
.placeId(placeId)
.indexName(placesIndex)
.language("en") // Specify language for the response
.build();
}
However I never get hours back, for example on a McDonalds I get the following:
{"businessHours":"{\"addressNumber\":\"510\",\"categories\":[\"PointOfInterestType\"],\"country\":\"USA\",\"geometry\":{\"point\":[-116.2429,43.60939]},\"interpolated\":false,\"label\":\"McDonald\\u0027s, 510 N Orchard St, Boise, ID 83706-1979, United States\",\"municipality\":\"Boise\",\"neighborhood\":\"Morris Hill\",\"postalCode\":\"83706-1979\",\"region\":\"Idaho\",\"street\":\"N Orchard St\",\"subRegion\":\"Ada\",\"supplementalCategories\":[\"Fast Food\"],\"timeZone\":{\"name\":\"America/Boise\",\"offset\":-25200}}"}
But the sample app shows:
Can this API return the hours noted?