2

I have a regular Facebook profile page with 800 friends. How can I get the Facebook user id of all 800 friends of mine?

The reason for doing this is the following: I have a colleague that has a fanpage for his electronics store, and I think that my list of friends would be a great base to promote his store.

So I was thinking that, when creating a Facebook ad, he can create a Custom Audience. According to Facebook, a custom ad can be created by entering a list of Facebook user ids (I assume comma-delimited). So that's what I'm trying to accomplish.

2

1 Answer 1

1

You'll want to access it through the Graph API. The details on pulling friends are here.

You can also play around a bit with the explorer tool to get a feel for things. In this case, you'd just append YOURUSERID/friends in the explorer window and request the information with a token.

If you're a masochist, https://www.facebook.com/YOURUSERNAME/friends?ft_ref=flsa will get you a list of all your FB friends. You can scroll until nothing more loads and then parse out the ID using XPath or one of the browser scraping tools. The stuff is in there but it'd be a real pain to get out.

1
  • 2
    As a note, the Graph API now only returns the list of friends that use a specific app. So if you want the full list of friends, then the only way is through scraping.
    – Danny
    Commented Jan 19, 2017 at 20:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.