Reddit API

⭐ Beginner's Pick Social / OAuth Advanced HTTPS
Varies by plan (check documentation)

Overview

Reddit API provides access to posts, comments, subreddits, and user data from one of the world's largest discussion platforms. It uses OAuth 2.0 and has a well-documented REST interface, making it a popular choice for social data projects. Note that Reddit updated its API pricing in 2023, so check current rate limits and terms before building production apps.

💡

Beginner Tip

You can test many Reddit endpoints without OAuth by appending .json to any Reddit URL (e.g., reddit.com/r/programming.json) — this is perfect for learning the data structure before setting up full authentication.

Available Data

Use case: Integrate homepage of the internet data into web and mobile applications
Reddit data via REST API
JSON-formatted response data
Requires OAuth authentication

Example Response

JSON Response
{
  "status": "success",
  "data": {
    "result": "Data from Reddit",
    "description": "Homepage of the internet",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

data.children Array of post or comment objects wrapped in kind and data properties
data.children[].data.title Title of the Reddit post
data.children[].data.score Net upvote score (upvotes minus downvotes)
data.children[].data.author Username of the post author
data.children[].data.url URL that the post links to, or the post's own permalink for text posts
data.after Pagination token — pass as the after parameter to get the next page of results

Implementation Example

// ⚠️ Note: This URL may be a documentation page. Check official docs for actual API endpoint.
const url = "https://www.reddit.com/dev/api";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "Authorization": "Bearer YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

401 Unauthorized OAuth token is missing or your app credentials are wrong
Register your app at reddit.com/prefs/apps and use the client_id and client_secret to get an OAuth token via the /api/v1/access_token endpoint
429 Too Many Requests Exceeding Reddit's rate limit of 60 requests per minute for OAuth apps
Add a User-Agent header identifying your app and slow requests to stay under the limit; Reddit blocks clients without a proper User-Agent
403 Forbidden Trying to access a private subreddit or an endpoint that requires specific OAuth scopes
Ensure the subreddit is public, or request the correct scope (e.g., read, identity) during OAuth authorization

Matrix Score Breakdown

🌐 Reachability 0/30
⚡ Speed 10/20
🔒 Security 15/15
🛠 Developer XP 3/20
✓ Reliability 0/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth OAuth
HTTPS REQUIRED
CORS UNKNOWN
Category Social
Difficulty Advanced
Verified: 2026-04-04

Similar APIs

View All →