{"id":24,"date":"2023-11-17T20:20:30","date_gmt":"2023-11-17T20:20:30","guid":{"rendered":"https:\/\/xengage.com\/insights\/?p=24"},"modified":"2023-11-17T20:20:31","modified_gmt":"2023-11-17T20:20:31","slug":"how-to-fetch-google-places-new-reviews","status":"publish","type":"post","link":"https:\/\/xengage.com\/insights\/how-to-fetch-google-places-new-reviews\/","title":{"rendered":"How to Fetch Google Places (NEW) Reviews"},"content":{"rendered":"\n<p>To fetch Google Places (NEW) reviews on a website, you can use JavaScript along with the Google Maps JavaScript API. Here&#8217;s an example code snippet:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html>\r\n&lt;html>\r\n&lt;head>\r\n    &lt;title>Google Places Reviews&lt;\/title>\r\n    &lt;!-- Include the Google Maps JavaScript API -->\r\n    &lt;script src=\"https:\/\/maps.googleapis.com\/maps\/api\/js?key=YOUR_API_KEY&amp;libraries=places\">&lt;\/script>\r\n&lt;\/head>\r\n&lt;body>\r\n\r\n&lt;div id=\"google-reviews\">\r\n    &lt;!-- Google reviews will be displayed here -->\r\n&lt;\/div>\r\n\r\n&lt;script>\r\n    \/\/ Replace 'YOUR_API_KEY' with your actual Google API key\r\n    const apiKey = 'YOUR_API_KEY';\r\n    const placeId = 'YOUR_GOOGLE_PLACE_ID'; \/\/ Replace with your Google Place ID\r\n\r\n    \/\/ Create a new PlacesService object\r\n    const service = new google.maps.places.PlacesService(document.createElement('div'));\r\n\r\n    \/\/ Request place details including reviews\r\n    service.getDetails({\r\n        placeId: placeId,\r\n        fields: &#91;'reviews'],\r\n        key: apiKey\r\n    }, function(place, status) {\r\n        if (status === google.maps.places.PlacesServiceStatus.OK) {\r\n            const reviews = place.reviews;\r\n\r\n            const reviewContainer = document.getElementById('google-reviews');\r\n\r\n            reviews.forEach(review => {\r\n                const rating = review.rating;\r\n                const authorName = review.author_name;\r\n                const text = review.text;\r\n\r\n                const reviewDiv = document.createElement('div');\r\n                reviewDiv.innerHTML = `&lt;p>&lt;strong>${authorName}&lt;\/strong> (${rating} stars)&lt;\/p>&lt;p>${text}&lt;\/p>`;\r\n                reviewContainer.appendChild(reviewDiv);\r\n            });\r\n        } else {\r\n            document.getElementById('google-reviews').innerHTML = 'No reviews found.';\r\n        }\r\n    });\r\n&lt;\/script>\r\n\r\n&lt;\/body>\r\n&lt;\/html>\r\n<\/code><\/pre>\n\n\n\n<p>Remember to replace <code>'YOUR_API_KEY'<\/code> with your actual Google API key and <code>'YOUR_GOOGLE_PLACE_ID'<\/code> with the Place ID of your business on Google Maps.<\/p>\n\n\n\n<p>This code uses the <code>google.maps.places.PlacesService<\/code> to fetch place details, including reviews, for the specified Place ID. It then dynamically creates HTML elements to display the retrieved reviews on the webpage.<\/p>\n\n\n\n<p>Make sure to comply with Google&#8217;s terms of service and API usage policies while implementing this on your website. Also, keep in mind that this example assumes that the Google Maps JavaScript API is properly loaded and available in your web page.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To fetch Google Places (NEW) reviews on a website, you can use JavaScript along with the Google Maps JavaScript API. Here&#8217;s an example code snippet: Remember to replace &#8216;YOUR_API_KEY&#8217; with your actual Google API key and &#8216;YOUR_GOOGLE_PLACE_ID&#8217; with the Place ID of your business on Google Maps. This code uses the google.maps.places.PlacesService to fetch place [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[8,4],"class_list":["post-24","post","type-post","status-publish","format-standard","hentry","category-coding","tag-api","tag-google"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Fetch Google Places (NEW) Reviews - Xengage Insights<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/xengage.com\/insights\/how-to-fetch-google-places-new-reviews\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Fetch Google Places (NEW) Reviews - Xengage Insights\" \/>\n<meta property=\"og:description\" content=\"To fetch Google Places (NEW) reviews on a website, you can use JavaScript along with the Google Maps JavaScript API. Here&#8217;s an example code snippet: Remember to replace &#039;YOUR_API_KEY&#039; with your actual Google API key and &#039;YOUR_GOOGLE_PLACE_ID&#039; with the Place ID of your business on Google Maps. This code uses the google.maps.places.PlacesService to fetch place [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/xengage.com\/insights\/how-to-fetch-google-places-new-reviews\/\" \/>\n<meta property=\"og:site_name\" content=\"Xengage Insights\" \/>\n<meta property=\"article:published_time\" content=\"2023-11-17T20:20:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-11-17T20:20:31+00:00\" \/>\n<meta name=\"author\" content=\"Xengage\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Xengage\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/xengage.com\/insights\/how-to-fetch-google-places-new-reviews\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/xengage.com\/insights\/how-to-fetch-google-places-new-reviews\/\"},\"author\":{\"name\":\"Xengage\",\"@id\":\"https:\/\/xengage.com\/insights\/#\/schema\/person\/d2ac92e40345bccdc6af9fd6ec7d0aca\"},\"headline\":\"How to Fetch Google Places (NEW) Reviews\",\"datePublished\":\"2023-11-17T20:20:30+00:00\",\"dateModified\":\"2023-11-17T20:20:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/xengage.com\/insights\/how-to-fetch-google-places-new-reviews\/\"},\"wordCount\":123,\"publisher\":{\"@id\":\"https:\/\/xengage.com\/insights\/#organization\"},\"keywords\":[\"API\",\"Google\"],\"articleSection\":[\"Coding\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/xengage.com\/insights\/how-to-fetch-google-places-new-reviews\/\",\"url\":\"https:\/\/xengage.com\/insights\/how-to-fetch-google-places-new-reviews\/\",\"name\":\"How to Fetch Google Places (NEW) Reviews - Xengage Insights\",\"isPartOf\":{\"@id\":\"https:\/\/xengage.com\/insights\/#website\"},\"datePublished\":\"2023-11-17T20:20:30+00:00\",\"dateModified\":\"2023-11-17T20:20:31+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/xengage.com\/insights\/how-to-fetch-google-places-new-reviews\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/xengage.com\/insights\/how-to-fetch-google-places-new-reviews\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/xengage.com\/insights\/how-to-fetch-google-places-new-reviews\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/xengage.com\/insights\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Fetch Google Places (NEW) Reviews\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/xengage.com\/insights\/#website\",\"url\":\"https:\/\/xengage.com\/insights\/\",\"name\":\"Xengage Insights\",\"description\":\"Digital Marketing &amp; Technology Blog\",\"publisher\":{\"@id\":\"https:\/\/xengage.com\/insights\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/xengage.com\/insights\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/xengage.com\/insights\/#organization\",\"name\":\"Xengage Insights\",\"url\":\"https:\/\/xengage.com\/insights\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/xengage.com\/insights\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/xengage.com\/insights\/cms\/wp-content\/uploads\/2024\/01\/cropped-xengage-logo.jpg\",\"contentUrl\":\"https:\/\/xengage.com\/insights\/cms\/wp-content\/uploads\/2024\/01\/cropped-xengage-logo.jpg\",\"width\":512,\"height\":512,\"caption\":\"Xengage Insights\"},\"image\":{\"@id\":\"https:\/\/xengage.com\/insights\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/xengage.com\/insights\/#\/schema\/person\/d2ac92e40345bccdc6af9fd6ec7d0aca\",\"name\":\"Xengage\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/xengage.com\/insights\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/acaa5835a18f0598852d95ace0504d2d1e12e6eb408fec04921d24eba14c2057?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/acaa5835a18f0598852d95ace0504d2d1e12e6eb408fec04921d24eba14c2057?s=96&d=mm&r=g\",\"caption\":\"Xengage\"},\"sameAs\":[\"https:\/\/xengage.com\/insights\/cms\"],\"url\":\"https:\/\/xengage.com\/insights\/author\/xengage\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Fetch Google Places (NEW) Reviews - Xengage Insights","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/xengage.com\/insights\/how-to-fetch-google-places-new-reviews\/","og_locale":"en_US","og_type":"article","og_title":"How to Fetch Google Places (NEW) Reviews - Xengage Insights","og_description":"To fetch Google Places (NEW) reviews on a website, you can use JavaScript along with the Google Maps JavaScript API. Here&#8217;s an example code snippet: Remember to replace 'YOUR_API_KEY' with your actual Google API key and 'YOUR_GOOGLE_PLACE_ID' with the Place ID of your business on Google Maps. This code uses the google.maps.places.PlacesService to fetch place [&hellip;]","og_url":"https:\/\/xengage.com\/insights\/how-to-fetch-google-places-new-reviews\/","og_site_name":"Xengage Insights","article_published_time":"2023-11-17T20:20:30+00:00","article_modified_time":"2023-11-17T20:20:31+00:00","author":"Xengage","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Xengage","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/xengage.com\/insights\/how-to-fetch-google-places-new-reviews\/#article","isPartOf":{"@id":"https:\/\/xengage.com\/insights\/how-to-fetch-google-places-new-reviews\/"},"author":{"name":"Xengage","@id":"https:\/\/xengage.com\/insights\/#\/schema\/person\/d2ac92e40345bccdc6af9fd6ec7d0aca"},"headline":"How to Fetch Google Places (NEW) Reviews","datePublished":"2023-11-17T20:20:30+00:00","dateModified":"2023-11-17T20:20:31+00:00","mainEntityOfPage":{"@id":"https:\/\/xengage.com\/insights\/how-to-fetch-google-places-new-reviews\/"},"wordCount":123,"publisher":{"@id":"https:\/\/xengage.com\/insights\/#organization"},"keywords":["API","Google"],"articleSection":["Coding"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/xengage.com\/insights\/how-to-fetch-google-places-new-reviews\/","url":"https:\/\/xengage.com\/insights\/how-to-fetch-google-places-new-reviews\/","name":"How to Fetch Google Places (NEW) Reviews - Xengage Insights","isPartOf":{"@id":"https:\/\/xengage.com\/insights\/#website"},"datePublished":"2023-11-17T20:20:30+00:00","dateModified":"2023-11-17T20:20:31+00:00","breadcrumb":{"@id":"https:\/\/xengage.com\/insights\/how-to-fetch-google-places-new-reviews\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/xengage.com\/insights\/how-to-fetch-google-places-new-reviews\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/xengage.com\/insights\/how-to-fetch-google-places-new-reviews\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/xengage.com\/insights\/"},{"@type":"ListItem","position":2,"name":"How to Fetch Google Places (NEW) Reviews"}]},{"@type":"WebSite","@id":"https:\/\/xengage.com\/insights\/#website","url":"https:\/\/xengage.com\/insights\/","name":"Xengage Insights","description":"Digital Marketing &amp; Technology Blog","publisher":{"@id":"https:\/\/xengage.com\/insights\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/xengage.com\/insights\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/xengage.com\/insights\/#organization","name":"Xengage Insights","url":"https:\/\/xengage.com\/insights\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/xengage.com\/insights\/#\/schema\/logo\/image\/","url":"https:\/\/xengage.com\/insights\/cms\/wp-content\/uploads\/2024\/01\/cropped-xengage-logo.jpg","contentUrl":"https:\/\/xengage.com\/insights\/cms\/wp-content\/uploads\/2024\/01\/cropped-xengage-logo.jpg","width":512,"height":512,"caption":"Xengage Insights"},"image":{"@id":"https:\/\/xengage.com\/insights\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/xengage.com\/insights\/#\/schema\/person\/d2ac92e40345bccdc6af9fd6ec7d0aca","name":"Xengage","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/xengage.com\/insights\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/acaa5835a18f0598852d95ace0504d2d1e12e6eb408fec04921d24eba14c2057?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/acaa5835a18f0598852d95ace0504d2d1e12e6eb408fec04921d24eba14c2057?s=96&d=mm&r=g","caption":"Xengage"},"sameAs":["https:\/\/xengage.com\/insights\/cms"],"url":"https:\/\/xengage.com\/insights\/author\/xengage\/"}]}},"_links":{"self":[{"href":"https:\/\/xengage.com\/insights\/wp-json\/wp\/v2\/posts\/24","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xengage.com\/insights\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xengage.com\/insights\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xengage.com\/insights\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xengage.com\/insights\/wp-json\/wp\/v2\/comments?post=24"}],"version-history":[{"count":1,"href":"https:\/\/xengage.com\/insights\/wp-json\/wp\/v2\/posts\/24\/revisions"}],"predecessor-version":[{"id":25,"href":"https:\/\/xengage.com\/insights\/wp-json\/wp\/v2\/posts\/24\/revisions\/25"}],"wp:attachment":[{"href":"https:\/\/xengage.com\/insights\/wp-json\/wp\/v2\/media?parent=24"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xengage.com\/insights\/wp-json\/wp\/v2\/categories?post=24"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xengage.com\/insights\/wp-json\/wp\/v2\/tags?post=24"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}