Share Facebook / Like / Comment URL

Until today, I have used the following URL to get a Facebook account / as / comment URL:

https://api.facebook.com/method/links.getStats?format=json&urls=http://stackoverflow.com/

Today, Facebook removed this feature. So now I use this:

https://graph.facebook.com/v2.7?emc=rss&fields=og_object{engagement},share&access_token=<ACCESS_TOKEN_GOES_HERE>&id=http://stackoverflow.com/

What outputs:

{
    "og_object": {
        "engagement": {
            "count": 45267,
            "social_sentence": "45K people like this."
        },
        "id": "10150180465825637"
    },
    "share": {
        "comment_count": 12,
        "share_count": 45267
    },
    "id": "http://stackoverflow.com/"
}

The problem is that share_count- the total number of liked + comments + shares (as far as I know).

Is there a way to get the number of likes, comments, and shared resources separately ?

+4
source share
2 answers

Looks like an error in fb-api.

My decision:

  • get the number of shares / comments that you describe in your question using

    graph.facebook.com/?fields=og_object {id}, share & id = /fooobar.com/...

  • /

  • fb object-id url

    og_object- >

  • get likes count with ( 1000, ):

    graph.facebook.com/OBJECT_ID/likes?access_token=ACCESS_TOKEN&pretty=1&limit=1000

UPD 2016-08-22

, /reposts/comments :

https://graph.facebook.com/?fields=og_object {likes.limit(0).summary(true)}, share & ids = http://google.com,http://twitter.com

+10

. Facebook // URL- shared_count. //, API . , .

Rest API, , 18 .

Facebook, , : Facebook, URL API Graph v2.6

Facebook, , : https://developers.facebook.com/bugs/748651458568287/

+1

Source: https://habr.com/ru/post/1651726/


All Articles