Export (most) of your Facebook data using Node.js and the Graph API.
Crowbarring your data out of Facebook is no easy feat — to get everything out you'll need a combination of Graph API wrangling and old-fashioned manual labor — but it's not impossible.
The purpose of this repository is to give you some tools to make the whole process a bit smoother.
Facebook offers a way to download your data that sounds comprehensive enough, and I encourage you to first download that data and see if the amount of information and its quality are sufficient for your purposes — if so, you're in luck.
If, however, you'd like a more structured dataset and images in a better resolution, the tools below can help you. Here's what's included so far:
|Posts||Things you posted on your timeline.|
|Timeline photos||Photos attached to timeline posts 1|
|Albums||Your photo albums. 1|
|Photos you're tagged in||A subset of "Pictures of you", i.e. photos in which other people / Pages have tagged you 2|
- 1 Videos are not fetched at the moment!
- 2 Not all "Pictures of you" are accessible through the Graph API, you'll need to manually download the other photos.
Although I've checked against my own account for a modicum of accuracy in the exported data, these scripts are no guarantee that your content is comprehensively and accurately exported, so exercise caution if you plan to delete the content afterwards.
Since I wrote the scripts with ES6 syntax for its brevity, this only probably works with more recent versions of Node. (I'm currently using
- Clone this repository to your computer
npm install) in your project's folder to install all the necessary dependencies
- Rename the
config.json(you can do that in the terminal with
mv sample.config.json config.json) and put in the access token you get from the Facebook Graph API Explorer.
(Since the token allows anyone to access your data through the API, we're not putting the actual
config.json on GitHub.)
- Go to the Facebook Graph API Explorer page.
- Click on Get access token and choose Get User Access token.
- Check all the permissions in the first set ("User Access Permissions"), and follow the approval screens to generate the token.
- Put the access token in your
|Export your Facebook posts||
||This exports your Facebook posts to JSON in
|Export timeline photos||
||The photos are downloaded in the
|Generate a HTML timeline||
||This generates a HTML timeline based on
|Export your albums||
||Fetches the images from your Facebook albums into the