🌐
GitHub
github.com › reddit-archive › reddit › wiki › oauth2
OAuth2 · reddit-archive/reddit Wiki · GitHub
For client_credentials grants include the following information in your POST data (NOT as part of the URL) ... When using the https://oauth.reddit.com/grants/installed_client grant, include the following information in your POST data:
Author   reddit-archive
🌐
Reddit
reddit.com › r/openbb › how to generate and authorize reddit api credentials for use with the openbb terminal.
r/openBB on Reddit: How to Generate and Authorize Reddit API Credentials for use With the OpenBB Terminal.
September 12, 2022 - OPENBB_API_REDDIT_CLIENT_ID='CLIENT_ID' OPENBB_API_REDDIT_CLIENT_SECRET='CLIENT_SECRET' OPENBB_API_REDDIT_USERNAME='USERNAME' OPENBB_API_REDDIT_PASSWORD='PASSWORD' OPENBB_API_REDDIT_USER_AGENT='THE_APPLICATION_NAME' Start the Terminal, and Reddit functions should work. If they do not work, check that the application you created in your Reddit account was a "Personal Use Script". https://openbb-finance.github.io/OpenBBTerminal/terminal/common/ba/
🌐
Reddit
reddit.com › r/redditdev › api key credentials
r/redditdev on Reddit: API Key Credentials
May 1, 2022 -

Hey folks, this is baffling me - how do I create a new app/get API credentials?

When I go to /pref/apps I just get a "You are already logged in and will be redirected"

But when I get redirected I end up on the same screen.

Any insights? :-)

Thanks!

🌐
Rymur
rymur.github.io › setup
Reddit API How-To - Setup
For the Reddit API, the “username” is your client_id and the “password” is your client_secret. Finally, we set the content of our POST request with the “body” option. This is where you can choose between application or user authentication. If you wish to use application authentication ...
🌐
GitHub
github.com › avansaber › avansaber-php-reddit-api
GitHub - avansaber/avansaber-php-reddit-api: Modern, fluent, framework-agnostic Reddit API client for PHP (PSR-18/PSR-7/PSR-3).
Getting Reddit API credentials · Log in to Reddit, open https://www.reddit.com/prefs/apps. Click “create another app”. For app-only reads, choose type “script”. For end-user auth, choose “web app” (Authorization Code) and set a ...
Starred by 52 users
Forked by 6 users
Languages   PHP
🌐
Better Auth
better-auth.com › docs › authentication › reddit
Reddit | Better Auth
Edit on GitHub · Previous Page · Polar · Next Page · Roblox · Get your Reddit Credentials · Configure the provider · Sign In with Reddit · Additional Configuration · Scopes · Ask AI · Introduction · Comparison · Installation ·
🌐
Data365
data365.co › blog › how-to-get-reddit-api-key
How to Get Reddit API Key: Step-by-Step or Skip-the-Setup? | Data365.co
The very first step on your journey to Reddit data is creating an account, in case you haven't one yet. After, to access Reddit’s API, you also need to register an app. This gives you the Reddit API credentials the platform uses to identify ...
Top answer
1 of 2
24

As of right now, you cannot retrieve a permanent access token. You have 2 options that come close.

The first is to request a "refresh" token when using the standard OAuth flow. That's what you're doing by sending "duration" as "permanent" in your code. The refresh token can be used to automatically retrieve new 1 hour access tokens without user intervention; the only manual steps are on the initial retrieval of the refresh token.

The second alternative, which applies only when writing a script for personal use, is to use the password grant type. The steps are described in more detail on reddit's "OAuth Quick Start" wiki page, but I'll summarize here:

  1. Create an OAuth client (under https://www.reddit.com/prefs/apps) with type = "script"
  2. Make a request to https://www.reddit.com/api/v1/access_token with POST parameters grant_type=password&username=<USERNAME>&password=<PASSWORD>. Send your client ID and secret as HTTP basic authentication. <USERNAME> must be registered as a developer of the OAuth 2 client ID you send.
2 of 2
17

A client_id and client_secret can be generated for a reddit account by going to https://www.reddit.com/prefs/apps and creating an app:


The part I have hidden is my client_id.

Then you can use a client like praw to access reddit e.g. with Python:

import praw
r = praw.Reddit(client_id='insert id here',
                client_secret='insert secret here',
                user_agent='insert user agent')
page = r.subreddit('aww')
top_posts = page.hot(limit=None)
for post in top_posts:
    print(post.title, post.ups)

You could use your current browser's user agent, which can be easily found by google searching "what is my user agent" (among other ways).

🌐
GitHub
github.com › EthanArbuckle › Apollo-CustomApiCredentials
GitHub - EthanArbuckle/Apollo-CustomApiCredentials: Tweak to use your own reddit API credentials in Apollo
Tweak to use your own reddit API credentials in Apollo - EthanArbuckle/Apollo-CustomApiCredentials
Starred by 771 users
Forked by 351 users
Languages   Objective-C 50.5% | C 47.4% | Makefile 2.1%
Find elsewhere
🌐
AWS
docs.aws.amazon.com › discovering hot topics using machine learning › implementation guide › retrieve and manage api credentials for reddit api authentication
Retrieve and manage API credentials for Reddit API authentication - Discovering Hot Topics Using Machine Learning
in the solution's GitHub repository and run it locally. This is the simplest option. —Or— · Use the Reddit OAuth Helper tool · . Select the Permanent checkbox to generate the refreshToken. The refreshToken requires only the read scope. Security considerations · The primary reason for choosing refreshToken with clientId and clientSecret to authenticate with Reddit API is because this option does not require Reddit sign-in credentials.
🌐
Reddit
reddit.com › r/infinity_for_reddit › if you want to use your own api key
r/Infinity_For_Reddit on Reddit: If You Want to Use Your Own API Key
June 18, 2023 -

Please change ALL of the following:

  • API key

  • Redirect URL

  • User-Agent (in Infinity)

Please don't just change the API key!!!!!!!!! And please use another app name without infinity in it 🥺.

I found many users had made some tutorials about how to use your own API key, like this post, but none of them mentioned the other two things. If you don't change all of them, reddit still knows you are using Infinity, but with your own key.

You can see more info here.

🌐
GitHub
github.com › PaulC91 › redditapi
GitHub - PaulC91/redditapi: Tools to interact with the reddit oauth API in R
Create a reddit user account (if ... app name) and secret. You will need the client id, secret and name (agent) of your API application, as well as your reddit username and password to authenticate in R....
Author   PaulC91
🌐
Ranjith Nair
ranjithnair.github.io › 2018 › 02 › 27 › Reddit-Application-Oauth.html
How to use Reddit's Application Only OAuth · Ranjith Nair - Programming World
February 27, 2018 - As per the reddit documentation it states :- In some cases, 3rd party app clients may wish to make API requests without a user context. App clients can request a “user-less” Authorization token via either the standard client_credentials grant, or the reddit specific extension to this grant, https://oauth.reddit.com/grants/installed_client.
🌐
Reddit
reddit.com › r/redditdev › how do you authenticate
r/redditdev on Reddit: How do you authenticate
November 19, 2020 -

How do you authenticate?

The API docs live here: https://www.reddit.com/dev/api It includes no information on how to use your client id and secret to authenticate.

This Github page) describes the procedure, but it hasn't been updated in 4 years, and when I attempt it, the token request call pulls up an HTML web page vice a JSON response.

There's a Python wrapper called PRAW, but it seems to be a bit messy, and it's also not clear if it's current. In general, Libs tend to be overkill for these sorts of API.

Is the Reddit API current and supported? How do you authenticate? Thank you.

🌐
GitHub
github.com › r-lib › httr › issues › 482
Always get 401 when attempting to use reddit API · Issue #482 · r-lib/httr
September 12, 2017 - library(httr) # 1. Find OAuth settings for reddit: # https://github.com/reddit/reddit/wiki/OAuth2 reddit <- oauth_endpoint( authorize = "https://www.reddit.com/api/v1/authorize", access = "https://www.reddit.com/api/v1/access_token" ) # 2. Register ...
Published   Sep 12, 2017
🌐
GitHub
github.com › JeffreyCA › Apollo-ImprovedCustomApi
GitHub - JeffreyCA/Apollo-ImprovedCustomApi: Use your own Reddit and Imgur API credentials in Apollo
Use your own Reddit and Imgur API credentials in Apollo - JeffreyCA/Apollo-ImprovedCustomApi
Starred by 547 users
Forked by 227 users
Languages   C 45.8% | Logos 36.6% | Objective-C 14.7% | Shell 2.2% | Makefile 0.7%
🌐
JC Chouinard
jcchouinard.com › accueil › get reddit api credentials with praw (python example)
Get Reddit API Credentials with PRAW (Python Example) - JC Chouinard
January 17, 2024 - In this post, we are going to generate the credentials necessary to run the Reddit API using Python and the PRAW wrapper. Learn Reddit by JC Chouinard
🌐
Readthedocs
redditclient.readthedocs.io › en › latest › oauth
Oauth Setup - Reddit::Client Documentation
While Reddit::Client supports "web"-type apps, we don't have a tutorial for setting them up yet, so getting it to work is left as an exercise for the reader. The functions you will need, however, such as get_refresh_token are documented in Main Methods. Documentation for the entire "web"-type flow can be found at https://github.com/reddit-archive/reddit/wiki/OAuth2.
🌐
GitHub
github.com › KrishnaRandad2023 › mcp-reddit
GitHub - KrishnaRandad2023/mcp-reddit
Reddit API Credentials - Create a Reddit app at https://www.reddit.com/prefs/apps · Docker - For containerized deployment · Environment Variables: REDDIT_CLIENT_ID - Your Reddit app client ID · REDDIT_CLIENT_SECRET - Your Reddit app client ...
Author   KrishnaRandad2023