[英]Google places api doesn't return reviews or ratings
我剛剛注意到的是,我們的google +頁面是https://plus.google.com/101505653197189425411/about
但是api返回的google +頁面是https://plus.google.com/118350519387987879004/about?hl=zh-CN
這兩個google plus頁面都適用於我們公司,我不確定第二個google +頁面是什么,但是它沒有任何評論,因此可以理解為什么api沒有返回任何評論。
我們想在我們公司的網站上顯示一些Google評論,但我只能獲得有關我們公司的信息,不會返回任何評分或評論。 我們在Google+頁面上有評論,以及在Google搜索中為我們顯示的評論,所以我知道我們有評論。 我正在嘗試使用Google Places API。 我進行了位置搜索以獲得參考,我在控制台中打開了位置api,在api訪問中生成了一個密鑰,並設置了一些允許的IP。 我用curl打電話。
$request = 'https://maps.googleapis.com/maps/api/place/details/json?reference=CoQBegAAANKTKgF4XccOIERYeXixRttRcupjpiAnouwQJIqlPcM9BrFlHGMI2Css2lUhTfVVut65SCYB4CVxnMzk3hro24fijoTO15Fk7GWpqv9cgu7A0MltCVa1vNk6RrH8_5LRcea7u2LgbWtb5N6G109eif3ifOHzf09lTE1OdNIPR57qEhBkD6dtfnctIEd5IQEEW8RDGhRT0wWXkqYMtqJ2h901WR9kdWOKdw&sensor=false&key=supersecretapikey';
$session = curl_init();
curl_setopt($session, CURLOPT_URL, $request);
curl_setopt($session, CURLOPT_HEADER, false);
curl_setopt($session, CURLOPT_SSLVERSION,3);
curl_setopt($session, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($session, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
curl_setopt($session, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($session, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
$response = curl_exec($session);
//echo curl_getinfo($session). '<br/>';
//echo curl_errno($session). '<br/>';
//echo curl_error($session). '<br/>';
curl_close($session);
var_dump($response);
這是從$ response中轉儲的內容
{
"debug_info": [],
"html_attributions": [],
"result": {
"address_components": [
{
"long_name": "2805",
"short_name": "2805",
"types": [
"street_number"
]
},
{
"long_name": "Washington Boulevard",
"short_name": "Washington Boulevard",
"types": [
"route"
]
},
{
"long_name": "Ogden",
"short_name": "Ogden",
"types": [
"sublocality",
"political"
]
},
{
"long_name": "Ogden",
"short_name": "Ogden",
"types": [
"locality",
"political"
]
},
{
"long_name": "Weber County",
"short_name": "Weber County",
"types": [
"administrative_area_level_2",
"political"
]
},
{
"long_name": "UT",
"short_name": "UT",
"types": [
"administrative_area_level_1",
"political"
]
},
{
"long_name": "US",
"short_name": "US",
"types": [
"country",
"political"
]
},
{
"long_name": "84401",
"short_name": "84401",
"types": [
"postal_code"
]
}
],
"formatted_address": "2805 Washington Boulevard, Ogden, UT, United States",
"formatted_phone_number": "(801) 621-6500",
"geometry": {
"location": {
"lat": 41.213974,
"lng": -111.970847
}
},
"icon": "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png",
"id": "ce471d4942919106311349a18d805be7046a61bf",
"international_phone_number": "+1 801-621-6500",
"name": "Hertz Car Sales Ogden UT",
"opening_hours": {
"open_now": true,
"periods": [
{
"close": {
"day": 1,
"time": "2000"
},
"open": {
"day": 1,
"time": "0900"
}
},
{
"close": {
"day": 2,
"time": "2000"
},
"open": {
"day": 2,
"time": "0900"
}
},
{
"close": {
"day": 3,
"time": "2000"
},
"open": {
"day": 3,
"time": "0900"
}
},
{
"close": {
"day": 4,
"time": "2000"
},
"open": {
"day": 4,
"time": "0900"
}
},
{
"close": {
"day": 5,
"time": "2000"
},
"open": {
"day": 5,
"time": "0900"
}
},
{
"close": {
"day": 6,
"time": "1900"
},
"open": {
"day": 6,
"time": "0900"
}
}
]
},
"reference": "CoQBegAAAKS_lTlHVHEBg4mUzeFpsO1VDcHdnQ0GVgGezJ-TaHbFnsvGYqvh-Yzuc1N6UF0lQQuJM0IWa1BIWmbXbs5Yvj7mhBgTph0u5ResZhFYDYSXi5q6RIlRfe1Vlj40DoHroLmAAmbfaghv-TQV7a7VH3QlOckSaCiuMwkpWX6tOGd-EhDPycK7dnAJZxnq5Jx2Tz00GhR98Y2mAkoL68NlnL-uyFeld1RvbQ",
"types": [
"establishment"
],
"url": "https://plus.google.com/118350519387987879004/about?hl=en-US",
"utc_offset": -420,
"vicinity": "2805 Washington Boulevard, Ogden",
"website": "http://www.hertzogden.com/"
},
"status": "OK"
}
這是我們的問題,因為我們在Google地方中的同一位置有多個Google Plus頁面。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.