Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

facebook graph api picture

How can I retrieve friends picture using graph api. I have manage to get my friends profile picture using this

https://graph.facebook.com/{user_id}

But, I want to get the photos my friend has posted.

I am able to get this data

"link": "http://www.facebook.com/photo.php?fbid=121312&set=a.23342344855.11344514&type=1",
     "name": "~KAALAM moments :)",
     "caption": "51 new photos",
     "icon": "http://static.ak.fbcdn.net/rsrc.php/v1/yz/r/StEh3RhPvjk.gif",
     "actions": [
        {
           "name": "Comment",
           "link": "http://www.facebook.com/1140004514/posts/12234"
        },
        {
           "name": "Like",
           "link": "http://www.facebook.com/1140004514/posts/12234"
        }
     ],
     "type": "photo",
     "object_id": "2554798026153",
like image 257
Robin Carlo Catacutan Avatar asked Jun 04 '26 07:06

Robin Carlo Catacutan


1 Answers

To get your friend's pictures you will need

  1. Valid access token with friends_photos
  2. HTTP GET \{friendId}\photos to get photo's the friend is tagged in

or

  1. Valid access token with friends_photos
  2. HTTP GET \{friendId}\albums to get a friend's albums listing, loop thru it to get the photos in each album by \{albumId}\photos

Try it out here: https://developers.facebook.com/tools/explorer

like image 55
DMCS Avatar answered Jun 05 '26 20:06

DMCS



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!