0

I'm Working on the getting the total number of likes and comments of post ? using graph api 2.5 !! I'm able get only 1000 likes of the post.the post contain more than 1000 likes.How can I get all the likes? even I tried keeping the limit with 10000 Then also I'm getting only 1000 likes.Can any one of tell the maximum count limit.

Dilip Bobby
  • 323
  • 5
  • 15

1 Answers1

2

If you do not need to get the reference to the people who liked it you can go with the endpoint:

v2.5/{object-id}/likes?limit=0&summary=true

This will return the data array empty and add a summary to the end of the response string:

"summary": {
"total_count": 78476,
"can_like": true,
"has_liked": false
}

To get all likes query:

v2.5/{object-id}/likes?limit=1000

the response will contain an array of "id", "name" sets of the "likers". Beneath this you will find the paging array with the "next" element. There is the full query url provided for a new api call. If you use a SDK there is also within the paging array the property after. Just add this to the next call, like

v2.5/{object-id}/likes?limit=1000&after={after-parameter-from-call-before}
Hupfauer
  • 591
  • 1
  • 4
  • 15
  • thank you for the answer but I need the people who liked or commented on a post @Markus Hupfauer – Dilip Bobby Jan 20 '16 at 09:10
  • can i get the id's of the all the liked persons?@ Markus Hupfauer – Dilip Bobby Jan 23 '16 at 09:12
  • @DilipBobby Kind of. You may miss some, depending on privacy settings, but with the described solution above you can get all the id's of persons who liked the object – Hupfauer Jan 23 '16 at 15:01