Reddit API Application

Version: 1.0.0

About This Service

Redirect service for handling Reddit API OAuth validation

This service runs on Cloudflare Workers and is used to handle the Reddit API OAuth validation process.

How to Use

1. Create an Application on Reddit Developer Platform

Visit Reddit App Preferences to create a new application.

When creating the application, set the following URL as the redirect URI:

https://reddit.7makj.com/redirect

2. Get Authorization Code

Build an authorization URL using the following format:

https://www.reddit.com/api/v1/authorize?client_id=YOUR_CLIENT_ID&response_type=code&state=RANDOM_STRING&redirect_uri=https://reddit.7makj.com/redirect&duration=permanent&scope=identity read

3. Use Authorization Code to Get Access Token

In your application, use the authorization code to request an access token from the Reddit API:

POST https://www.reddit.com/api/v1/access_token

Request Headers:

Authorization: Basic base64(YOUR_CLIENT_ID:YOUR_CLIENT_SECRET)
Content-Type: application/x-www-form-urlencoded

Request Body:

grant_type=authorization_code&code=AUTHORIZATION_CODE&redirect_uri=https://reddit.7makj.com/redirect

Important Notes