用户朋友和我在一起吗?

I'm trying to see if X is a friend of mine using Facebook's Graph API. I was thinking about searching in the /me/friends data but figured that'd be too heavy for my back end.

Appreciate all answers!

here is FQL query you need to run:

SELECT uid2 FROM friend WHERE uid1 = me() and uid2 = YOUR_FRIEND_ID

here is the URL where you can play with this query:

https://developers.facebook.com/tools/explorer?fql=SELECT%20uid2%20FROM%20friend%20WHERE%20uid1%20%3D%20me()%20and%20uid2%20%3D%20YOUR_FRIEND_ID

and this is URL you can call to get that data in JSON format:

https://graph.facebook.com/fql?q=SELECT+uid2+FROM+friend+WHERE+uid1=me()+and+uid2=YOUR_FRIEND_ID&access_token=YOUR_ACCESS_TOKEN

obviously you need to replace YOUR_FRIEND_ID with your friend's id, and you need to get YOUR_ACCESS_TOKEN - the easiest way would be Graph API Explorer.

so if query returns any data - that means you and YOUR_FRIEND_ID are friends.