Search code examples
facebook-graph-apilimit

Limit number of likes / comments returns with graph facebook API


I want to extract ALL likes and comments from my facebook fan page

I'm wondering if there's a limit for the number of return ? Because for the moment there is the pagination limit (25) and before going further, I want to be sure that I can extract all likes/comments on a specific post.

I've search a lot in the Graph API's doc but it's not clarify the situation...

Thanks by advance for your help


Solution

  • You can set a higher limit:

    /post-id/likes?limit=100
    

    But you will never get ALL of them in one call, you have to use pagination to do that (for example, with a recursive function): https://developers.facebook.com/docs/graph-api/using-graph-api#paging