Get reviews from google map api

前端 未结 4 1480
名媛妹妹
名媛妹妹 2020-12-13 05:06

I have to get reviews from Google map API. details are on this page.

https://developers.google.com/places/documentation/details#PlaceDetailsResults

the detai

4条回答
  •  悲&欢浪女
    2020-12-13 05:34

    $reqUri = 'https://maps.googleapis.com/maps/api/place/nearbysearch/json?key='.YOURSERVERKEY;
    $reqUri .= '&sensor=false&radius=500';
    $reqUri .= '&location=38.908310,-104.784035&name='.urlencode(LOCATION NAME);
    $reqUri .= '&keyword='.urlencode(WEBSITE PHONE);
    

    I made it through PHP, Now call like this URL and you get original result with reference key.

    Then parse it like:

    $data = cURL($reqUri);
    $data = json_decode($data);
    echo $data ->results[0]->reference;
    

    Hope it will help you

    ***Note: location=38.908310,-104.784035 this var is not auto you must have it.

提交回复
热议问题