Search code examples
pythonredditpraw

Using PRAW to pull more than 1000 top entries


How can I get praw to download more than the 1000 of the top titles in a reddit sub? The following minimal working example stops at 1000:

import praw

subreddit_name  = "todayilearned"
user_agent = "TopHITS v0.1"
agent = praw.Reddit(user_agent=user_agent)
sub = agent.get_subreddit(subreddit_name)

submissions = sub.get_top_from_all(limit=None)
for result in submissions:
    print result

Solution

  • Note the following paragraph from the documentation of praw:

    We can at most get 1000 results from every listing, this is an upstream limitation by reddit. There is nothing we can do to go past this limit. But we may be able to get the results we want with the search() method instead.