Reputation:
I'm new to facebook graph API. I'm able to read posts of a facebook public page using GET method, by passing an ACCESS TOKEN.
https://graph.facebook.com/pageid/posts?access_token=myaccesstoken
I want to get posts of multiple pages, how do I achieve this?
Is there an option to make a multiple page request using GET method?
I want to show posts from multiple pages in the order they are posted (sorted by time). Please suggest a good way of doing it. Thanks in advance.
Upvotes: 3
Views: 1355
Reputation: 7793
Even though you can use https://graph.facebook.com/posts?ids=255057814552667,184572924024 to query multiple pages, but the pages doesn't mix and sort by date.
So, you should use FQL instead, for example:
{"query1":"SELECT type,post_id,created_time,actor_id,target_id,message,attachment.media,attachment.caption,attachment.name,attachment.description,attachment.fb_checkin,likes.count,likes.user_likes,likes.can_like,comment_info,description FROM stream WHERE source_id IN (255057814552667,184572924024) AND created_time<now() ORDER BY created_time DESC","query2":"SELECT id,name,pic FROM profile WHERE id IN (SELECT actor_id,target_id FROM #query1)"}
Both 255057814552667 and 184572924024 is the example page id.
FQL documentation: https://developers.facebook.com/docs/technical-guides/fql/
Upvotes: 2