How To Embed Google Reviews Into HTML or PHP Using Google Places API

75 views Asked by At

I want to display 3-5 (read-only) Google reviews on a webpage. Google's Developer Support has suggested I use the Places API instead of the My Business API to display read-only reviews.

I have my place-id and Google Places API key to put into the following URL. If I put this URL into the browser, it returns the JSON list of reviews. However, I can't figure out how to embed these reviews into my HTML or PHP on the webpage.

How can I get the JSON output from the following URL to embed or display within the HTML or PHP of my site?

<script src="https://maps.googleapis.com/maps/api/place/details/json?place_id=[my-place-id]&fields=rating,review&key=[my-api-key]"></script>

How do you embed the JSON output of an external script within HTML or PHP?

0

There are 0 answers