Facebook Post Insights for personal feed? - facebook

Is it possible to fetch /me/feeds or /me/posts while getting some insights like impressions or reach?
For example, this query will at least give me likes and shares:
/me/posts?fields=likes.limit(0).summary(true),shares
What's missing is something like impressions.
The Graph API Explorer shows me an insights field, but that doesn't seem to work. I found this query that actually executes, but returns no additonal field or info: /me/posts?fields=insights.metric(post_impressions_fan,post_engaged_users)
My goal is to read the personal posts of a user and provide him insights about his reach (like common analysis tools do for Pages). For that, I'd need a handy way to fetch posts along with their insights. If that won't be possible, it's still acceptable to get insights from specific personal posts.
Thank you for any help / advice

Related

Query multiple facebook posts insights

I'm now querying a post's insights with
/$postId/insights/post_impressions,post_impressions_unique
but if I want to have the insights of multiple posts, is there a way to achieve that with a single api call?
I've found that you can query the insights of multiple posts with a GET request like
/insights/post_impressions,post_impressions_unique?<id1>,<id2>,<id3>...
however you can reach the url length limit for GET requests, if someone knows a POST version that works it would be better

Facebook Graph API insights

I'm new on working with Facebook and honestly I found it very confusing, terminology and documentation seems to be very ambiguous in many cases. Can somebody please help me out with a plain english explanation on how I can achive the following?
Post and image to Facebook (on the user page) and then check the stats (insights) of that post.
Till now I have managed to:
1) Create an app
2) Post the image on the user page with the desired message
I'm not able to understand how I can retrieve information about the particular image which was uploaded through my app. I want to know how many people have viewed that image, how many likes did it get, how many times it was re-shared.
Is it possible at all?
I'm posting to /photo not too /feed and I will like to keep it this way if it is possible.
Sorry if this was answered already but I spent a few hours trying to find an appropriate answer but wasn't able to get the right documentation.
UPDATE 1
After having a couple of days off from this topic and receiving the first 2 answers, I took another dive into this. Now I have tried the Graph API Explorer as suggested, and using the ID of a POST I can get some details about the POST, but the insights aren't showing anything, just next and previous.
My goal is to be able to gatther some stats about the pictures uploaded through the app. If this is not possible directly what should be the approach I need to take?
I don't believe a personal /photo has /insights attached to it - the Insights Object documentation page suggests that they do not - but you should be able to get likes, shares, and comments via the API.
It would appear FB has launched a redesign/reorganization of its documentation in the last couple of weeks, but the documentation for the /photo graph object is here -- you will need the user's Access Token, and the API endpoints you're looking for each have links to their own documentation pages there, including example code for each type of request.
Edit (summarizing discussion in comments):
There is no method via the Facebook API to gather insights for all photos posted to individual user timelines via an app. The app can gather likes, shares, and comments for each of those objects individually via API requests, and can make API requests for insights for photos posted to its own timeline. Neither of those options solves the intended use case here.
I'd recommend a solution that uses Sharing rather than an app integration, as this allows for better access to insights on the photos being shared. This is also a much simpler integration, and less brittle wrt future Platform changes. The main tradeoff is that the original photos being shared are expected to expire after a couple of months -- if this is unavoidable, I'd suggest implementing a redirect for requests for expired objects on the site.
We are able to get different kind of photos or picture Using Graph API
like as below:
1.Page Photos
Photos for a Facebook Page.A Page Access Token is required for all methods.Find here
2.Page Picture
Picture belonging to a Facebook Page. Find here
3.Photo
Represents an individual photo on Facebook. Find here
4.User Photos
Photos for a person.Find here
I hope it's helps you.

How to get insights on a Facebook fan page without user login

I'm trying to figure out how to get the total number of comments, posts, likes and fans for any given Facebook fan page and date range using the Facebook API's. I need to be able to do this without the user having to log into Facebook to give the app permissions. This does seem to be possible, as this site is able to do it https://app.conversocial.com/profiler/ .But I don't know how they are doing it.
I've looked into the 'insights' fql table, but this always seems to return empty results. And I've also looked into the 'link_stats' fql table but this doesn't allow a date range to be set.
Does anyone have any idea on how to do this?
You are right. What they are doing is not possible by using the normal Graph API or/and the FQL.
However, Facebook also provides support for two other APIs:
Public Feed API
Keyword Insights API
Access to these APIs is restricted to a limited set of media publishers and usage requires prior approval by Facebook.
I think that they are using the Public Feed API. The documentation of the Public Feed API lists some of the publishers that have been using this API and the site you've mentioned in the question is not in the list. The documentation also doesn't mention anything about getting the Page Insights, but I think it might support this feature (as I see no other way of doing it).
Or, they might be using any other such restricted API which is not yet available to the public and not even documented on the developers website, but is currently in beta/testing phase.
To get the number of fans and the talkabout count, just query the appropriate Open graph ID for the relevant page. For example, for Coca Cola (https://www.facebook.com/cocacola) this is done via
https://graph.facebook.com/40796308305
To get all public infos (Posts etc) use the following request
https://graph.facebook.com/40796308305/feed?access_token={ACCESS_TOKEN}
where {ACCESS_TOKEN} can either be an App Access Token or a personal one. Consider that you can only see public entries.
The ability to query the date ranges is not provided via Facebook ad far as I know. I guess the https://app.conversocial.com/profiler/ application queries each page that is in its index once a day, and saves the results. That's how they're able to provide historical data.
You can try with the following FQL queries or graph API requests for facebook pages,
Graph API
http://graph.facebook.com/nb4cinema
FQL
SELECT name,about,description, fan_count,talking_about_count FROM page WHERE username= 'stackoverflowpage'
In case of FQL tables:
To read the page table you need
no access_token to get public information, or information about public pages that are not demographically restricted.
any valid access_token to get all information about a page that the current session user is able to see.
We have a test fan page. This has poor figures (<10 fans). Statistics are not available due to the lack of fans and likes on that page.
Allthough, conversocial spits out some statistics. They mixed fans and likes to some extent and so my impression is, that they simply parse the page code in order to get what you see.

Facebook: is it possible to get insights of impressions for a specific OpenGraph object?

my app is generating OpenGraph objects for users and I want to give those users analytics for their objects (total impressions, clicks, etc..).
I tried using the graph API to get those insights with https://graph.facebook.com/APP_ID/insights but I don't see how I can filter the results by a specific OpenGraph object.
is it possible to do what I'm looking for?
You can pull, for example, insights data for individual posts as follows:
First, get the list of posts for a page:
/<pageId>/posts
Then for each post get the insights which will look something like this:
/<pageId>_<postId>/insights
Note: It's best to batch call the post insights into one request.

Is it possible to get the share count for a Page post?

I am trying to collect stats on posts published to a Facebook Page. Right now I am able to track the number of comments and likes on a post easily, but shares are eluding me, and I'm wondering if it's even possible yet.
I have checked both the Graph API and the FQL tables and have not been able to find an obvious solution. The graph endpoint "/[PAGE_ID]/feed", as well as the endpoint for a post itself shows comments and likes quite plainly, but nothing about shares. Furthermore, the (undocumented?) endpoint "/[PAGE_ID]_[POST_ID]/insights" provides some fairly mysterious data about post "clicks", but nothing about shares. Finally, the FQL "stream" table again plainly provides data about comments and likes, but not about shares.
It's quite a conspicuous piece of data to be missing, as the share counts for a Page's posts would make for a really interesting, useful metric in third-party social media management software...
It is Available for a Page post and how ever it comes under the insights section. This is the sample url to accomplish the work. Hope this is work and you mush have the necessary permissions and a valid access token.
read_insights : Provides read access to the Insights data for pages, applications, and domains the user owns.
this URL will return a json object which contains number of likes, comments , shares for your post. filter the json and you can get shares.
https://graph.facebook.com/[pageid_postid]/insights/post_stories&access_token=[access_token]
Hopes this will helpful.
You can now access the share count for a post. ie:
"shares": {
"count": 1565
},
Now it's available via insights section