Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including facebook-group-export with all npm packages installed. Try it out:

var facebookGroupExport = require("facebook-group-export")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

facebook-group-export v2.0.2

Export all members from a facebook group.

Facebook Group Export

NPM

Have you ever wanted to export all the members from a Facebook Group to a CSV?

Well you are in luck, Use facebook-group-export to list your groups, then pick the one you want, and export it; it's that easy.

Installation

This will install facebook-group-export as a global command which you can run.

npm install --global facebook-group-export

Usage


  Usage: facebook-group-export <ACCESS-TOKEN> [options]

  Options:

    -V, --version       output the version number
    -l, --list          List Facebook Groups
    -g, --groupId [id]  ID for group to export
    -f, --file [path]   File to store data in
    -h, --help          output usage information

  Examples:

    facebook-group-export <ACCESS-TOKEN> -l
    facebook-group-export <ACCESS-TOKEN> -l -f ./path/file.csv

    facebook-group-export <ACCESS-TOKEN> -g <GROUP-ID>
    facebook-group-export <ACCESS-TOKEN> -g <GROUP-ID> -f ./path/file.csv

Export data from Facebook

To access your data through the Facebook API, Facebook requires you to use an access token. This must be included when you run facebook-group-export. The easiest way I've found is to grab one from Facebook's API explorer https://developers.facebook.com/tools/explorer

There click on the "Get Access Token" button and make sure you check the "user_managed_groups" data permission. Once you've approved this app, copy the long random alphanumeric Access Token. We'll use it next to export your Facebook data.

Get Access Token

You need to know the Group ID of the group you wish to export data from. To see a list of all your groups and their Group IDs run:

facebook-group-export <YOUR-ACCESS-TOKEN> -l

This will return a list of the Facebook groups you manage. Copy the id from the group you want to export.

To export the members run

facebook-group-export <ACCESS-TOKEN> -g <GROUP-ID>

Save to CSV

To save any output as a CSV File add the -f <FILENAME> flag.

Contributing

  1. Fork it on Github https://github.com/alexbbt/facebook-group-export
  2. Create your feature branch: git checkout -b my-name-and-my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free