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

前端 未结 6 1051
[愿得一人]
[愿得一人] 2020-12-14 10:52

The problem is that after v2.1 of graph api fql will be deprecated.

Can someone tell me how to get separate likes, share count for given url using only graph api? I

6条回答
  •  自闭症患者
    2020-12-14 11:45

    All answers are wrong or incomplete since latest shut down of API 2.1!

    I am the author of the social media plugin MashShare and i recently had to do exact observations for this issue as it seriously affected the share count of our plugin.

    Verified data by observations:

    https://graph.facebook.com/v2.7/?id=https://www.mashshare.net contains shares and likes.

    As far as i found out the only way to get a number near the real share count of a post is to get first the likes of a url. Than take this number and subtract it from the total number of shares and likes.

    To get the like count you need to take the object id of the url and create another API request: https://graph.facebook.com/v2.7/14206851986099/likes?summary=true

    If you know how to merge both requests into one please let me know.

提交回复
热议问题