Facebook like count url

后端 未结 2 932
滥情空心
滥情空心 2021-01-17 05:21

As Facebook changed their API and deprecated the old one, I need to get data (likes count, share count, comment count) about single pages.

I figured out how to get

2条回答
  •  一生所求
    2021-01-17 05:48

    The API Explorer adds the Access Token automatically, but you have to add it manually in your URL:

    https://graph.facebook.com/?fields=og_object{likes.limit(0).summary(true)},share&ids=http://www.businessinsider.com/airlines-dont-disclose-carrier-fee-that-inflates-ticket-prices-2016-9&access_token=xxx
    

    Result:

    {
      "http://www.businessinsider.com/airlines-dont-disclose-carrier-fee-that-inflates-ticket-prices-2016-9": {
        "og_object": {
          "likes": {
            "data": [
            ],
            "summary": {
              "total_count": 0,
              "can_like": true,
              "has_liked": false
            }
          },
          "id": "949055545223224"
        },
        "share": {
          "comment_count": 0,
          "share_count": 346
        },
        "id": "http://www.businessinsider.com/airlines-dont-disclose-carrier-fee-that-inflates-ticket-prices-2016-9"
      }
    }
    

提交回复
热议问题