Skip to content
For Reddit Data API apps

Build on the Reddit Data API from the browser, the way Reddit expects

Reddit's API needs an OAuth token and a descriptive User-Agent, and the browser lets you send neither safely. ProxifyEdge keeps the token on the server and sets the User-Agent for you.

Browser console, calling the API directly

Access to fetch at 'https://oauth.reddit.com/r/webdev/hot' from origin 'https://your-app.example.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

The same request through ProxifyEdge
HTTP/2 200
access-control-allow-origin: https://your-app.example.com
x-proxify-ratelimit-remaining: 9999

Two things the browser can't do for you

Reddit's Data API authenticates with OAuth and asks every client to identify itself with a unique, descriptive User-Agent. Browsers don't let page code set User-Agent, and an OAuth token in front-end code can be read by anyone.

Depending on the endpoint, calls made straight from the page can also fail the browser's CORS check, so most guides end with 'build a backend'.

How ProxifyEdge helps

Configured from the dashboard, enforced on every request.

  • OAuth token in the vault

    Store the access token as a secret and send a {{secret.NAME}} placeholder. The real token is inserted on the server.

  • Only sent to Reddit

    Bind the secret to oauth.reddit.com and ProxifyEdge refuses to send it anywhere else.

  • A proper User-Agent

    Send X-Proxify-Set-User-Agent and ProxifyEdge sets the real User-Agent header upstream, which browsers otherwise forbid.

  • Stay inside the limits

    Per-key rate limits and quotas help keep your app within Reddit's request limits.

  • Locked to your app

    A live key only answers your app's origins, so other sites can't use your token through it.

  • Replay while developing

    Record responses while you build so you aren't calling the API on every reload.

Example

An authenticated listing request

  • Register an app in your Reddit account preferences and obtain an OAuth access token.
  • Access tokens expire. Refresh the token with Reddit and update the secret in the dashboard.
  • Bind the secret to oauth.reddit.com so it is never sent to any other host.
Proxy reference
reddit.ts
const target = 'https://oauth.reddit.com/r/webdev/hot?limit=10';

const res = await fetch(`https://api.proxifyedge.com/proxy?url=${encodeURIComponent(target)}`, {
  headers: {
    'X-API-Key': 'pk_your_public_key',
    'X-Proxify-Upstream-Authorization': 'Bearer {{secret.REDDIT_ACCESS_TOKEN}}',
    // Browsers can't set User-Agent; ProxifyEdge sets it upstream from this header.
    'X-Proxify-Set-User-Agent': 'web:com.example.your-app:v1.0 (by /u/your_username)',
  },
});
const listing = await res.json();

Questions

Something else? Get in touch or read the docs.

Can I read Reddit without OAuth?

Reddit's Data API Terms govern how its data may be accessed and used. Use OAuth and follow those terms; ProxifyEdge doesn't change what you are allowed to do.

Why do I need a custom User-Agent?

Reddit asks every API client to send a unique, descriptive User-Agent, and may limit clients that don't. Browsers block page code from setting it, so ProxifyEdge sets it for you from X-Proxify-Set-User-Agent.

Can ProxifyEdge refresh my Reddit token?

No. ProxifyEdge stores and inserts the token you give it. Refresh it with Reddit and replace the secret.

Is ProxifyEdge affiliated with Reddit?

No. ProxifyEdge is an independent service that forwards the requests you make with your own Reddit app credentials.

Use the Reddit Data API under Reddit's Data API Terms and Developer Terms, including their rate limits and their rules on commercial use and data retention. ProxifyEdge is not affiliated with Reddit.

Make the request your browser was blocking.

Create an account, lock your key to your site, and send your first request through ProxifyEdge.

Are you sure?