0

How do we search for a user by name within user's friends list. I"m able to fetch whole friends list using this api...

"https://graph.facebook.com/v2.9/#{facebook_id}/friends?access_token=#{access_token}"

But I'm not sure how do we query within friends list? Does Facebook support that?

Some SO answers says to fetch the whole friends list and search within the list ourself but I guess this may not be the right solution as users friends might grow we can't cache our result anywhere and fetching whole list every time also would not be a efficient solution. Does anyone knows any other work around?

Please guide me in right direction. Thanks.

Feroz
  • 699
  • 5
  • 17
  • 25
  • Not possible. You can only get information about the list itself, but not which friends are on it. – CBroe Sep 27 '17 at 09:57
  • List contain name and id of each user, but question here is do I need to fetch whole friends list to search for a single user? – Feroz Sep 27 '17 at 10:03
  • Oh, I see, you meant /friends, and not actually /friendlists. No, there is no way to search via this endpoint. What do you need this for, what is your app going to do with those “searched” friends? – CBroe Sep 27 '17 at 10:05
  • Find a friend who is using our app and to share some content with him (within our app) – Feroz Sep 27 '17 at 10:07
  • I think even Spotify does that. – Feroz Sep 27 '17 at 10:13
  • Easiest way to achieve that would be the Send button ... – CBroe Sep 27 '17 at 10:21
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/155408/discussion-between-feroz-and-cbroe). – Feroz Sep 27 '17 at 10:25

0 Answers0