How do I retrieve the posts on a Facebook page using the Facebook's Graph API? - facebook

I'd like to use Facebook's Graph API to retrieve the official posts from a given page. This means that the wall posts must be the one's made by the page's administrators and must exclude comments made on the posts. I'm aware that the base URL for the Graph API is http://graph.facebook.com/, but I'd like to use it without an access token. Is there anyway to do this?

No. You can't retrieve the posts using a given page without an Access Token.
You can retrieve posts by performing a GET request to the following end point (and of course using a valid Access Token):
https://graph.facebook.com/{page-id}/posts?access_token=YOUR_ACCESS_TOKEN
You can also choose particular field(s) by specifying them in the URL. For example:
https://graph.facebook.com/{page-id}/posts?access_token=YOUR_ACCESS_TOKEN
&fields=message,type,likes
You can try out this example in the Facebook Graph API explorer.

Related

How to get type of profile of a post owner in Facebook Graph Api?

I am retrieving posts using facebook api. Adding a field from gives the detials of post owner. But according to Documentation (https://developers.facebook.com/docs/graph-api/reference/v2.9/profile) the profile may be a user/page/group. How can i get only the posts by page in the same api call.?
Unfortunately, this is not possible for posts request. Usually it is done by using "filtering" parameter. But as per documentation https://developers.facebook.com/docs/graph-api/reference/v2.9/page/feed, "filtering" is deprecated for this request.

How to get news feed exactly how it appears in facebook homepage newsfeed using api

I am using /me/feed and /me/home to get my feed and my homepage feed respectively.
But the /me/home only shows updates from my friends. I am following many people but not friends with them. My facebook homepage shows all the updates including my friends and the people I am following.
How to get the news feed exactly like the one appears in the fb website?
As #Fabio said, the Graph API does not support it as of now (and I don't think it'll do that in the future). You can only obtain yours and your friends' feeds using the Graph API.
In order to obtain the feeds from a specific person who's not in your friend list, you need a valid User Access Token from that user with a read_stream permission.
There is however a way to read the public feeds of user status updates and page status updates as they are posted to Facebook. This can be done by using the Public Feed API. This will include all feeds that have their privacy set to ‘public’ are included in the stream. Also, you cannot apply to use the API at this time as its access is limited. Its page says:
Access to the Public Feed API is restricted to a limited set of media
publishers and usage requires prior approval by Facebook. You cannot
apply to use the API at this time.
But I think it's just a fancy way of saying that this API is not free and you'll be charged few dollars (which you can find out by getting in touch with someone at Facebook) for using this service.

Open Graph insights for specific post

We have a Facebook Application with custom Open Graph objects and actions.
We then use a App Access Token to post stories for a particular user from our backend with the normal Open Graph REST API. After the post-call succeeds we log the returned "id" of that post.
Now we would like to collect insight data (e.g. post_impressions_unique) for some of these individual posts/stories using the logged id's.
According to https://developers.facebook.com/blog/post/573/ we should be able to do something like:
https://graph.facebook.com/[POST ID]/insights
Even though this call seems to work using our normal App Access Token, no insight data is returned for the post/story.
Does anyone know if this is possible and how to do it?
We have been experimenting with a normal User Access Token and the "read_insights" permissions, but with no luck. I have read some similar questions but mainly regarding page-posts (this is an App Open Graph post/story).
EDIT:
The facebook article above only refers to "Page" posts. I'm looking for analytics on individual Facebook App Opengraph Posts/stories. It seems difficult to find any good information about this, has nobody attempted this with any success?
You must add insights into a permissions/Extended permissions
Article :
Getting Page Insights
In order to obtain Page Insights via the Graph API, you must use a Page access token, and you must have the read_insights permission. Click on the link below to see this working in the Graph API Explorer.

Is it possible to get the age of a Facebook Page using their APIs?

I would like to find out when a Facebook Page was initially started.
I can access the Page's data through Facebook's REST API or Graph API and I can ask the Page's admin user to grant additional permissions if necessary.
Is the Page's start date available? Which methods of the API should I use for this? Which permissions are needed to get this information?
According to the official documentation here: http://developers.facebook.com/docs/reference/api/page
there is not a method to retrive when the page was initially started.
You may try to retrive all the posts and look at the oldest one! (using pagename/feed for the page, in case you are using Graph API).

Accessing Facebook Likes and Interests with the old rest api

In their recent changes, Facebook now links your likes and interests with community and fan pages. How can I retrieve this information using the old rest API and Facebooker. I tried things like this to get the music preferences :
facebook_session.user.music
but I get a blank string instead of the relevant connections. Is it mandatory to use the new Graph API in order to make this work?
I believe this data can only be accessed via the Graph API.