如何从Facebook Graph API获取份额?

时间:2016-05-13 05:27:39

标签: python facebook facebook-graph-api

我正在寻找一种方法来使用Facebook Graph API获取帖子(而不是网址)的份额。我能够使用FQL做到这一点,但看到它将在8月份被删除,我正在寻找一种非掠夺方式来实现它。

我是新手,非常感谢任何帮助。我在python上使用图形API。

我看到以下几页:

  1. How to get share counts using graph API

  2. Can i get lots of share counts using facebook graph API? And how to do it

  3. Using Facebook Graph API 2.2 to get like and share count

  4. How to get facebook share, like, comment count for a url with graph api only (in a non-deprecated way)

  5. 然而,我找不到适合我的方法。请帮忙。

1 个答案:

答案 0 :(得分:1)

看看我的回答

您应该可以致电

/?fields=id,share,og_object{engagement{count},likes.summary(true).limit(0),comments.limit(0).summary(true)}&id=http://www.google.com

返回类似

的内容
{
  "id": "http://www.google.com",
  "share": {
    "comment_count": 2,
    "share_count": 31135003
  },
  "og_object": {
    "engagement": {
      "count": 31135003
    },
    "likes": {
      "data": [
      ],
      "summary": {
        "total_count": 87935,
        "can_like": true,
        "has_liked": false
      }
    },
    "comments": {
      "data": [
      ],
      "summary": {
        "order": "chronological",
        "total_count": 1323,
        "can_comment": true
      }
    },
    "id": "381702034999"
  }
}