Prerequisites
- Create or sign in to a Reddit account at reddit.com.
- Create a script app at reddit.com/prefs/apps.
- Copy the app’s client ID and client secret.
Run the Example
1
Set up your virtual environment
2
Install dependencies
3
Export required credentials
4
Set optional Reddit credentials
REDDIT_USER_AGENT overrides the default user agent. Set REDDIT_USERNAME and REDDIT_PASSWORD for write operations.5
Run the example
Save the code above as
reddit_tools.py, then run: