facebook-cli icon indicating copy to clipboard operation
facebook-cli copied to clipboard

How to get all posts in a FB Page

Open doggy8088 opened this issue 5 years ago • 1 comments

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"

doggy8088 avatar Jan 31 '19 04:01 doggy8088

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.

specious avatar Feb 13 '19 00:02 specious