Obtaining Facebook graph api data for user generated posts - facebook

I am having some trouble determining how to go about a certain issue. I am pretty new at trying to obtain social media data. Say an internet user publishes something that is essentially a post from from a website that is external to Facebook, to the user's Facebook feed. Is there a way to obtain the amount of likes, shares, comments, and other insight type data from those posts? I'm aware/currently learning about Facebook's open graph api, but I am unsure if it allows for this type of query. It seemed to be primarily for people, pages, and places, and I have not found a way to query only posts from a website specifically.
To be more detailed, a user will have the option of posting a jpeg type image to their Facebook feed. This is for a single website, where the website would like to do this in order to gauge how those posts are being perceived and interacted with by other Facebook users. Is there a way to obtain data on these specifically?
Also, if so, is there a way to tag or apply specific identifications to categories of these posts in some way before they are posted by the user to their feed, to allow for segmentation of the data? Any help is very much appreciated.

Related

Subscribe via webhook to a Facebook user's Activity Feed?

I'd like to use the GraphAPI and Webhooks to subscribe to a user's activity feed and extract information such as metadata and stats about the shared posts they like. (Yes, I am well aware of the privacy concerns and this will be handled extremely carefully.)
The closest question I could find is here:
Extract Links from Facebook activity feed
The other answers are not relevant, as they either discuss the old FQL or plugins or are specific to Pages.
I've been reading the GraphAPI documentation and the User Likes information only relates to the Pages they like (which doesn't change much). So this is a subset of the info needed - I need likes for Posts, not just Pages.
What I am really interested in is the objects to which a given user has reacted. You can easily see the reactions for everyone to a given post with a GET /v2.8/{post-id}/reactions HTTP/1.1 call. But this is "reactions by post" and I need "reactions by user".
The best solution I can figure out so far is to subscribe to their feed with a webhook and then collect a list of object IDs and then subscribe to their reactions for a certain period and filter by the user. This is not ideal or very efficient as it requires a fair number of subscriptions, and also only accounts for posts in the user's feed and not other posts they might have stumbled upon via some other means.
So - how to extract all User Like info?

Get impression or hit statistics on Facebook feed posts

Is there any way to get figures on the number of impressions, hits, or number of users that a particular Facebook post that is not part of a Page has been seen by?
To paraphrase, let's say that I make a post on my personal Facebook account, can I use the API (or another method) with my own access token to look up how much visibility this post has received?
The Insights APIs seem to be restricted to posts that are on a "Page", which from what I can see is distinct from a user's personal profile or feed.
Exactly, post insights are available for page posts only.
There isn’t a similar thing for posts on user timelines.
(If you are sharing content from your own domain, then Domain Insights might be able to give some data.)

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.

Get user's detailed newsfeed(wall) posts in Facebook

I would like to build a project to know users' behavior when they surf facebook website, especially the advertisements showing in their timeline wall. I have learned the basic idea of facebook graph api, knowing how to access the users' information and their feeds. However, I found that the feeds returned by facebook graph api is not "exactly" what user really see when they open facebook url in their browser. First, in graph api, it doesn't show the advertisements posted by sponsors. Second, the feeds returned by facebook api seem only regarding to my own posts(e.g. the photo tagging me, the posts tagging me). So, I would like to know how to access these information to rebuild a testbed that looks like exactly same as the real facebook website to record people reaction to it and continue my research?
Any idea is welcome ^^
This isn't really possible or rather I don't know any API (Facebook/Twitter/etc) that would do this to their third-party developers. The point of the API is to pull user data, not ads.
Also it sounds like you are using /me/posts or/me/feed instead of /me/home