Facebook – How to get friends likes via Facebook API

facebookfacebook-fqlfacebook-graph-api

Is this possible to get all my friends likes?? Now, I'm getting this by 2 steps:

  1. Getting all my friends list
  2. By iterating those list I'm getting all individuals Likes,

but it seems very big process, anybody have idea to improve the performance for this task?

Best Answer

At last I found it after 2 weeks looking at Facebook API documentation

FB.api("/likes?ids=533856945,841978743")

FB.api("me/friends",{
  fields:'id',
  limit:10
},function(res){
  var l=''
  $.each(res.data,function(idx,val){
     l=l+val.id+(idx<res.data.length-1?',':'')
  })
  FB.api("likes?ids="+l,function(res){
      console.log(res);
  })
})