r/redditdev • u/Pademel0n • Nov 19 '24
Get historical comments with PRAW PRAW
Hi so I want to retrieve every single comment from a sub, however it's only giving me, in my case, 970 comments which is about 5 months of comments from the specified sub. Relevant code provided below.
#relevant prerequisites for working code...
subreddit = reddit.subreddit(subreddit_name)
comments = subreddit.comments(limit=None) #None retrieves as many as possible
for comment in comments:
#relevant processing and saving
2 Upvotes
1
u/windyx Nov 19 '24
There's a request limit of about 1000 at a time and you seem to be hitting it. Also that looks AI written so maybe take a beat to read the documentation.
1
u/Pademel0n Nov 19 '24 edited Nov 19 '24
It’s not AI I just added those comments because I didn’t want to put all the code 😂. The best solution I’ve come up with so far is to request 1000 posts and take the comments from those although this is certainly a dubious solution…
2
u/[deleted] Nov 19 '24
[deleted]