Facebook API would probably be the most natural. However, if you have access to Linux you can at least extract the friends' names using `wget` as follows (see also [wget for fetching Facebook profile/friend pages][1]):

    wget -U Mozilla --wait 1 "https://www.facebook.com/profile.php?id=938751234570943"

This will download the publicly available content and depending on privacy settings the name of the contact will appear and could be parsed.

  [1]: http://stackoverflow.com/questions/6821696/wget-for-fetching-facebook-profile-friend-pages