从谷歌地点API获取超过5个评论

28

1
可能是Google Places API仅返回5个结果的重复问题。 - C8H10N4O2
6个回答

22
为了获得访问 Google API 超过5条评论的权限,您需要购买来自 Google 的高级数据访问权限。该高级计划将授予您访问各种附加数据点的权限,但需要支付一大笔费用。
如果您是企业主要想检索所有评论,则可以这样做,但首先您需要获取验证并可以通过 MyBusiness API 完成此操作,更多信息请参见:https://developers.google.com/my-business/

2
这是正确的,如果您是企业所有者,则可以使用Google My Business API检索所有评论。https://developers.google.com/my-business/content/review-data#list_all_reviews - Aaron Cicali
作为业务所有者,我们可以通过MyBusiness API https://developers.google.com/my-business/获取所有评论。作为应用程序(第三方),我们可以通过places api获取评论。https://maps.googleapis.com/maps/api/place/details/json?placeid=diecalp&key=yakyakyak,限制为5个。因此,使用高级计划的places api,我们能够获取与其位置相关的所有评论。对吗?@tekill - praaveen V R
@Nidhin,你能否选出答案,因为这个问题已经得到解答了。谢谢,我希望你能实现你想做的事情。 - Tekill
4
看起来他们停止支持新客户了。"注意:Google 地图平台高级版计划不再接受注册或新客户加入。"有什么替代方案吗? - user1569341

18

3

不幸的是,除非您是业务所有者并经过Tekill的验证,否则在地点API中无法获得超过5个评论。 但看起来有一些外部服务可以获取所有评论。 我猜想他们直接从Google Maps上爬取这些评论: 其中一些服务是WextractorReviewShakeAllReviews


4
这些并不是有用的。而且也没有返回所有的评论。 - Hassan Raza

1

或者,您可以使用第三方解决方案,例如SerpApi来爬取任何地方的所有评论。这是一个付费API,有免费试用。

每个页面获取10个结果。要实现分页,只需使用start参数定义结果偏移量(例如,默认值0是结果的第一页,10是结果的第二页,20是结果的第三页等)

示例Python代码(也可在其他库中使用):

from serpapi import GoogleSearch

params = {
  "engine": "google_maps_reviews",
  "place_id": "0x89c259a61c75684f:0x79d31adb123348d2",
  "api_key": "SECRET_API_KEY"
}

search = GoogleSearch(params)
results = search.get_dict()
reviews = results['reviews']

示例输出:

"reviews": [
  {
    "user": {
      "name": "Waylon Bilbrey",
      "link": "https://www.google.com/maps/contrib/107691056156160235121?hl=en-US&sa=X&ved=2ahUKEwiUituIlpTvAhVYCc0KHbvTCrgQvvQBegQIARAx",
      "thumbnail": "https://lh3.googleusercontent.com/a-/AOh14GjOj6Wjfk1kSYjhvH7WIBNMdl4nPj6FvUhvYcR6=s40-c0x00000000-cc-rp",
      "reviews": 1
    },
    "rating": 4,
    "date": "a week ago",
    "snippet": "I've been here multiple times. The coffee itself is just average to me. The service is good (the people working are nice). The aesthetic is obviously what brings the place some fame. A little overpriced (even for NY). A very small cup for $6 where I feel like the price comes from the top rainbow foam decor , when I'm going to cover it anyways. If it's for an insta pic then it may be worth it?"
  },
  {
    "user": {
      "name": "Amber Grace Sale",
      "link": "https://www.google.com/maps/contrib/106390058588469541899?hl=en-US&sa=X&ved=2ahUKEwiUituIlpTvAhVYCc0KHbvTCrgQvvQBegQIARA7",
      "thumbnail": "https://lh3.googleusercontent.com/a-/AOh14Gj84nHu_9V_0V4yRbZcr-8ZTYAHua6gUBP8fC7W=s40-c0x00000000-cc-rp-ba3",
      "local_guide": true,
      "reviews": 33,
      "photos": 17
    },
    "rating": 5,
    "date": "2 years ago",
    "snippet": "They really take pride in their espresso roast here and the staff is extremely knowledgeable on the subject. It’s also a GREAT place to do work although a table is no guarantee; you might have to wait for a bit. My almond milk cappuccino was very acidic at the end which wasn’t expected but I could still tell the bean was high quality. Their larger lattés they put in a tall glass cup which looks really really cool. Would definitely go again.",
    "likes": 2,
    "images": [
      "https://lh5.googleusercontent.com/p/AF1QipMup24_dHrWtNN4ZD70EPsiRMf_tykcUkPw6A1H=w100-h100-p-n-k-no"
    ]
  },
  {
    "user": {
      "name": "Kelvin Petar",
      "link": "https://www.google.com/maps/contrib/100859090874785206875?hl=en-US&sa=X&ved=2ahUKEwiUituIlpTvAhVYCc0KHbvTCrgQvvQBegQIARBG",
      "thumbnail": "https://lh3.googleusercontent.com/a-/AOh14GhdIvUDamzfPqbYIpwhnGJV2XWSi77iVXfEsiKS=s40-c0x00000000-cc-rp",
      "reviews": 3
    },
    "rating": 4,
    "date": "3 months ago",
    "snippet": "Stumptown Cafe is the perfect place to work or catch up with friends. Never too loud, never too dead. Their lattes and deliciously addicting and the toasts are tasty as well. Wifi is always fast, which is a huge plus! The staff are the friendliest, I highly recommend this place!"
  },
  ...
]

你可以查看文档以获取更多详细信息。
免责声明:我在SerpApi工作。

谢谢分享。使用SerpApi时,我的服务器API是否有被Google或Yelp屏蔽的可能性?如果有,我该如何避免这种情况发生? - lomse
谢谢你分享这个。使用SerpApi时,我的服务器API是否有被Google或Yelp屏蔽的可能性?如果有的话,我该如何避免这种情况发生? - undefined

0

补充@miguev的答案,目前没有办法在不使用高级API的情况下获取超过5个顶级评论(根据我与Google Maps的一位工作人员的交谈),而这是昂贵的。


0

我们尝试注册Google Maps平台高级计划,以便在this等页面上展示它们,但是Google表示该计划已不再接受注册或新客户。现在我们只能显示5个评论。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接