Is there any way to pickup stats for video or photo facebook object (not youtube videos shared on facebook)?
Stats like:
views
shares
likes
I've tried here: https://graph.facebook.com/817129783203 but with no luck.
Any ideas?
Thanks in advance!
M.
As far as I know, you can't access the number of photo/video views. However, in your case, likes may be accessed by querying:
https://graph.facebook.com/817129783203/likes.
Facebook Query Language (FQL) doesn't support COUNT, so you need to get likes number by counting the number of returned results (realized by an external method).
Related
I know how to query the social engagement counts for a regular website. It can be pretty easily achieved with the facebook graph explorer (https://developers.facebook.com/tools/explorer/) or throug api's. As path I supply the url of an object, e.g. an website e.g. https://developers.facebook.com/tools/explorer/?method=GET&path=http%3A%2F%2Fwww.manuelfink.de&version=v2.0
However if I try the same for a youtube movie https://developers.facebook.com/tools/explorer/?method=GET&path=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DBpxVIwCbBK0&version=v2.0 it allways returns me the shared count of https://www.youtube.com/watch.
Is it possible to get the facebook shared/likes count for an youtube movie?
Thx, I really appreciate your help!
For share and like count, I think you can find an answer in the following questions on SO:
Get top videos on facebook/twitter, which is based on
How do you get the total likes for a URL (Likes and Shares)?, and
How to get share counts using graph API. Remember that a Youtube video has more than a possible url, so you may have to make several queries with different urls for the same video. I am not sure you can get the comments, but you can try with how can I get all comments from a url in facebook?
I'm having return issues with graph API and I'm wondering if any knows why or how I can fix it.
I need to download all photo data for a given user (friend data, not the active user). Here are the two things I have tried.
FQL: "select pid from photo where subject=friend_uid"
Graph: "friend_uid/photos?fields=picture,created_time,tags.fields(name,id)&limit=1000"
I have friends_photos and user_photos permissions.
Any users with > 1000 tags will have drastically reduced result numbers.
For example, it will only return around 200 photos or so which is not acceptable, I need all of them
Chunking with since/until (or created_time < or > __) as well as limit clauses only improves the result count with FQL but the amount of chunking makes it VERY inefficient.
Any ideas? The tag data is also important for my purposes.
So, I need the proper query or sequence of queries to obtain ALL tag data for all photos of a given user_id using either FQL or graph-api.
I recently created a similar project (pulls all the photos from all your facebook friends in order) in PHP. Facebook's limits are poorly documented but I found that with the Graph API, it's 400 photos the friend is tagged in and 5000 photos the friend uploaded per request. Note that pulling from {user}/photos only pulled photos they are tagged in, while {user}/photos/uploaded only pulls photos that {user} uploaded. I figured that that 400 tagged and 5000 uploaded photos was enough for my situation.
If you do need additional photos, you will have to check the number of returned photos for the user for the /photos request and check if it's equal to 400. If so, you will have to go on to the next page, recursively.
For the /photos/uploaded request, Facebook uses cursor-based pagination (see bottom of this page), which means that pagination->next and pagination->prev data is only sent when there are more values to return. This makes it fairly easy to get the next page (once again you will have to do this recursively).
When pulling photos from a Facebook album via the graph API, i.e.
https://graph.facebook.com/<albumid>/photos?access_token=<token>&limit=999&fields=name,source
For some albums, it only supplies partial results. For instance, an album with 15 photos may only return 13 photos. This call:
https://graph.facebook.com/<albumid>?access_token=<token>&fields=count
...Indeed returns the proper count of 15. My first thought was that perhaps these 2 "missing" photos have more limiting privacy settings, but every photo in the entire album (which is owned by the owner of the token, incidentally) has the same "visible to friends" privacy setting. Most albums do return all photos, as expected.
Any ideas as to what might be causing this behavior?
I was missing 4 photos of 33 for one of my albums. I added 'user_status' to the permissions and it suddenly works.
Instead of the cause of why it happens, I am suggesting you a workaround. Graph api is well known for returning partial results. (You can search for that, and you get hell lot of such issues.)
why not go the FQL way?
Checkout :https://developers.facebook.com/docs/reference/fql/photo/
You can get the id, or direct images links of the pictures in an album in a single query.
Sample : SELECT src_big FROM photo WHERE aid="20531316728_324257"
This returns the url of biggest version of the pictures inside the album.
This should probably solve your problem as long as you are using a user access_token and not app access_token.
I am trying to achieve similar functionality to the one shown here...http://blackmilkclothing.com/collections/leggings/products/circuit-board-grey-leggings
there fan page https://www.facebook.com/blackmilkclothing allows people to hash tag a photo and then populate it on their website like the link above.
Loading a series of tagged images from my facebook fan page to my website. I am not positive how this is acheived? I am assuming some kind of api process but any help in the right direction would be appreciated.
Thanks! All help is appreciated
See the 'tagged' connection of a Page in the Graph API: https://developers.facebook.com/docs/reference/api/page/
It returns a list of objects the page is tagged in, including photos
If you need background knowledge I suggest these links in particular:
Graph API overview: https://developers.facebook.com/docs/reference/api/
Page login: https://developers.facebook.com/docs/authentication/pages/
After a good bit of trial and error I've found the most efficient way to query photos tagged to a particular Facebook page is to use Facebook's FQL interface to retrieve a list of stream posts.
With FQL you can limit the queried objects to only those posts containing images (unlike with the higher-level Graph API calls which will return all posts, many of which may not have associated photos), and you'll also have more granular control over composition of the result set.
Keep in mind that Facebook doesn't have true hashtag support (only Facebook pages can be tagged), so to simulate the hashtag support that Black Milk Clothing encourages, you'll need to parse and filter the photo message text yourself.
As an alternative quick and easy solution, I've rolled the results of my efforts into a free online service called TagTray -- with TagTray I've added an interface for building and curating hashtag based galleries from Facebook, Instagram, and TwitPic (including application-level Facebook hashtag filtering) that can be framelessly embedded into a site with a few lines of JavaScript.
I was about to get the facebook video shares. I have tried the below URLs for getting the share counts, it seems to be giving the URL share counts instead of the actual video sharer counts.
https://developers.facebook.com/docs/reference/fql/link_stat/
(and) using Graph API
For example:
The below video has video share counts as 384 as of Mar29 2012
https://www.facebook.com/video/video.php?v=23155051776
But the above methods are giving the share counts as either 1 or 5. Please let me know the way to get the video sharer counts using API methods.
Thanks in advance.
This is currently not possible, you should add your voice to the feature request bug here:
https://developers.facebook.com/bugs/289679207771682