I have a quick question for the Facebook Guru's here.
A couple of years back I have written a facebook app that retrieves the amount of likes assigned to a photo. At the time, I was surprised to find out that neither FQL nor the Graph API returned accurate like counts at the time.
Now, I have been asked to develop a photo contest where people can vote on a few photo's to pick a winner. This contest is supposed to run on a Facebook page, as a facebook app and I'm trying to evaluate if I can use facebook's likes as voting mechanism.
I figure since Facebook's API changes rather often, maybe they have resolved the accuracy problems by now. I tried digging around in facebook's developer documentation, but I could not find if any of the current Facebook API's return accurate like counts on user submitted photo's.
Does anyone know if FQL or Graph API are currently able to provide accurate like counts for user-submitted photos?
I can't attest to accuracy but a Photo's 'likes' connection can be queried generating alist of likes as per the documentation. See example call below.
https://graph.facebook.com/10151509108346729/likes?access_token={any_valid_access_token}
Related
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.
I am developing an app that processes <used_id>/posts connection to read the posts a user have made and count the likes and comments that have been received.
Yesterday I noticed that Instagram photo posts do not appear in posts connection. After a little search I found this Posts from Instagram not showing up on Facebook Open Graph API after which I was able to see Instagram photos in Feed connection if permission user_actions:instapp was added (or friends_actions:instapp for friend posts).
But two problems remain:
1) The posts still do not appear in Posts connection, which is more convenient for usage in my case because I am not interested in Posts of other users which may appear in Feed.
2) Even if I use Feed connection the posts do not have Likes field filled, does not matter whether I specify it directly or not. I assume that the same goes with Comments. Therefore in my case Feed is also useless because I need Likes data.
The only solution that works is by using <user_id>/instapp:take - there I get all photos also with Likes. So I might use it, but the trouble is - then I need to do double API call, because Instagram posts are not the only in which I am interested in (I still need to call <user_id>/posts).
I have submitted this bug report: http://developers.facebook.com/bugs/131821543664928
Perhaps someone has an idea for a better solution than calling instapp:take?
Thanks!
I am in the process of creating an app, and one of the pieces of data that I need is the time when a user made a certain friend. So for example do an FQL query where I return the Uid of the friend and the timestamp (date, time) of when that friend was added. I preferably want to do this for all friends of a user.
I have looked through the FQL documentation but wasn't able to find anything about time (other than friend_request but that is only for pending friend requests) and I can't seem to find anything in the Open Graph API either. Any help pointing me in the right direction would be really appreciated.
I have gone through many facebook forums, facbook bug reporter, facebook blog and facebook developers docs. And came to conclusion.
Currently Facebook doesn't provide either time a friend request made or the time a friend was made(friend request is accepted). It comes under facebook privacy policy.
With the Facebook API are only recent things (wall posts, friends status updates etc) obtainable or is everything ever associated with the user's account obtainable?
That's a tricky question.
First nowhere in the official documentation says how many items you can get from Graph API nor FQL.
Not only this. Also when trying to do normal recently querys you may find out that not every result is returnes. Nor from the Graph API, FQL, not even from the FQL Test Console.
All this is because serious bugs in the Facebook Platform.
On october 15 Facebook said in its blog
We have received a great deal of feedback recently about things we should do to improve Facebook Platform. The themes are clear: “fix the bugs,” “update the documentation,” “talk to us more,” and “make things more reliable.” We are listening, and this post outlines some of the things we are doing to address your concerns.
This means that they are now fixing the bugs that has been accumulated on many months in Facebook Bug Tracker.
One of the open Bugs in there says:
When using a FQL Query or utilizing the new Graph API to grab posts on a users
stream, not all posts are returned.
From what I can see, the system will grab the latest posts from within the last
month, and then becomes extremely spotty after that. I am able to grab posts
from myself up to 4/24/2010, at which point every single wall post I have
posted seems to disappear.
Many other developers have states the same thing under the comments of this Bug.
On 2010-09-27 Jeff Bowen (Developer from facebook) said the following
Hi all, we still need to add this to the documentation but the stream table is
limited the last 30 days or 50 posts, whichever is greater. Sorry this wasn't
previously published.
This have made many people upset since they assumed you could get everything from the Graph API.
Anyway this is for multiple results. If you want a single result apperently (from the commnets in thts bug) You could go as far as June 15 2009
Personally, I haven't tested yet again so I don't know if this actully works the way they say. Facebook Graph API is in constant change. It has been incomplete and buggy since the begining. But now Facebook says they are working on that.
I recommend every facebook developer to sign up for the Facebook Platform bug tracking system since there is a lot of not official things about facebook, that will impact your applications.
I'll keep an eye on there to see if more is said on this topic and update this answer if needed
I've noticed that using the new Facebook Graph API to fetch friends of users returns a number of friends that is close to, but not always exactly, the number of friends displayed on the user's profile.
Documentation here: http://developers.facebook.com/docs/api
For example, on that page, I click on https://graph.facebook.com/me/friends, and see the JSON for 477 friends, whereas my profile page on facebook shows a count of 478.
Does anyone know why there is an inconsistency?
If you have friends that have opted out of the Facebook Platform, they will not show up in the API response.
After being frustrated by inconsistent friend count, I asked a former Facebook engineer about it. It's a known bug related to their usage of memcached, and is considered too expensive, difficult, or otherwise not worthwhile to fix for now.
My two penneth: I've noticed that the number of friends which is displayed in my profile fluctuates (by 1)! I don't know what the reason for this inconsistency is but I suggest you keep checking that number in your profile regularly and see whether it's the case for you as well.
In terms of the Graph API the discrepancy between the friend count in my profile and in the data returned by the API is 2.