{"id":4445,"date":"2025-04-28T13:05:49","date_gmt":"2025-04-28T13:05:49","guid":{"rendered":"https:\/\/demo.crocoblock.com\/lab\/?p=4445"},"modified":"2025-04-28T13:05:51","modified_gmt":"2025-04-28T13:05:51","slug":"google-reviews-with-jetengine-listing-grid-and-rest-api-query","status":"publish","type":"post","link":"https:\/\/demo.crocoblock.com\/lab\/google-reviews-with-jetengine-listing-grid-and-rest-api-query\/","title":{"rendered":"Google Reviews with JetEngine Listing Grid and Rest API query"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Create <strong><code>google_id<\/code><\/strong> meta field to store place ID for the current post.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"245\" src=\"https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/Google-Chrome_2025-04-28-15-03-56-1024x245.jpg\" alt=\"\" class=\"wp-image-4446\" srcset=\"https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/Google-Chrome_2025-04-28-15-03-56-1024x245.jpg 1024w, https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/Google-Chrome_2025-04-28-15-03-56-300x72.jpg 300w, https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/Google-Chrome_2025-04-28-15-03-56-768x184.jpg 768w, https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/Google-Chrome_2025-04-28-15-03-56.jpg 1260w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">You can find Place ID of any place you need using this page &#8211; <a href=\"https:\/\/developers.google.com\/maps\/documentation\/javascript\/examples\/places-placeid-finder\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/developers.google.com\/maps\/documentation\/javascript\/examples\/places-placeid-finder<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"468\" src=\"https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/image-2-1024x468.png\" alt=\"\" class=\"wp-image-4449\" srcset=\"https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/image-2-1024x468.png 1024w, https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/image-2-300x137.png 300w, https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/image-2-768x351.png 768w, https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/image-2.png 1364w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Setup Rest API endpoint to get the reviews from Google Places API. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"832\" src=\"https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/Google-Chrome_2025-04-28-15-10-56-1024x832.jpg\" alt=\"\" class=\"wp-image-4447\" srcset=\"https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/Google-Chrome_2025-04-28-15-10-56-1024x832.jpg 1024w, https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/Google-Chrome_2025-04-28-15-10-56-300x244.jpg 300w, https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/Google-Chrome_2025-04-28-15-10-56-768x624.jpg 768w, https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/Google-Chrome_2025-04-28-15-10-56-1536x1248.jpg 1536w, https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/Google-Chrome_2025-04-28-15-10-56.jpg 1780w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"756\" src=\"https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/Teampaper-Snap_2025-04-28-15-11-55-1024x756.jpg\" alt=\"\" class=\"wp-image-4448\" srcset=\"https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/Teampaper-Snap_2025-04-28-15-11-55-1024x756.jpg 1024w, https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/Teampaper-Snap_2025-04-28-15-11-55-300x221.jpg 300w, https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/Teampaper-Snap_2025-04-28-15-11-55-768x567.jpg 768w, https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/Teampaper-Snap_2025-04-28-15-11-55-1536x1133.jpg 1536w, https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/Teampaper-Snap_2025-04-28-15-11-55.jpg 1900w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The key points here are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Google Place API (New) URL &#8211; https:\/\/places.googleapis.com\/v1\/places\/<strong><code>%jet_engine_field_name|google_id|field_value%{\"fallback\":\"ChIJj61dQgK6j4AR4GeTYWZsKWw\",\"context\":\"\"}<\/code><\/strong> with JetEngine macro to get the Place ID from <strong><code>google_id<\/code><\/strong> meta key we added before. <strong><code>ChIJj61dQgK6j4AR4GeTYWZsKWw<\/code><\/strong> &#8211; is a fallback value with some real place ID to ensure Rest API preview will work correctly.<\/li>\n\n\n\n<li><strong><code>\/reviews\/<\/code><\/strong> &#8211; is the path to reviews list inside the API response.<\/li>\n\n\n\n<li><strong><code>Custom Header<\/code><\/strong> authorization with X-Goog-Api-Key and X-Goog-FieldMask header. More details in <a href=\"https:\/\/developers.google.com\/maps\/documentation\/places\/web-service\/migrate-details\">Google documentation<\/a><\/li>\n\n\n\n<li>Disable <strong><code>Cache<\/code><\/strong> to avoid show the same reviews to the different Place IDs<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Create the Rest API Query to connect Rest API endpoint with listing<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"693\" src=\"https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/image-3-1024x693.png\" alt=\"\" class=\"wp-image-4450\" srcset=\"https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/image-3-1024x693.png 1024w, https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/image-3-300x203.png 300w, https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/image-3-768x519.png 768w, https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/image-3-1536x1039.png 1536w, https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/image-3.png 1712w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Build listing item to showcase a single review:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"978\" height=\"896\" src=\"https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/image-4.png\" alt=\"\" class=\"wp-image-4451\" srcset=\"https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/image-4.png 978w, https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/image-4-300x275.png 300w, https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/image-4-768x704.png 768w\" sizes=\"(max-width: 978px) 100vw, 978px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Please note:<\/strong> Some review data is located inside the nested fields of the review item and <strong><code>Get child element from object\/array<\/code><\/strong> callback can help to extract this data:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"712\" height=\"422\" src=\"https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/image-6.png\" alt=\"\" class=\"wp-image-4453\" srcset=\"https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/image-6.png 712w, https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/image-6-300x178.png 300w\" sizes=\"(max-width: 712px) 100vw, 712px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"290\" src=\"https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/image-5-1024x290.png\" alt=\"\" class=\"wp-image-4452\" srcset=\"https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/image-5-1024x290.png 1024w, https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/image-5-300x85.png 300w, https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/image-5-768x218.png 768w, https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/image-5-1536x436.png 1536w, https:\/\/demo.crocoblock.com\/lab\/wp-content\/uploads\/2025\/04\/image-5.png 1608w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Create google_id meta field to store place ID for the current post. You can find Place ID of any place you need using this page &#8211; https:\/\/developers.google.com\/maps\/documentation\/javascript\/examples\/places-placeid-finder Setup Rest API endpoint to get the reviews from Google Places API. The key points here are: Create the Rest API Query to connect Rest API endpoint with [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jf_limit_responses":"","page_builder":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-4445","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/demo.crocoblock.com\/lab\/wp-json\/wp\/v2\/posts\/4445","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/demo.crocoblock.com\/lab\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/demo.crocoblock.com\/lab\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/demo.crocoblock.com\/lab\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/demo.crocoblock.com\/lab\/wp-json\/wp\/v2\/comments?post=4445"}],"version-history":[{"count":1,"href":"https:\/\/demo.crocoblock.com\/lab\/wp-json\/wp\/v2\/posts\/4445\/revisions"}],"predecessor-version":[{"id":4454,"href":"https:\/\/demo.crocoblock.com\/lab\/wp-json\/wp\/v2\/posts\/4445\/revisions\/4454"}],"wp:attachment":[{"href":"https:\/\/demo.crocoblock.com\/lab\/wp-json\/wp\/v2\/media?parent=4445"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/demo.crocoblock.com\/lab\/wp-json\/wp\/v2\/categories?post=4445"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/demo.crocoblock.com\/lab\/wp-json\/wp\/v2\/tags?post=4445"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}