API to get all the reviews and rating from Google for business

前端 未结 3 2060
情书的邮戳
情书的邮戳 2021-02-07 06:18

I am using the Google Maps API to get the reviews and ratings for a company.

Step 1: HTTP Request to get the reference Id.

$url = \'https://maps.googleap         


        
3条回答
  •  无人共我
    2021-02-07 06:57

    Other simple method to get the 5 last rewiews with the place_id of the location (you can find it here : https://developers.google.com/places/place-id)

    $url = "https://maps.googleapis.com/maps/api/place/details/json?key=Yourkey&placeid=YourplaceID";
    $ch = curl_init();
    curl_setopt ($ch, CURLOPT_URL, $url);
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
    $result = curl_exec ($ch);
    $res        = json_decode($result,true);
    $reviews    = $res['result']['reviews'];
    

提交回复
热议问题