Python PRAW – Getting the avatar icon of a redditor Last Updated : 21 Jun, 2020 Comments Improve Suggest changes Like Article Like Report In Reddit, a redditor is the term given to a user. Each and every redditor has an icon on their profile which is their online avatar. We will be using the icon_img() attribute of the Redditor class to fetch the URL of the redditor's avatar. Example 1 : Consider the following redditor : The user name of the redditor is : spez. Python3 1== # importing the module import praw import PIL import urllib # initialize with appropriate values client_id = "" client_secret = "" username = "" password = "" user_agent = "" # creating an authorized reddit instance reddit = praw.Reddit(client_id = client_id, client_secret = client_secret, username = username, password = password, user_agent = user_agent) # the name of the redditor redditor_name = "spez" # instantiating the Redditor class redditor = reddit.redditor(redditor_name) # fetching the URL of the image url = redditor.icon_img print("The URL of the icon image of " + redditor_name + " is : \n" + url) # displaying the image urllib.request.urlretrieve(url, "reddit.png") img = PIL.Image.open("reddit.png") img.show() Output : The URL of the icon image of prez is : https://www.redditstatic.com/avatars/avatar_default_19_A06A42.png Example 2 : Consider the following redditor : The user name of the redditor is : AutoModerator Python3 1== # importing the module import praw import PIL import urllib # initialize with appropriate values client_id = "" client_secret = "" username = "" password = "" user_agent = "" # creating an authorized reddit instance reddit = praw.Reddit(client_id = client_id, client_secret = client_secret, username = username, password = password, user_agent = user_agent) # the name of the redditor redditor_name = "AutoModerator" # instantiating the Redditor class redditor = reddit.redditor(redditor_name) # fetching the URL of the image url = redditor.icon_img print("The URL of the icon image of " + redditor_name + " is : \n" + url) # displaying the image urllib.request.urlretrieve(url, "reddit.png") img = PIL.Image.open("reddit.png") img.show() Output : The URL of the icon image of AutoModerator is : https://styles.redditmedia.com/t5_1yz875/styles/profileIcon_klqlly9fc4l41.png?width=256&height=256&crop=256:256, smart&s=94486fc13b9ca9e154e9e8926e3d8c43ccc80be3 Comment More infoAdvertise with us Next Article Python PRAW – Getting the avatar icon of a redditor Y Yash_R Follow Improve Article Tags : Python Python-PRAW Practice Tags : python Similar Reads Python PRAW â Getting the ID of a redditor In Reddit, a redditor is the term given to a user. Each and every redditor has a unique ID provided to them. Here we will see how to fetch the ID of a redditor. We will be using the id attribute of the Redditor class to fetch the ID of a redditor. Example 1 : Consider the following redditor : The us 2 min read Python PRAW - Getting the score of a comment in Reddit In Reddit, we can post a comment to any submission, we can also comment on a comment to create a thread of comments. Any user can either upvote or downvote a comment, the net value is the score of the comment. Here we will see how to fetch the score of a comment using PRAW. We will be using the scor 2 min read Python PRAW â Getting the link karma of a redditor In Reddit, a redditor is the term given to a user. Reddit karma is the score you get for posting and commenting on Reddit. Here we will see how to fetch the karma obtained by posting submissions on Reddit by a redditor. We will be using the link_karma attribute of the Redditor class to fetch the lin 2 min read Python PRAW - Getting the author of a comment in Reddit In Reddit, we can post a comment to any submission, we can also comment on a comment to create a thread of comments. Here we will see how to fetch the author of a comment using PRAW. We will be using the author attribute of the Comment class to fetch the Redditor class of the author of a comment. Ex 2 min read Python PRAW - Getting the ID of a comment in Reddit In Reddit, we can post a comment to any submission, we can also comment on a comment to create a thread of comments. Reddit assigns each and every comment with an identification. Here we will see how to fetch the ID of a comment using PRAW. We will be using the id attribute of the Comment class to f 2 min read Like