使用 Facebook Graph API 2.2 获得点赞和分享数

Using Facebook Graph API 2.2 to get like and share count

我正在努力将项目从旧的 FQL 更新到图形 api 2.2,我不知道如何在特定的 link 上获得喜欢的计数,他们的文档对我来说不是很透明(我是初学者)。我相信它应该是这样的:https://graph.facebook.com/v2.2/?id={myURL}/{some fields like like_count} 但我不知道如何使用图表 API 正确地做到这一点。我将不胜感激任何帮助。

好吧,我认为文档很清楚:

/?id={url} 端点上没有点赞!示例调用是

GET /?id=http://mashable.com/2015/02/17/10-minute-rule/

回复:

{
  "og_object": {
    "id": "664547577004455", 
    "description": "Three tips for making the 10-minute rule work for you.", 
    "title": "A 10-minute timer could revolutionize your productivity", 
    "type": "article", 
    "updated_time": "2015-02-17T13:55:11+0000", 
    "url": "http://mashable.com/2015/02/17/10-minute-rule/"
  }, 
  "share": {
    "comment_count": 0, 
    "share_count": 180
  }, 
  "id": "http://mashable.com/2015/02/17/10-minute-rule/"
}

如果您只想要分享数,请使用

GET /?fields=id,share&id=http://mashable.com/2015/02/17/10-minute-rule/

回复:

{
  "id": "http://mashable.com/2015/02/17/10-minute-rule/", 
  "share": {
    "comment_count": 0, 
    "share_count": 180
  }
}