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.
Answer from kemitche on Stack Overflow
🌐
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!

🌐
Reddit
reddit.com › r › reddit.com › wiki › api
r/reddit.com Wiki: Reddit API Access
November 28, 2023 - Select “I’m a Developer” and “I want to register to use the Reddit API.” Then, you can create credentials here.
People also ask

🌐
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
May 27, 2025 - Not ready? Need a way out? Then skip it all and move to Step 6. Or even shorter way… just fill in the form to get 14-free trial period with Data365 API and already retrieve public Reddit data. So, you’ve got your keys — your Client ID, Client Secret, and User-Agent.
🌐
Apidog
apidog.com › blog › reddit-api-guide
Reddit API: Features, Pricing & Set-ups
August 1, 2025 - With authentication set up, you can start making API requests to fetch data or perform actions on Reddit. Pro tip: Utilize a powerful API development tool like Apidog to make API requests with just a paste and click effortlessly. Apidog is a comprehensive tool designed to enhance API development efficiency by providing a suite of features that streamline the creation, testing, and documentation of APIs. Key features include:
🌐
Latenode
latenode.com › home › blog about no-code integrations with latenode - the ultimate no-code automation platform › undefined › api integration best practices in integration & api management - explore no-code automation with latenode › how to use reddit api: from access tokens to automated data collection
How to Use Reddit API: From Access Tokens to Automated Data Collection
The API provides a set of endpoints that enable developers to retrieve data from Reddit, such as posts, comments, subreddits, and user information. It also allows for actions like voting, commenting, and sending messages to be performed programmatically. One of the key advantages of the Reddit API is its extensive documentation and support.
🌐
AlpsCode
alpscode.com › blog › how-to-use-reddit-api
How to use Reddit API - AlpsCode
December 18, 2018 - After submitting the app details, we get a public key (right under the app name) and a secret key. This key pair is required to use the Reddit API. Based on which type of app you request, you may not get a secret key.
🌐
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 - More information about this library can be found here - PRAW – Python Reddit API Wrapper . To create an instance of PRAW we need to run the following code: ... 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:
Find elsewhere
🌐
n8n
docs.n8n.io › integrations › builtin › credentials › reddit
Reddit credentials | n8n Docs
The instructions below are for regular Reddit users, not members of the developer platform. Generate both by creating a third-party app. Visit the previous link or go to your profile > Settings > Safety & Privacy > Manage third-party app authorization > are you a developer?
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).

🌐
YouTube
youtube.com › watch
Reddit API Tutorial: How to Get Your API Keys in 2024 | Beginner's Guide - YouTube
Learn how to obtain your Reddit API keys with this step-by-step tutorial. Perfect for beginners and developers looking to integrate Reddit functionality into...
Published   July 24, 2024
🌐
JC Chouinard
jcchouinard.com › accueil › reddit api with python (complete guide)
Reddit API with Python (Complete Guide) - UPDATED 2024
April 4, 2025 - Reddit API is amazing! In this post, we are going to learn how to use the Reddit API with Python. We will cover everything. How to get your credentials and to use the API.
🌐
Reddit
reddit.com › r/learnprogramming › how do i create api keys for my api?
r/learnprogramming on Reddit: How do I create API keys for my API?
June 21, 2021 -

I need to add authentication so that when a user makes a request to the API the API will check if they are able to make requests. I’m not sure how API keys are created or how to make them useable though. Are there any good articles or videos I should watch to learn more about API keys?

Top answer
1 of 3
4
There are a couple of ways to do authentication and authorisation, and it's probably a good idea to read a bit about the different standards - for example, https://oauth.net/2/ or https://openid.net/connect/ . But just to give a rough idea of how these things happen: an API key can be as simple as a random string of characters that identify an authentication object in your database. When creating an API key, you: Generate a random string, e.g. a UUID Create an auth object Store the auth object in your database Store the API key in your database and make it point to your auth object via. a foreign key An auth object can look like this: { email: "[email protected]", username: "Johnnyboi", role: "Admin", canAccessApis: [ '/products', '/users', ... ], canDeleteOtherUsers: true, canDeleteOtherAdmins: false } ... you just put whatever information in there that you want. Then, you give that API key to the user and tell them to append it to every request they make to your API. Typically, the API key is included as a header called something like X-API-KEY. Then, in the backend at your API, on every request you: Extract the header in which the API key should be Look up the API key in your database and get the auth object it points to Use the auth object to check if the user is allowed to do what they want to do You typically write middleware for doing this so you don't have to copy that code for every endpoint you have. This is a very simple way of doing it, but will work just fine. Still, I strongly recommend reading up on some more sophisticated ways of doing it, such as OAuth2 or OIDC.
2 of 3
1
A simple way is to generate them as needed from a combination of a UUID and some extra (truly) random data. For example, I could make a UUID from the date and a 32-bit sequence number: YYYYMMDDSSSSSSSS Then use a truly random source (with entropy) to add like 96 bits (or more!) to that: YYYYMMDDSSSSSSSSRRRRRRRRRRRR Finally I would add a check digit or two so I can use javascript/php/whatever to verify validity without a db hit: YYYYMMDDSSSSSSSSRRRRRRRRRRRRCC Now you just have to make sure to protect the ever loving hell out of the database table that matches an internal ID number to each API key. You may wish to include a version or timestamp with that table so you can invalidate old keys, etc. When I would make registration keys for games I would include even more embedded info in the key, and I would jumble it deterministically. The program I used to generate them was written and used on an air-gapped machine and I would copy over batches of keys using a DVD burner. The key disks went into a safe. Other than all that it's just like any other authentication method. You use session handling code. The big thing is do not store your API keys in the same table as your customer data. Maybe not even the same database if perms are easier that way. I wouldn't even use the customer ID number in the table, instead I would have a third table with one customer id associated with many key id's. The idea being that a customer might have different level APIs for different aspects of their portal, and a hacker would have to breach all three databases to link an API key with that customer. For research: database security, true random numbers, check digits, possibly obfuscation, and session handling.
🌐
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.

🌐
Reddit
reddit.com › dev › api
reddit.com: api documentation
The return value of this function is a json object containing credentials for uploading assets to S3 bucket, S3 url for upload request and the key to use for uploading. Using this lease the client will upload the emoji image to S3 temp bucket (included as part of the S3 URL). This lease is used by S3 to verify that the upload is authorized. ... Set custom emoji size. Omitting width or height will disable custom emoji sizing. ... Get all emojis for a SR.
🌐
Reddit
reddit.com › r/chatgpt › using api keys: what you need to know (faq for non-devs)
r/ChatGPT on Reddit: Using API keys: What you need to know (FAQ for non-devs)
October 10, 2023 -

Do I need to be a developer to use an API key? No

Do I need some special knowledge? No, anyone can use it, either through the OpenAI playground (https://platform.openai.com/playground) or other 3rd party apps that allow you to use your key.

Where can I get my own API key? You need to register and log in here: https://platform.openai.com/account/api-keys you also need to set up your payment details with OpenAI to activate your API key.

What's an API key, and why do I need it? ChatGPT is great, but the app has only a limited set of features. OpenAI provides programmatic access to their models via the APIs so devs can use it to build other apps for any use case. An API key is like a personal password. When you use apps with your key, the usage will be billed to your account. The reason why it's become a popular model nowadays is because you only get to pay for what you use and avoid subscriptions.

How and when can I use it? An example could be getbeam.ai, a native ChatGPT app for Mac. This app provides an alternative ChatGPT UI and lets you use your API key. This means you only pay for what you use instead of paying some subscription or monthly fee.

How much does it cost? Is it expensive to use APIs? GPT-3.5 is very cheap; you can use it all day, every day, and your monthly bill will most likely stay under $5

- GPT-4 is more expensive (input: $0.03 / 1K tokens, output: $0.06 / 1K tokens), but it still depends on your usage.

I mostly use GPT-4 as a Google replacement for programming; my prompts are usually quite short, and I don't need 5000-word essays. So, my monthly bill has constantly stayed around $5. But I know some power users who spend $100+/mo

Is it safe to share my API key with 3rd party apps? Yes and No. If some bad actor gets access to your API key two things can happen: they'll use it, and you'll end up paying the bill. They misuse it, and your account can be banned.

The first can be mitigated by setting the spending limit so it will never exceed $20, for example.

If you're using apps from credible sources and have a spending limit on your account, you should be OK.

Can I have multiple API keys? Yes, you can generate multiple API keys. This can be useful if you want to track usage across different applications.

Can APIs replace ChatGPT? Not entirely. When OpenAI rolls out new features to ChatGPT, they're usually unavailable via the APIs immediately. They're not always in sync.

In summary, if you see 3rd party apps saying "Requires OpenAI API Key," it only takes a few clicks to set up. Be careful with how you manage your key to avoid potential misuse. Never share it with random people. Make sure to set the spending limit and only use apps that you can trust.

🌐
Reddit
reddit.com › r/learnjavascript › how do i get an api key?
r/learnjavascript on Reddit: How do I get an API key?
June 27, 2024 -

I m having an issue getting an API key for google maps. I just want a map integrated in my Application so a user can search the highlighted places but google seems to ask for a credit card which I dont have. If there are any other open source maps which give API keys. what can I do?

🌐
Coruzant
coruzant.com › home › web › reddit api key: what it is and how to use it in...
Reddit API Key: What It Is and How to Use It in 2025 - Coruzant Technologies
September 6, 2025 - What used to be simple token-based access now requires multiple authentication layers and ongoing compliance monitoring. Reddit API keys represent more than just access credentials – they define application permissions, usage limits, and billing structures that directly impact development costs and functionality. Getting ...