Google Place Details Search - opening_hours

Hi,

according to the Google API documentation, we can get the opening hours of a place, although when I run this in Bubble I can not see how I can get the opening hours from the results returned?

https://developers.google.com/places/web-service/details

Use the Place API to get details of the place, including opening hours.

thanks @NigelG

I can see that I can get the ‘Open Now’ result, how do you get the actual daily opening hours for a place?

We don’t expose that yet. Which field are you interested in?

Hey @emmanuel

I am after the ‘opening_hours’ results from a Google Place Details search.

Here is the link to the Google developers documentation:

https://developers.google.com/places/web-service/details#PlaceDetailsResults

Well opening_hours has a few sub fields, and open_now is one of them… So i’m asking for something specific.

Looks like the ‘periods []’ or ‘weekday_text’ would have what I require, which is basically the opening hours by day.

I could add weekday_text, the other one is a bit more complex.

1 Like

Excellent! -yes I think that would work, as it looks like is returned formatted as 7 strings representing each day.

Are you able to also add ‘permanently_closed’ Boolean aswell?

That would be helpful too.

Because you have the PlaceId it is quite simple to do the Places API call to get the details.

1 Like

I tried through Get Google Place and through the connector using the Google Place Details API and the opening_hours is not being exposed as I understand on what @emmanuel said earlier.

Seems to work OK.

The “weekday_text” thing above looks a little odd.

@NigelG

hm - strange, i pretty much have a similar setup and yet get different results

Your place may not have that data ?

@NigelG

I just tried with the following id of a venue in Melbourne AU, Arbory Bar & Eatery and the same results (no opening hours).

place id: ChIJ0VN8sMdC1moRC6hlFTecbTM

https://www.google.com.au/maps/place/Arbory+Bar+%26+Eatery/@-37.8189372,144.9661232,15z/data=!4m5!3m4!1s0x0:0xc999bbc26f34e593!8m2!3d-37.8189372!4d144.9661232

Doesn’t have it.

{
“html_attributions”: [],
“result”: {
“address_components”: [
{
“long_name”: “1”,
“short_name”: “1”,
“types”: [
“street_number”
]
},
{
“long_name”: “Flinders Lane”,
“short_name”: “Flinders Ln”,
“types”: [
“route”
]
},
{
“long_name”: “Melbourne”,
“short_name”: “Melbourne”,
“types”: [
“locality”,
“political”
]
},
{
“long_name”: “Melbourne City”,
“short_name”: “Melbourne”,
“types”: [
“administrative_area_level_2”,
“political”
]
},
{
“long_name”: “Victoria”,
“short_name”: “VIC”,
“types”: [
“administrative_area_level_1”,
“political”
]
},
{
“long_name”: “Australia”,
“short_name”: “AU”,
“types”: [
“country”,
“political”
]
},
{
“long_name”: “3000”,
“short_name”: “3000”,
“types”: [
“postal_code”
]
}
],
“adr_address”: “<span class=“street-address”>1 Flinders Ln, <span class=“locality”>Melbourne <span class=“region”>VIC <span class=“postal-code”>3000, <span class=“country-name”>Australia”,
“formatted_address”: “1 Flinders Ln, Melbourne VIC 3000, Australia”,
“geometry”: {
“location”: {
“lat”: -37.814523,
“lng”: 144.974164
},
“viewport”: {
“northeast”: {
“lat”: -37.81432665000001,
“lng”: 144.97419445
},
“southwest”: {
“lat”: -37.81458845,
“lng”: 144.97407265
}
}
},
“icon”: “https://maps.gstatic.com/mapfiles/place_api/icons/geocode-71.png”,
“id”: “93c59bfd0dbd22d21c6dd96c701e22b5a1a3a8bf”,
“name”: “1 Flinders Ln”,
“place_id”: “ChIJ0VN8sMdC1moRC6hlFTecbTM”,
“reference”: “CpQBigAAAAqugD3V48fq2gctrDwDWYFx81WjZUEbFgv3h2z9gsVQQVMzOqLdWR7XbAyZZSKSXhYOk1SYV43TIQ5CS9gs8pxjcsN9jnYxgQebEiCJMW49fYw1s0t_sk_peIBqf_GzRxOTKVcPo24G624lbjerf_8U-L40XUaSRwuqmrkQd30UeVdGmim4xcuI_QjSGvcxmBIQgWioRZ_VTuqgLKoKJBBY4BoUnCFb11UBVFhWxYwVU4VY4oGjnvI”,
“scope”: “GOOGLE”,
“types”: [
“street_address”
],
“url”: “https://maps.google.com/?q=1+Flinders+Ln,+Melbourne+VIC+3000,+Australia&ftid=0x6ad642c7b07c53d1:0x336d9c371565a80b”,
“utc_offset”: 600,
“vicinity”: “Melbourne”
},
“status”: “OK”
}

My example …

{
“html_attributions”: [],
“result”: {
“address_components”: [
{
“long_name”: “Old London Road”,
“short_name”: “Old London Rd”,
“types”: [
“route”
]
},
{
“long_name”: “Mickleham”,
“short_name”: “Mickleham”,
“types”: [
“postal_town”
]
},
{
“long_name”: “Surrey”,
“short_name”: “Surrey”,
“types”: [
“administrative_area_level_2”,
“political”
]
},
{
“long_name”: “England”,
“short_name”: “England”,
“types”: [
“administrative_area_level_1”,
“political”
]
},
{
“long_name”: “United Kingdom”,
“short_name”: “GB”,
“types”: [
“country”,
“political”
]
},
{
“long_name”: “RH5 6DU”,
“short_name”: “RH5 6DU”,
“types”: [
“postal_code”
]
}
],
“adr_address”: “<span class=“street-address”>Old London Rd, <span class=“locality”>Mickleham <span class=“postal-code”>RH5 6DU, <span class=“country-name”>UK”,
“formatted_address”: “Old London Rd, Mickleham RH5 6DU, UK”,
“formatted_phone_number”: “01372 372279”,
“geometry”: {
“location”: {
“lat”: 51.26773869999999,
“lng”: -0.3241108
},
“viewport”: {
“northeast”: {
“lat”: 51.26776064999998,
“lng”: -0.3238903000000001
},
“southwest”: {
“lat”: 51.26767285000001,
“lng”: -0.3241843
}
}
},
“icon”: “https://maps.gstatic.com/mapfiles/place_api/icons/lodging-71.png”,
“id”: “ceb8321f73a72af2e93e576f3cc2fcf0472a02e6”,
“international_phone_number”: “+44 1372 372279”,
“name”: “The Running Horses”,
“opening_hours”: {
“open_now”: true,
“periods”: [
{
“close”: {
“day”: 0,
“time”: “2230”
},
“open”: {
“day”: 0,
“time”: “1200”
}
},
{
“close”: {
“day”: 1,
“time”: “2300”
},
“open”: {
“day”: 1,
“time”: “1130”
}
},
{
“close”: {
“day”: 2,
“time”: “2300”
},
“open”: {
“day”: 2,
“time”: “1130”
}
},
{
“close”: {
“day”: 3,
“time”: “2300”
},
“open”: {
“day”: 3,
“time”: “1130”
}
},
{
“close”: {
“day”: 4,
“time”: “2300”
},
“open”: {
“day”: 4,
“time”: “1130”
}
},
{
“close”: {
“day”: 5,
“time”: “2300”
},
“open”: {
“day”: 5,
“time”: “1130”
}
},
{
“close”: {
“day”: 6,
“time”: “2300”
},
“open”: {
“day”: 6,
“time”: “1130”
}
}
],
“weekday_text”: [
“Monday: 11:30 am – 11:00 pm”,
“Tuesday: 11:30 am – 11:00 pm”,
“Wednesday: 11:30 am – 11:00 pm”,
“Thursday: 11:30 am – 11:00 pm”,
“Friday: 11:30 am – 11:00 pm”,
“Saturday: 11:30 am – 11:00 pm”,
“Sunday: 12:00 – 10:30 pm”
]
},
“photos”: [
{
“height”: 667,
“html_attributions”: [
“<a href=“https://maps.google.com/maps/contrib/112945391202338073310/photos”>The Running Horses”
],
“photo_reference”: “CoQBdwAAAGBZ0upbIsj3c2alv9dIS0dtu6uGGgf_vzkYd1yflVhUhT21Ud8q9nJQeXN2__f5RBfdfvd3O9gwXIte7OUfMtXrN0Qsm0YFxRNyt8YZ_xJTAjWrV2rgDpv0-I-ULda4VA9p-xrm16zHRJrCoN5Zq_48ork09_z4lA3sWcrqSOo2EhDrm63EDCcQiWNN-ZM_tHgsGhT9mrAXYQjrp0iDXFRtnBNgFhX3PA”,
“width”: 668
},
{
“height”: 667,
“html_attributions”: [
“<a href=“https://maps.google.com/maps/contrib/112945391202338073310/photos”>The Running Horses”
],
“photo_reference”: “CoQBdwAAAPrcvhFQ8ClKST10VKeZYqSDqfIQTCgwxaxT8MiZh16vFPI1kev_uTpiwjvPn75xc_ub_hdo1-O2TKaTi8wUrtd87E_6TVPrLOmOBkeTiTjHG5Fb-evJ8o5tN7rE6PO3yNy2S8t3rMZMpF2FeyVupBNFZk3gB9Of-umka7dGQohpEhDWHeSda7sCvFUxqSLyob-tGhQArBxyVE0wFlA9-6wzFtpd98avYw”,
“width”: 1000
},
{
“height”: 667,
“html_attributions”: [
“<a href=“https://maps.google.com/maps/contrib/112945391202338073310/photos”>The Running Horses”
],
“photo_reference”: “CoQBdwAAAHnxCtMnueLrQRuBPLSzi3eJZTfzLYy_NlhsQOrEcTDIJvbiVTkFUfluxESK7Riv-UnsMdNRlXnTrblszEJJVSgFVMb2IjqG4U3WkOUGx7l8J3f6mOxg-8D8eeWjZZMTyHEAUiVMo2GvvEXqwzrUgWg_aHtqYp6HVSoBLhdHoVjcEhDfK6q6BSvYx6gLqfU6MOvBGhT7ty-JEnZJazXGVXxJa5qXHWPlHQ”,
“width”: 1000
},
{
“height”: 2160,
“html_attributions”: [
“<a href=“https://maps.google.com/maps/contrib/114270508239756000923/photos”>Jørgen Lutro”
],
“photo_reference”: “CoQBdwAAACpPK9XYzHXaBm9bnqdaHsWI2-P1DklE-kobEBbc6lZSRaaFsrVTl1dOltmF1w2XmdkbCGF64uf8KqasHyCQtY0H7K5kTMrfWlg6AIw4hmIQm4aE3ehkpYoalqCHkTKmm4-DPDJPF-ncJBzsDejuWwOccIE8OPTltnBKqysQfsCPEhDD0QQUOzJg37W82kQPDhKpGhRoKXPPHCSvnZf0e_RwAggw77NXSw”,
“width”: 3840
},
{
“height”: 667,
“html_attributions”: [
“<a href=“https://maps.google.com/maps/contrib/112945391202338073310/photos”>The Running Horses”
],
“photo_reference”: “CoQBdwAAAOhBSbq7Vm5oidcHJlycmJEMYZab5_gowdJz_ejP51ngBFGQ9Xz11jOKycm0Moovdop71fc96QCwbgIhcKCrB4qZeGfXP_ap3GhaxklDVNUFYBrDwitgOePKDDw5JfGsGwHHFmUg9zQMpFEoiuTOqtIiVcjxpwcsfkNGcFR3XuN0EhDDnnetU-Rtugno93FftMGGGhQVoN9Ew0dg6EeUbHrKUb63zFdkXg”,
“width”: 1000
},
{
“height”: 667,
“html_attributions”: [
“<a href=“https://maps.google.com/maps/contrib/112945391202338073310/photos”>The Running Horses”
],
“photo_reference”: “CoQBdwAAAO9jPoJT9ss7vC73kapCJ8WwyVlmWJVXMqc8oZtzZoZXh9OFUh-tqCMEZLtT_0i0zVFCj7XE2KymlB4-2RI1jkHebZWxW_XedEEjj6FBbk6vcoqsom8qWl9gZu_mlTy41C74Eru_f9Et_HrKVOTTbymNuzeZ273IAszra_rlCvB8EhBiuFHK0IJEOoVvfkzCq0cdGhQj880RFfdenc60BxpQHFjiozFyog”,
“width”: 1000
},
{
“height”: 667,
“html_attributions”: [
“<a href=“https://maps.google.com/maps/contrib/112945391202338073310/photos”>The Running Horses”
],
“photo_reference”: “CoQBdwAAAIGWr_6P6D6B6aOniVMzWtd2QThJNh2uANFuItW9l_TQFYkDwrcZMq0FUOzsG9o6agQjjwk2y-LVuiy0AZUBkZAnlo1-yegxAMVaMAkVH9ex58PvyBx3BmhVVDKap5uLWgpAZREHer25XdeC1X-jxYnJle3j2CzX7QjCWjUeftF7EhAVVvWgdQRwIQofYd36yQtqGhS4eZxdZA2cQ39iEdbpMT8p4pcdKg”,
“width”: 1000
},
{
“height”: 667,
“html_attributions”: [
“<a href=“https://maps.google.com/maps/contrib/112945391202338073310/photos”>The Running Horses”
],
“photo_reference”: “CoQBdwAAAM0VRfh3EHGeztyBVqrq8_DPs7mNgYwUCxpOerKrDmiZzA9ZjUFIgccAylOPNdwon9GsUFRJxNyO9wbiim4gDbhkdlr2jes0m7mNW586Mc9CsfZPozSd3ZKWvVDpBCHdDnJfVERNPYNpaRvOb6MrtCg-DGPJWIUiu2N0DTJSpKrlEhCXSaVGLrzKCl9ZqLy-vXm4GhRNOSuK3r8LYXK_hyjDZWbBVME52A”,
“width”: 1000
},
{
“height”: 667,
“html_attributions”: [
“<a href=“https://maps.google.com/maps/contrib/112945391202338073310/photos”>The Running Horses”
],
“photo_reference”: “CoQBdwAAAAATvioggQcI5M8bWWCmx6dpR4pdw9eG1GvUTJYluJ20yKS3cH34nleXqQ-mz0dskdIPsbQXhIDCMpm1gKP_jEjeN4c27TjVYEJsNZPqH7I-dcfoErHv-VQCoe_FJ-XouBIMHZ5NaPh9idt31zafYskuyu_XA0Aqe8j3ZwX9KgHTEhDANzKG2mPMqQSj1UwEHDr9GhQo2fEqcNvcY0XJixCnRcVnAoq2Uw”,
“width”: 1000
},
{
“height”: 667,
“html_attributions”: [
“<a href=“https://maps.google.com/maps/contrib/112945391202338073310/photos”>The Running Horses”
],
“photo_reference”: “CoQBdwAAAAdpC9_PLv-fVs4YVNjMxu4M4PpdZkCPAZdQqF4y4E4JuWVCo006g_bYNk1DooKmXX1o8AhR19T_94_fdKGKFoF7IgUCPYLfJwIw6_SprED1AQbffFUpFtvheRJaL2hDYhx10pBzXldfRypbL24da8NC8VaHuS4DCi6ChqpU7uagEhBEMGTqMrPjQWWgeatdBBP-GhTETB1f9Kg-CVZ44_7_6f7vDf3wng”,
“width”: 1000
}
],
“place_id”: “ChIJkwrZKCrhdUgRSgg_RRlJpLM”,
“rating”: 4,
“reference”: “CnRmAAAAim7MzuHjsf1SJFJICM1R3Nh5SmAM-2J1drO8C7RYxd2SE9BjxLXihXlMOJHYRLgG5so5E6stwOurR4bq0E4-Mk8cKlCEhZfLgSNr4sxnZwOuIBzryhoc8YMTjLmPxWUwjIYpvZD0X_7kjsL-pXCjLxIQw9y8oFn9qE3eJzKDi-y-GRoUUpZIghcn82nH1KhSitFmMbmUe7s”,
“reviews”: [
{
“aspects”: [
{
“rating”: 3,
“type”: “overall”
}
],
“author_name”: “Kathryn Phillips”,
“author_url”: “https://plus.google.com/109688355995349532307”,
“language”: “en”,
“profile_photo_url”: “//lh4.googleusercontent.com/-x-yeChsxWIs/AAAAAAAAAAI/AAAAAAAANwM/KLsusU0-fVQ/photo.jpg”,
“rating”: 5,
“text”: “We live locally and have been to the Running Horses on a number of occasions. Sunday lunch is wonderful and very generous, the steak is lovely and we once popped in after a walk up Box Hill and had great sandwiches. All round great place to have near home.”,
“time”: 1466625793
},
{
“aspects”: [
{
“rating”: 2,
“type”: “overall”
}
],
“author_name”: “de Beaufort jacques”,
“author_url”: “https://plus.google.com/100151273641032665413”,
“language”: “en”,
“profile_photo_url”: “//lh4.googleusercontent.com/-NKvfMYTZRCU/AAAAAAAAAAI/AAAAAAAAAVI/x176QfMNJ1k/photo.jpg”,
“rating”: 4,
“text”: "Very friendly staff and management.\nCosy pub with good beers and wines. Good and thoughtful food. Beautiful countryside environment. This is an excellent place to stay for a while, play golf in one of many neighboring ones. ",
“time”: 1466009355
},
{
“aspects”: [
{
“rating”: 3,
“type”: “overall”
}
],
“author_name”: “David Garcia”,
“author_url”: “https://plus.google.com/101235765771484979547”,
“language”: “en”,
“rating”: 5,
“text”: “Stopped for lunch. Delicious food… I had a devilled crab on toast, my companion had pie and mash… they have their own bitter especially brewed for the Running Horses which hit the spot. Good atmosphere… seemed like the good people of Mickleham use the pub as an extension to their homes. My only criticism is that I would have appreciated a more generous portion”,
“time”: 1460207678
},
{
“aspects”: [
{
“rating”: 2,
“type”: “overall”
}
],
“author_name”: “Frankie May”,
“author_url”: “https://plus.google.com/103557305832355481396”,
“language”: “en”,
“rating”: 4,
“text”: "Good food slightly over priced. Lovely helpful manager! ",
“time”: 1462395640
},
{
“aspects”: [
{
“rating”: 3,
“type”: “overall”
}
],
“author_name”: “Richard Thomas”,
“author_url”: “https://plus.google.com/112001555782914072199”,
“language”: “en”,
“profile_photo_url”: “//lh4.googleusercontent.com/--7vHGaM1BC4/AAAAAAAAAAI/AAAAAAAABiU/NRAPLagTquk/photo.jpg”,
“rating”: 5,
“text”: "Nice pub with friendly service and garden; unspoilt by corporate makeovers. ",
“time”: 1466861060
}
],
“scope”: “GOOGLE”,
“types”: [
“bar”,
“lodging”,
“point_of_interest”,
“establishment”
],
“url”: “https://maps.google.com/?cid=12944551601854416970”,
“utc_offset”: 60,
“vicinity”: “Old London Road, Mickleham”,
“website”: “http://www.therunninghorses.co.uk/
},
“status”: “OK”
}

@NigelG

so how can I get access to these opening hours showing in google maps?

Now that is a very good question.