3

is there a way with the Graph API or even the old API to get the number of friends (not the list of names, just the count) of each friend of my user? so if John is using my app and John has 3 friends, Stacy , Amy and Bill, I would like to know how many friends Stacy, Amy and Bill have.. I know you can't get the list of friends (only the ones in common), I just want the count.

I don't think the count is private. In fact, even for people who block their friend list, I get a count of how many friends they have on the original email I get when they friend me., right under their name.

  • 1
    You'll find a helpful answer here: http://stackoverflow.com/questions/3527518/how-can-i-count-the-total-friends-of-a-facebook-user-by-uid – oalders Dec 29 '12 at 06:58

2 Answers2

2

Graph API and FQL don't provide this information. It is publicly available without being logged in on alot of users pages by going to https://www.facebook.com/profile.php?id=5 and then scraping it. Although its against the terms of service and isn't available for every user.

bkaid
  • 51,465
  • 22
  • 112
  • 128
0

You can get this information from the Graph API by issuing a request to the /PROFILE_ID/friends endpoint. This will return a list of the user's friends as an array-- which you can count.

Peter M. Elias
  • 1,204
  • 10
  • 22
  • Is it still working? I test it using graph api explorer, but returning exception. – Ari Dec 18 '13 at 11:41
  • I have no idea, have not tested it since then. If you're getting an exception verify you're using an up to date client library and check the Facebook documentation for any notes regarding a breaking change or deprecation notice. – Peter M. Elias Dec 22 '13 at 20:41