Reputation: 123
Does facebook have an api for searching a user's friend?
Tim
Upvotes: 6
Views: 13897
Reputation: 1900
You can search friend's name like this:
select uid, name, sex
from user
where uid in (SELECT uid2 FROM friend WHERE uid1 = me())
and (strpos(lower(name),'TheFriendName')>=0 OR strpos(name,'TheFriendName')>=0)
TheFriendName=Full name or part of the name
Example:
select uid, name, sex
from user
where uid in (SELECT uid2 FROM friend WHERE uid1 = me())
and (strpos(lower(name),'Jack')>=0 OR strpos(name,'Jack')>=0)
Upvotes: 6
Reputation: 5719
You can get the list of friends using the following API call:
Friends: https://graph.facebook.com/me/friends?access_token=...
and then search in the list for the person you are looking for.
Refer to more detailed documentation here: http://developers.facebook.com/docs/api
Upvotes: 3