Search code examples
ruby-on-railsfacebook-graph-apikoala

Find out if a user is friends with exactly one other user using Graph API


I'm trying to find out if User A is friends with User B but I don't want User A's entire list of friends. Is there a way, using Koala / the Graph API to simply find out if User A is friends with User B just using User B's Facebook ID?


Solution

  • You can use https://graph.facebook.com/me/friends/{friend's user id}

    If they are friends it will return the ID and Name, if not an empty array.