使用API​​ Graph v2.6获取给定URL的Facebook分享,赞成和评论计数

问题描述:

由于Legacy REST API和Facebook查询语言(FQL)在8月7日以后将不再可用我正在寻找基于以下替代方法的API Graph v2.6:

As both Legacy REST API and Facebook Query Language (FQL) will no longer be available after 7th August I am looking for an API Graph v2.6 based on alternative to:

  • https://api.facebook.com/method/links.getStats?urls=http://www.imdb.com/title/tt2015381/&format=json
  • https://graph.facebook.com/fql?q=SELECT url, normalized_url, share_count, like_count, comment_count, total_count,commentsbox_count, comments_fbid, click_count FROM link_stat WHERE url='http://www.imdb.com/title/tt2015381/'

到目前为止,这是我的v2.6当前等价物: https://graph.facebook.com/v2.6/?id=YOUR_URL&fields=og_object {engagement},分享{share_count}& access_token = YOUR_TOKEN code> og_object {engagement} count share_count 似乎保持一些计数而不是分享计数(见: https:/ /developers.facebook.com/docs/graph-api/reference/v2.6/url )。

So far, this is my v2.6 current equivalent: https://graph.facebook.com/v2.6/?id=YOUR_URL&fields=og_object{engagement},share{share_count}&access_token=YOUR_TOKEN Nevertheless og_object{engagement} count and share_count seem to maintain some total count instead of like and share counts, respectively (see: https://developers.facebook.com/docs/graph-api/reference/v2.6/url).

请有人知道如何获取Facebook分享使用API​​ Graph v2.6为给定的网址添加和评论计数?非常感谢提前!

Please does anybody know how to get Facebook share, like and comment counts for a given URL with API Graph v2.6? Many thanks in advance!

最后我报告了一个错误 https://developers.facebook.com 这是回应:

Finally I reported a bug on https://developers.facebook.com Here is the response:


  • 在关系中到Legacy REST API和Facebook查询语言(FQL)正式地,他们将在2016年8月7日之后停止工作。

  • 其次,约计数 share_count ,在Facebook上的共享链接上的任何参与(包括喜欢和评论)都被视为额外的股份,因为喜欢和评论共享链接的人也会产生一个故事为自己的时间表行动。为了进一步说明,我粘贴了当前Facebook工程师的报价:

  • In relation to Legacy REST API and Facebook Query Language (FQL) officially they will stop working after 7th August 2016.
  • Secondly, about count and share_count, any engagement on a shared link on Facebook (including likes and comments) is considered as additional shares, as the people who like and comment on the shared link also generate a story for their action on their own timelines. To illustrate this further, I paste a quote from current Facebook Engineer:

(...)if人A共享链接(例如, http://fb.me/ ),这会生成一个人的A时间线。如果B对这个故事发表了评论,那么反过来又会在B的时间表上产生一个故事。通过Graph API查询 /?id = 然后将返回一个 share_count 为2。

(...) if person A shares a link (for example, http://fb.me/), this generates a story on person A's timeline. If person B comments on this story, this in turn generates a story on person B's timeline. Querying /?id= via the Graph API would then return a share_count of 2.

我希望它有帮助。