Skip to content
Reddit takeout: export your account data as JSON: comments, submissions, upvotes etc. πŸ¦–
Branch: master
Clone or download
Latest commit 13c0e70 Sep 16, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore initial Sep 4, 2018
LICENSE Update LICENSE Sep 4, 2019 Update Sep 16, 2019
output.json Add example output Sep 6, 2019 Add inbox messages Sep 6, 2019

Script to export your Reddit data as json: saves, upvotes, submissions etc.

Setting up

  1. pip3 install praw -- used to benefit from pagination and rate limiting.
  2. In order to use Reddit API, you need to register a custom 'personal script' app and get client_id and client_secret parameters. See more here.
  3. In order to access user's personal data (e.g. saved posts/comments), reddit API also requires username and password parameters. (yes, your Reddit password).
  4. It might be convenient to dump these in a file like, e.g.
client_id = ...
clien_secret = ...
username = ...
password = ...


Recommended: --secrets /path/to/ That way you have to type less and have control over where you're keeping your plaintext reddit password.

Alternatively, you can pass auth arguments directly, e.g. --username <user> --password <password> --client_id <client_id> --client_secret <client_secret>. However, this is prone to leaking your password in shell history.

You can also import script and call get_json function directory to get raw json.


WARNING: reddit API limits your queries to 1000 entries. It's highly recommended to back up regularly and keep old versions. Easy way to achieve it is command like this: ./ --secrets >reddit-$(date -I).json.

See more:

Example output

See ./output.json, it's got some example data you might find in your data export. I've cleaned it up a bit as it's got lots of different fields many of which are probably not relevant.

However, this is pretty API dependent and changes all the time, so better check with Reddit API if you are looking to something specific.

You can’t perform that action at this time.