I'm looking for a way to export my Facebook/Messenger messages in a clean way, like a PDF, and that would be able to do some statistics on it, like counting number of messages etc.

I am aware of the possibility to create an archive of my account, which includes messages in a HTML file, so the app may work using this file.


1 Answer 1


Not a ready rolled solution but you have a couple of options using Python:

  • You can use the Facebook graph API via the SDK You will have to get a token to directly query Facebook for the data that you need.
  • You can download you data as a zip archive and then use BeautifulSoup to parse the html to extract the data.

Once you have got the data, using either of the mechanisms above you can use pandas to produce statistics, graphs, summaries, etc.

If you use a Jupyter Notebook to do all or some of the above you will be able to arrange things into a nice report and then convert it to a PDF document.

All of the above items are Free, Gratis & Open Source. There is a lot of online material available to help you get what you would like from them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.