what is maximium limt of likes and comments data of a post that i can get using graph api?

211 Views Asked by At

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.

1

There are 1 best solutions below

3
Hupfauer On

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}