Jay West
Jay West

Reputation: 177

Limit page news feed to grab JUST page's posts

I'm using the facebook graph api to grab the news feed off a page using /username/feed?limit=20 -- is there an argument like the limit to just get their posts instead of including posts from fans?

Currently, I am able to call with this:

require_once "facebook.php";
$facebook = new Facebook(array('appId' => 'xxx','secret' => 'xxx'));
$fbstatus = $facebook->api('/pagename/feed?limit=20');

but it shows all of the page's posts including fans

Upvotes: 2

Views: 1696

Answers (3)

jeremylach
jeremylach

Reputation: 75

Try https://graph.facebook.com/{user_id}/posts

That will give you the posts of that page instead of all the posts in their feed from all users.

Upvotes: 1

Michael Schwark
Michael Schwark

Reputation: 402

I don't quite understand. You first need to make sure you have an access token generated for the very site you want to read. Instead of reading the feed which returns all activity including especially the sharing activities you need to call "statuses" referring to the facebook documentation. The feed always includes public posts by fans made to the page. I therefore assume your problem is to define exactely what data you want to show.

Upvotes: 2

DMCS
DMCS

Reputation: 31870

With the Graph API just call /pageid/statuses?limit=20&access_token={ValidPageAccessToken}

Upvotes: 0

Related Questions