我已经开发了一个脚本来获取和显示谷歌评论使用谷歌的地方api。它获得了5条评论,但不是最新的。
google放置api返回5个随机评论还是最近的5个评论?
谢谢
如下所示:http://code.google.com/p/gmaps-api-issues/issues/detail?id=2477
"这是Google+ Local上显示的前5条评论,我相信这是根据相关性/有用性排名的。不可能更改所请求的审查集。"
Places API默认情况下只返回5,如果您申请GMB API并且您管理验证位置,则可以访问帐户上的评论,但这只有在您获得API批准并向业务进行身份验证时才有效;或者你也可以复制/粘贴或者使用第三方服务来获取,比如reviewmaker;但没有其他方法获得超过5个返回的地方API,同样的事情与Yelp谁也限制你获取超过一个上限的数字。
简单地说,你有一个api,将始终返回最新的评论从谷歌地图位置。
https://maps.googleapis.com/maps/api/place/details/json?place_id={Your Place ID}&fields=name,rating,reviews&key={GOOGLE DEV KEY}
下面是该api的响应。
{
"html_attributions" : [],
"result" : {
"name" : "gathern app",
"rating" : 5,
"reviews" : [
{
"author_name" : "صالح وحيد Saleh Waheed",
"author_url" : "https://www.google.com/maps/contrib/100946881376925963940/reviews",
"language" : "en",
"profile_photo_url" : "https://lh3.ggpht.com/-bgNhUmU_Ftg/AAAAAAAAAAI/AAAAAAAAAAA/-rLGfz7aAEk/s128-c0x00000000-cc-rp-mo-ba2/photo.jpg",
"rating" : 5,
"relative_time_description" : "in the last week",
"text" : "Gathern is an online platform that helps people find vacation rentals and chalets in KSA.nnGreat team and great website.nnGathern.co",
"time" : 1582015365
},
{
"author_name" : "Hassan Raza",
"author_url" : "https://www.google.com/maps/contrib/109666951306307815476/reviews",
"language" : "en",
"profile_photo_url" : "https://lh3.ggpht.com/-VrVSfhsRo28/AAAAAAAAAAI/AAAAAAAAAAA/9gJQWSdJ3TM/s128-c0x00000000-cc-rp-mo-ba3/photo.jpg",
"rating" : 5,
"relative_time_description" : "a week ago",
"text" : "Great peoples and superb platform for booking online chalets.",
"time" : 1581492666
},
{
"author_name" : "Eman Alswailem",
"author_url" : "https://www.google.com/maps/contrib/115734038039879616345/reviews",
"language" : "ar",
"profile_photo_url" : "https://lh4.ggpht.com/-xNiMOs2bD3A/AAAAAAAAAAI/AAAAAAAAAAA/tElDIT5zP78/s128-c0x00000000-cc-rp-mo/photo.jpg",
"rating" : 5,
"relative_time_description" : "2 months ago",
"text" : "تطبيق ممتاز لحجز الشاليهات اون لاين",
"time" : 1575659218
},
{
"author_name" : "Hanan alnami",
"author_url" : "https://www.google.com/maps/contrib/114513293972924581219/reviews",
"language" : "ar",
"profile_photo_url" : "https://lh6.ggpht.com/-BUEZWeWQhv4/AAAAAAAAAAI/AAAAAAAAAAA/7A8id3FGLQA/s128-c0x00000000-cc-rp-mo/photo.jpg",
"rating" : 5,
"relative_time_description" : "6 months ago",
"text" : "تطبيق ممتاز دايم احجز منه شاليهات شكرا لكم",
"time" : 1566223757
}
]
},
"status" : "OK"
}