🌐
Reddit
reddit.com › r/python › praw user_agent (i'm a noob)
r/Python on Reddit: PRAW user_agent (I'm a noob)
April 19, 2013 -

Hi, I'm trying to learn Python and I thought I'd mess around with praw. When creating a Reddit object, the format is r = praw.Reddit(user_agent = 'example') """this is what i saw on the praw docs"""

My question is: What is user_agent, and should I use the String 'example' when I make a Reddit object? The praw docs make it seem important: "NEVER lie about your user-agent. This includes spoofing popular browsers and spoofing other bots. We will ban liars with extreme prejudice."

So what should my user_agent be?

🌐
Read the Docs
praw.readthedocs.io › en › stable › getting_started › quick_start.html
Quick Start - PRAW 7.7.1 documentation
import praw reddit = praw.Reddit( client_id="my client id", client_secret="my client secret", user_agent="my user agent", )
🌐
Stack Overflow
stackoverflow.com › questions › 68889100 › how-do-i-find-user-agent
python - How do I find User Agent? - Stack Overflow
reddit = praw.Reddit(client_id='CLIENT_ID HERE', client_secret='CLIENT_SECRET HERE', user_agent='USER_AGENT HERE')
🌐
Read the Docs
praw.readthedocs.io › en › v3.6.2
PRAW: The Python Reddit Api Wrapper — PRAW 3.6.2 documentation
>>> import praw · Create the Reddit object (requires a user-agent): >>> r = praw.Reddit(user_agent='Test Script by /u/bboe') Logging in: >>> r.login('username', 'password') Send a message (requires login): >>> r.send_message('user', 'Subject Line', 'You are awesome!') Mark all unread messages as read (requires login): >>> for msg in r.get_unread(limit=None): ...
🌐
Read the Docs
praw.readthedocs.io › en › latest › getting_started › quick_start.html
Quick Start - PRAW 7.8.2.dev0 documentation
import praw reddit = praw.Reddit( client_id="my client id", client_secret="my client secret", user_agent="my user agent", )
🌐
PyPI
pypi.org › project › praw
praw · PyPI
import praw reddit = praw.Reddit( client_id="CLIENT_ID", client_secret="CLIENT_SECRET", password="PASSWORD", user_agent="USERAGENT", username="USERNAME", )
      » pip install praw
    
Published   Oct 25, 2024
Version   7.8.1
🌐
GitHub
github.com › amcquade › fresh_script › issues › 63
`praw.Reddit` instance does not use a unique user-agent · Issue #63 · amcquade/fresh_script
April 7, 2019 - This site_name is then used to create a praw.Reddit instance within main: ... user_agent = ' '.join([ "Python3:FreshScript:(commit 29a482a)", "(by /u/<reddit_user>)", "(https://github.com/amcquade/fresh_script)" ]) reddit = praw.Reddit('bot1', user_agent=user_agent)
Published   Sep 17, 2019
🌐
Read the Docs
praw.readthedocs.io › en › v2.0.15 › pages › getting_started.html
Getting Started — PRAW 2.0 documentation
Start by firing up Python and importing PRAW. You can find the installation instructions on the main page ... Next we need to connect to reddit and identify our script. We do this through the user_agent we supply when our script first connects to reddit.
🌐
Stack Overflow
stackoverflow.com › questions › 22833116 › praw-api-login-fails-with-client-error
python - Praw: API Login Fails with Client Error - Stack Overflow
Change your client's User-Agent ... your username as contact information, in the following format: <platform>:<app ID>:<version string> (by /u/<reddit username>)...
Find elsewhere
🌐
Chatbots
chatbots.studio › home › blog › how to make a reddit bot with python
How to make a Reddit bot with Python | Chatbots.Studio
August 20, 2020 - reddit = praw.Reddit(client_id=”CLIENT_ID”, client_secret=”CLIENT_SECRET”, password=”PASSWORD”, user_agent=”USERAGENT”, username=”USERNAME”) With the reddit instance you can then interact with Reddit by different ways: # Create a submission to r/test ·
🌐
GitHub
github.com › praw-dev › praw
GitHub - praw-dev/praw: PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.
import praw reddit = praw.Reddit( client_id="CLIENT_ID", client_secret="CLIENT_SECRET", password="PASSWORD", user_agent="USERAGENT", username="USERNAME", )
Starred by 3.9K users
Forked by 485 users
Languages   Python
🌐
Reddit
reddit.com › r/redditdev › working on praw bot. curious about user agents and urllib
r/redditdev on Reddit: Working on Praw bot. Curious about user agents and urllib
July 30, 2020 -

Building a praw bot. Would appreciate it if you guys could answer a few questions for me

Tutorial I'm following: https://www.pythonforengineers.com/build-a-reddit-bot-part-1/

In the praw.ini file, I had to list the user agent for the bot. I'm familiar with what a user agent is in general (an identifier for your browser and system in an http request). However, the tutorial I'm following above says,

Libraries like Python’s urllib are severely restricted by Reddit to prevent abuse. Reddit recommends you use your own special user agent, and that’s what we’ll do.

Why is urllib restricted by Reddit and why is it recommended I use a special user agent? Plus, wouldn't this be considered user agent spoofing?

Edit: What does reddit even mean by special user agent? Does it mean I have to create a unique identifier for my api client? Also, isnt there a way to make a custom user agent in urllib? Hypothetically if I were to use urllib for my bot how would reddit even know if I changed the user agent?

🌐
Reddit
reddit.com › r/redditdev › [praw] what is the equivalent of user_agent for a normal human user?
r/redditdev on Reddit: [PRAW] What is the equivalent of user_agent for a normal human user?
April 19, 2015 - So there's no "equivalent" for a normal human user - every connection to reddit has a user agent, and the agent depends on how they're connecting.
🌐
Read the Docs
praw.readthedocs.io › en › v3.6.2 › pages › code_overview.html
Code Overview — PRAW 3.6.2 documentation
PRAW, an acronym for “Python Reddit API Wrapper”, is a python package that allows for simple access to reddit’s API. PRAW aims to be as easy to use as possible and is designed to follow all of reddit’s API rules. You have to give a useragent, everything else is handled by PRAW so you ...
🌐
BlackHatWorld
blackhatworld.com › home › forums › social media › reddit
When using my upvoting script, my account activity keeps saying praw, how do I spoof this? | BlackHatWorld
April 1, 2023 - I then discovered a method to grow my karma rapidly which has. been working very well so far. In 10 days I got up to 20,000 karma. Here's the problem. When I go to reddit dot com/account-activity, my user agent says PRAW, which I fear will be a problem when I start gaining posting to public subreddits and am seen by others.
🌐
Reddit
reddit.com › r/redditdev › how can i use my praw user agent data in a requests get header?
r/redditdev on Reddit: How can I use my PRAW user agent data in a requests GET header?
December 23, 2020 -

My PRAW instance is authorised to scrape data from a quarantined sub. However, my application depends on requests' GET function to view the .json data for each post, e.g.,

req = requests.get(URL, headers={

"User-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36"

}

...where URL is some Reddit post's URL with ".json" appended.

How do I structure the "User-agent" header to contain the user information I'm passing into my Reddit instance of PRAW so that I avoid a Forbidden 403?

🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-get-client_id-and-client_secret-for-python-reddit-api-registration
How to get client_id and client_secret for Python Reddit API registration ? - GeeksforGeeks
July 12, 2025 - reddit = praw.Reddit(client_id ='my client id', client_secret ='my client secret', user_agent ='my user agent', username ='my username', password ='my password') In order to get the information for these fields: