How to get the images of a facebook album using graph API - facebook

I want to get the links of Facebook photos in albums posted from a page that I am managing. I tried to use facebook graph API. I could get the names and ids of albums via "{page_id}/albums/" . Then I tried to use the album id/?fields=photos{link} to get the link. But here it will provide facebook link (eg:https://www.facebook.com/page_name/photos/a.193909724216/193907241065159/?type=3)
But I want to show this images on a page. So I want the real image path. (eg:https://scontent.fcmb1-1.fna.fbcdn.net/v/t1.0-9/38801583_193907078972459378765588463616_o.jpg?_nc_cat=0&oh=6bdfdfc0cc225a1f035295bb2e2a8&oe=5BF8A013).
Can I get them using Facebook graph API?

Related

Facebook Graph API get links and photos

We manage to get a page uploaded photos, or links in separate requests, but we would like to get it all in 1 line, including user photos and links together (public page).
Is there a way to get both in 1 request?
https://graph.facebook.com/id/photos/uploaded Photos
https://graph.facebook.com/id/links Links
If you get the feed of a page, all pictures are very small , and I need a big image :
https://graph.facebook.com/id/feed/
Use the attachments field under the feed connection
https://graph.facebook.com/id/feed?fields=link,attachments

Facebook RestFB publish a post/milestone along with photo to page

I am trying to post a feed on page along with photo,text posts without any error but picture doesnt get uploaded.
Also similar to Milestones it gets posted but how do i attach/upload a photo to it.
I am trying to Post a Milestone on FB using RestFB.
FacebookType publishResult = facebookClient.publish("pagename" + "/milestones",
FacebookType.class,
BinaryAttachment.with("photo", fileToUpload),
Parameter.with("title", title),
Parameter.with("picture", ""),
Parameter.with("description", description),
Parameter.with("start_time", new Date())
-......
But it posts the milestone without posting photo
It appears this is a (deliberate?) limitation of the Facebook Graph API. See Upload image to Facebook Wall / Feed via Graph API
You may post image data directly to a photo album but the feed endpoints only accept image URLs.

facebook graph api retrieve wall photos

How Can I retrieve photos on the wall post., I only know how to get profile picture by using this graph. https://graph.facebook.com/{user_id}/picture but I don't know on wall photos.
It a three step process to obtain all the wall photos of a user
First make a request to obtain list of all the albums (me/albums)
Search the list obtain in first step for album name "Wall Photos"
use the id obtained in step 2 to get list of photos in that album. (356003227794989/photos)
and dont forget to have proper permission to access photos.

Using the Facebook Graph API how can find the most liked photo in an album on one of my pages?

Using the Facebook Graph API how can find the most liked photo in an album on one of my pages?
I have access to the page insights if that can be used.
There are 200 photos in each album so I don't want to do an api request for each photo.
Subsequently you may also find the most commented on.
Here is the code you request:
http://fivespot.me/fblikes.php
$likes = $facebook->api('/'.$picId.'/likes');
However if you are looking to just find out the most liked there is an app already compiled that will do this for you:
http://apps.facebook.com/imanpic/
The Graph API doesnt support querying for an arbitrary set of photos with some criteria. BUT - you can access the Likes object for each Album, which returns a data set representing all the Liked Photos in that Album. You could then just walk that data set and count the number of times you see the same photo Like.
Thus - you just need to issue a Graph API call for Likes sub-object of an Album.
See "Likes" under "Connections" at:
http://developers.facebook.com/docs/reference/api/album/

Is it possible to download all of my photos on facebook through facebook graph api?

I want to download all of my photos and albums from facebook in a programatic way.
I know its possible to push photos to fb through graph api. I was wondering if it is possible to pull photos as well.
Yes. First you would have to get all the albums:
https://graph.facebook.com/me/albums?access_token=
Then you would have to request the list of photos in each album:
https://graph.facebook.com/album_Id_here/photos?access_token=
The result of the last request will give you a JSON object that contains urls of each photo in the album.
See the documentation here: http://developers.facebook.com/docs/reference/api/