facebook-cli
facebook-cli copied to clipboard
How to get all posts in a FB Page
I tried to fetch all posts in a FB Page but only first page feeds/posts returned. How can I get all the posts in a FB Page if I am a manager of that Page?
facebook-cli api "{page-id}/posts"
According to the API documentation (https://developers.facebook.com/docs/graph-api/reference/v3.2/page/feed), there are several related graph edges available, including page-id/feed
and page-id/posts
.
For an application that wasn't officially reviewed and approved for the Page Public Content Access Feature, you can only retrieve this information for a page that you have the manage_page
permission for.
For example, as an administrator of https://fb.me/killingmosquitoes, I'm able to retrieve this list of posts in JSON format by running:
facebook-cli api killingmosquitoes/posts
However, if this page had more than a hundred posts, it looks like I wouldn't be able to retrieve all of them.