View facebook friend list [hidden or not hidden]

lynx -useragent=Opera -dump '' |gawk -F'\"t\":\"' -v RS='\",' 'RT{print $NF}' |grep -v '\"n\":\"' |cut -d, -f2
There's no need to be logged in facebook. I could do more JSON filtering but you get the idea... Replace u=4 (Mark Zuckerberg, Facebook creator) with desired uid. Hidden or not hidden... Scary, don't you?
Sample Output
Stephen Heise
Yvonne Chan
David Ebersman
Jack Xu

By: vlan7
2010-01-29 15:10:35

2 Alternatives + Submit Alt

What Others Think

uhm.. this may sound stupid, but how do i get my (anyone elses) userid? all facebook displays is a username (e.g. in my case 'drazraeltod') that doesn't seem to work another question: why using lynx instead of wget or curl? did i miss something important?
DrAzraelTod · 670 weeks and 2 days ago
ah.. forget the last part of the question... i just found a friend without username and he has of course my id in his list :-)
DrAzraelTod · 670 weeks and 2 days ago
We could use wget / curl. No problem. It's our choice. But don't forget to specify the user-agent. Facebook only accepts well-known user-agents... i.e. if we use wget we should type this syntax: wget -O - --user-agent='Opera' (...) P.S. You could also find your uid just placing the mouse cursor on your profile avatar ;)
vlan7 · 670 weeks and 2 days ago
Only works if you have the "Public Search Results" checkbox checked, as it apparently makes all this info public. *unchecks box* didn't know it did that. It certainly doesn't imply it's making all that info public. Gee, thanks, Facebook.
Groxx · 670 weeks and 1 day ago
Dear Groxx, This must has been changed on facebook 1-2 days before today, because in my previous tests I checked it with my own uid (that always had "public search results" box unchecked) and it always have worked well. Today I try it one more time and this has changed :) Anyway, as you sign "Facebook" on your post, thanks to you and all Facebook team for changin' this and to not categorize nevermore the friend list as PAI (Public Information Available), as you name it in Facebook privacy terms ;) Oh, thanks for remove this: "when it is viewed by people who are logged in to Facebook. Keep in mind, however, that because Friend List is publicly available, it will be visible to people who are viewing your profile while not logged in." Best regards,
vlan7 · 670 weeks and 1 day ago
Online tool to view anyone?s Facebook friends list (hidden or not) based on a user ID:
mathias · 670 weeks and 1 day ago
@vlan7: Groxx is not signing as "Facebook", but rather addressing them in the same manner as "Thanks for the lynx command, vlan7."
dennisw · 670 weeks and 1 day ago
oh! I misunderstood Groxx :$ sorry, I'm not native english.
vlan7 · 670 weeks ago
This seems to not work with users who have pages using other locales, eg. or also, mathias, your online form has a bug, it always counts and shows Mark Zuckerberg's ID before listing the friends for the ID you choose.
monkeyvegas · 669 weeks and 5 days ago
Is there a way to get only online friends?
RanyAlbeg · 668 weeks and 4 days ago
When I try this, facebook refuses it because I'm using lynx and, as you said, they only accept well-known user-agents... But I specified Opera as indicated, so I don't see what could be going wrong. Any idea what I should do?
dcurl34hy · 661 weeks ago
I keep getting an error message when I try to run this. I am a total newbie and trying to learn here. I get "__a is not recognized as an internal etc.." What am I doing wrong?
RLCowboy · 654 weeks and 3 days ago
Try this: wget -O - --user-agent='Opera' '' |gawk -F'\"t\":\"' -v RS='\",' 'RT{print $NF}' |grep -v '\"n\":\"' |cut -d, -f2 Regards,
vlan7 · 647 weeks and 2 days ago
im a newbie how can i use this??
angel76 · 641 weeks and 6 days ago
Vlan7, I keep getting the same mssage as RLCowboy along the lines of "__a is not recognized as an internal..."! I tried typing in just the facebook ajax typeahead address alone, but I only get something about 0 out of 0. Do you have a different command that works? Any other ways I could try your original command differently using wget? I really want this to work! Please help, Vlan7! Thank you!
toulseu · 636 weeks and 3 days ago
@DrAzraelTod: to get a number ID just try Now, most of fb users have a username and fb doesn't show their ID... And, regarding this link: is not showing hidden friends anymore :(
Ferdelanze · 580 weeks and 2 days ago
rahmanp786 · 573 weeks ago ????? ??? ????? ????? SEO - ????? ???? ????? ????? ????? ??? ????? ????? SEO - ????? ???? ????? ????? ????? ??? ????? ????? SEO - ????? ???? ????? ????? ????? ??? ????? ????? SEO - ????? ???? ????? ????? ????? ??? ????? ????? SEO - ????? ???? ????? ????? ????? ??? ????? ????? SEO - ????? ???? ????? ????? ????? ??? ????? ???? SEO ????? ????? ????? ???? ????? ????? ??? ???? ???? ??????? Search Engine Optimization ??? ????? ??????????? ?? ????? ?????????? ????? ????? ?? ???? ???SEO
seofox · 43 weeks and 4 days ago
seofox · 42 weeks and 5 days ago
themeoff · 1 week and 3 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: