While developing a Facebook application I got the friendlist of a user by
$friends = $facebook->api(‘/me/friends’);
But I only got to know the name and Facebook Ids of the friends : http://developers.facebook.com/docs/reference/api/FriendList
Is there any way to get the gender of a friend?
One way to do so is to get the user’s gender (since it is publicly available) given the user’s facebook Id (which I have got using the friend list)
Is it really possible to do the above thing.
If not is there any other way?
for reference : http://developers.facebook.com/docs/reference/api/user
http://developers.facebook.com/docs/reference/api/FriendList = a persons fiend lists (plural) – eg: Limited Profile
What you want to do is get the ID from graph.facebook.com/me/firends and then do a graph.facebook.com/ID for the gender. But of course that ends up being a lot of requests if you need it for all of their friends.
For those cases you can use FQL query: http://developers.facebook.com/docs/reference/fql/
You can adopt following query from their documentation:
Here name and gender of the current users friends: