I'm working on updating project from old FQL to graph api 2.2 and i dont have idea how to get likes count on specific link, their documentation is not very transparent for me(i'm beginer). I believe it shoud be something like this: https://graph.facebook.com/v2.2/?id={myURL}/{some fields like like_count}
but i have no clue how to do it right using graph API. I will appreciate any help.
Asked
Active
Viewed 1,159 times
-1

Sajdzi
- 3
- 5
1 Answers
1
Well, the docs are quite clear I think:
There is NO like count on the /?id={url}
endpoint! A sample call would be
GET /?id=http://mashable.com/2015/02/17/10-minute-rule/
Response:
{
"og_object": {
"id": "664547577004455",
"description": "Three tips for making the 10-minute rule work for you.",
"title": "A 10-minute timer could revolutionize your productivity",
"type": "article",
"updated_time": "2015-02-17T13:55:11+0000",
"url": "http://mashable.com/2015/02/17/10-minute-rule/"
},
"share": {
"comment_count": 0,
"share_count": 180
},
"id": "http://mashable.com/2015/02/17/10-minute-rule/"
}
If you just want the share count, use
GET /?fields=id,share&id=http://mashable.com/2015/02/17/10-minute-rule/
Response:
{
"id": "http://mashable.com/2015/02/17/10-minute-rule/",
"share": {
"comment_count": 0,
"share_count": 180
}
}

Tobi
- 31,405
- 8
- 58
- 90
-
ok so there is any way to get, all the info that i could from fql? for example `$fql = "SELECT url, normalized_url, share_count, like_count, comment_count, "; $fql .= "total_count, commentsbox_count, comments_fbid, click_count FROM "; $fql .= "link_stat WHERE url = '" . $url . "'";` Thanks for anwser! – Sajdzi Feb 17 '15 at 14:37
-
Damn you facebook! But anyway, you helped me alot Tobi! – Sajdzi Feb 17 '15 at 14:41
-
Normally, the OpenGraph object should have a `likes` edge, but for the example it shows no data: https://developers.facebook.com/tools/explorer?method=GET&path=664547577004455%3Fmetadata%3D1&version=v2.2& – Tobi Feb 17 '15 at 14:47