Alex Rivera | Logout

Facebook Graph API get all likes from a post

Asked 2012-03-31T11:30:15.940
8

I am very new to facebook graph api, actually I just started today so I might use some help.

My code is working perfectly, I've written a simple algorithm to list people who like a certain post, but the problem is this. Here is the JSON reply I get from graph api:

<br/>
{<br/>
            "likes": {<br/>
            "data": [<br/>
               {<br/>
                   "name": "NAME",<br/>
                   "id": "ID"<br/>
               },<br/>
               {<br/>
                   "name": "NAME",<br/>
                   "id": "ID"<br/>
               },<br/>
               {<br/>
                   "name": "NAME",<br/>
                   "id": "ID"<br/>
               },<br/>
               {<br/>
                   "name": "NAME",<br/>
                   "id": "ID"<br/>
               }<br/>
           ],<br/>
  "count": 22<br/>
},<br/>
"id": "POST ID",<br/>
"created_time": "DATE CREATED"<br/>
}<br/>

so even though there are COUNT:22 Likes, the server returns only 4 names. Is it possible to get all the names? if so, how?

Edit
Report

1 Answer

2

You could do this:

https://graph.facebook.com/'.$post_id.'/comments?limit=0 // for comments
https://graph.facebook.com/'.$post_id.'/likes?limit=0 // for likes

Using facebook graph API . Hope it helps.

=========== Update: Thanks to laviksu

FQL and Graph API limit=0 change Currently, we have a bug where limit=0 returns all results. After the migration period, specifying a limit of 0 in FQL or the Graph API will return zero results.

answered 2013-02-14T06:09:38.323

Your Answer