Use Greasemonkey to extract your Facebook Phonebook

7/19/2010 UPDATE: There is a BRAND NEW version of the script available on Userscripts here.
10/12/2009 UPDATE: Added fixes from Marcel Chastain
UPDATE: It looks like the version that got uploaded was missing a * in the trigger URL! That might be the issue everyone is having.
UPDATE: Video of the process: fbimport

Facebook’s API + FBConnect is great but it has some severe limitations. Notably, it doesn’t expose all the functionality available on the Facebook  site. Tonight in particular, I wanted to be able to copy a dump of my friends’ names and phone numbers off the site to load into a fresh cell phone. Unfortunately, looking at the API this isn’t possible.

Never fear – Greasemonkey provides enough of a hook into Firefox that it would be possible to write a UserScript to accomplish this.

Continuing beyond this point is probably against the Facebook TOS and will probably severely void your warranty.

You have been warned.

The following describes how to use this userscript to extract your Facebook “Phonebook”. It produces of a CSV of your friends’ names and phone numbers. Fair warning – this is a rough prototype and does almost no error handling. Also, since the “Phone” field is a free text field I can’t promise people will have formatted their numbers in any sane fashion. But either way it’s a good start to revering lost numbers.

So here is what you need to do to use the script:

1. Install Greasemonkey –

2. Follow these instructions to install the script –

Edit: The script is also on Userscripts at

3. Navigate over to (You’ll have to login)

4. Answer yes to the prompt and sit back – the script will move through your phonebook and eventually dump you a CSV of the results.

5. Copy/Paste the CSV wherever you want.

6. Un-install the Greasemonkey script.

So that’s it, one less walled garden to worry about. And hopefully one less “I lost my cellphone!” event/group on facebook!

The script:

Facebook Phonebook Exporter

Posted In: Extensions, Launch

Tags: , , , ,

  • Pingback: Extract Your Phonebook From Facebook, At Your Own Risk()

  • Pingback: How to Extract Your Phonebook From Facebook, At Your Own Risk | 82123()

  • telperin

    it says something like this when i try to install script in firefox:
    [Exception… “Component returned failure code: 0x80520003 (NS_ERROR_FILE_EXECUTION_FAILED) []” nsresult: “0x80520003 (NS_ERROR_FILE_EXECUTION_FAILED)” location: “JS frame :: chrome://greasemonkey/content/utils.js :: launchApplicationWithDoc :: line 188” data: no]

  • peterc

    same problem here… anyone can help?

  • anonymous

    It might be due to a Greasemonkey version discrepancy. Check to make sure you are running the latest release – 0.8.20090123.1

  • peterc

    i downloaded that version from mashable this morning… can i do something wrong?

  • peterc

    even when i try other greasemonkey scripts, it gives me an option to install automatically… this one doesnt :( i really need to make this work :(

  • Pingback: Extract Your Phonebook From Facebook, At Your Own Risk | Orange County Adobe Dreamweaver User Group()

  • hey_tc

    I don’t get how this is supposed to work. It installed ok but how do you run it? Just navigating to the phonebook page doesn’t seem to be triggering any action :-(

  • Pingback: Extract Your Phonebook From Facebook, At Your Own Risk | KGRAND ONLINE NEWS()

  • anonymous
  • Pingback: Extract Your Phonebook From Facebook, At Your Own Risk | TechWeb()

  • mate

    doesnt work… i tried everything…

  • Me

    Could this script be modified to extract all the messenger addresses (Skype, MSN, …) of the friendlist?

  • Pingback: Google Voice Applications & Scripts | Ninja Blogging()

  • Jack Mo

    It doesn’t work

  • jason

    You should just use it does this already. works on myspace twitter too.

  • Marcel Chastain

    2 changes needed to get this working.

    On line 9, change
    div[@class=”lnav header”]
    div[@class=”nd header”]

    On line 10, change
    var desc = nodesSnapshot.snapshotItem(0).childNodes;
    var desc = nodesSnapshot.snapshotItem(2).childNodes;

    That’s it!

  • Ashish Datta

    thanks Marcel!

  • Paul Aerison

    I have installed the script and made the changes as noted by Marcel, but when I load nothing happens. GM says it’s enabled and there is a check next to the script. I verified that the above URL is in GM under manage scripts. Any ideas what I missed? This is my first GM script so keep that in mind.

  • Jacopo
  • jamal

    I used this script to create this bookmarklet tool that encapsulate all the above work and finally downloads the contacts directly as .CSV file. It does not need a firefox plugin or downloading a script. Check it out

  • Esteban

    Doesn’t work. Installed everything, but step 4 (‘Answer yes to the prompt and sit back’) doesn’t happen. Actually, it does nothing :((

  • Pingback: {5} Setfive – Talking to the World » Blog Archive » UPDATED: New Facebook Phonebook Script()

  • Rover

    Nothing at all is happening in the new version. It just sits there on page 2. I’ve read the instructions…

  • Marc.Quark

    Same problem over here, stops on page two

  • Full Movie Downloads Now

    Now after which I’ll stumble across a post like this and I’ll recall that there quite are nevertheless useful pages on the web. ^_^. Thanks.

  • jamie

    the script fails when you do phone and email
    phone works fine, hoerver the email does!
    really hope this gets sorted, as its a great script

  • Nad

    Same thing here.. it works for the phones only.. when trying for the emails, it stop at page 2…

  • Gjeni

    Even when i try to install the script i have failure. Pleeeease help me

  • Pancho

    Not working anymore, I think. There isn’t any tab of “Phonebook” in the mobile version of Facebook with the last greasemonkey script installed from here What can we do :( thanks

  • originalbloog

    Your website is great. Content is very beautiful. Thanks

  • Pingback: jogos()

  • Erick

    This isn’t working :( Would love to have a script to easily add friends from Facebook to LinkedIn.

  • Pingback: darmowe seriale()

  • Pingback: robbie-williams-polls()