Get top images from any subreddit
Branch: master
Clone or download
Pull request Compare This branch is 23 commits ahead, 27 commits behind nagracks:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.



reddit_get_top_images is a script that can be used to download all the top images from any subreddit of

It can be adjusted to get images from any segment of time, like images from the last hour, day, or week etc.

The script will create a folder in your $home directory called reddit_pics.


Here is a typical API usecase that will get all the top images of from last week.

import get_top_images as gi

sub_reddit = 'getmotivated'
tir = gi.TopImageRetreiver(sub_reddit, limit=5)
for url in tir.get_top_submissions():
    gi.download_it(url, tir)

Here is a typical CLI usecase that will do the same:

$ python -s getmotivated -p w

Here are the full arguments for CLI use:

usage: [-h] [--subreddit SUBREDDIT [SUBREDDIT ...]]
                         [--period {h,d,w,m,y,a}] [--limit N]
                         [--destination DST]

Download top pics from any subreddit

optional arguments:
  -h, --help            show this help message and exit
                        Name of the subreddit
  --period {h,d,w,m,y,a}, -p {h,d,w,m,y,a}
                        [h]our, [d]ay, [w]eek, [m]onth, [y]ear, or [a]ll.
                        Period of time from which you want images. Default to
  --limit N, -l N       Maximum URL limit per subreddit. Defaults to 15
  --destination DST, -d DST
                        Destination path. By default it saves to


This project is intended as a beginner friendly collaborative code, and anyone that wants to add, extend or otherwise improve this code is free to do so. Even if they have never contributed to another repository before.


reddit_get_top_images is licensed under GPL3