I'm just wondering if there's a simple enough way to iterate over all comments made by a particular user (I want to check for a particular phrase). Any help is appreciated :)
Asked
Active
Viewed 2,870 times
1 Answers
9
You can't get all comments, if the user has more than 1,000 comments. It is a limitation of the reddit API. However, the code below will get (and print the body) of all comments made by a user.
import praw
r = praw.Reddit('Your unique user agent')
user = r.get_redditor('REDDITOR-USER-HANDLE')
for comment in user.get_comments(limit=None):
print comment.body
A coupe notes:
- Remember to have a unique user agent
REDDITOR-USER-HANDLE
is the user name of the user you are looking at

Andy
- 49,085
- 60
- 166
- 233
-
4For me to get my code working, I used .redditor and .comments.new instead of .get_redditor and .get_comments. – Toad22222 Mar 29 '17 at 02:55