Developer Guide

How to Fetch Reddit User Posts and History as JSON in 2026

Extracting user submissions and comment histories from Reddit is essential for sentiment tracking, author verification, and market research. Here is how to fetch clean, structured user JSON without OAuth headaches.

Need instant user data?

Get 30 free requests to test user profile and post history endpoints in seconds.

Get API Key →

The Problem With Legacy Reddit User Scraping

Historically, developers appended .json to a profile URL: https://www.reddit.com/user/username/submitted.json.

In 2026, this approach fails consistently on server environments:

  • Cloud IP Bans: AWS, DigitalOcean, and GCP datacenter IPs receive immediate 429 or 403 blocks.
  • Complex Pagination: Traversal requires passing cryptic after fullnames (t3_xxx) that frequently fail mid-scrape.
  • Payload Bloat: Raw Reddit user listings return hundreds of unused keys including award icons, flair templates, and deprecated styling objects.

Method 1: Using the REST API (curl & Python)

With SubScraper, fetching a user’s submissions is a simple POST request to /api/v1/user-posts. Rotating residential proxies are handled automatically behind the scenes.

fetch-user-posts.sh
cURL
curl -X POST https://www.subscraper.dev/api/v1/user-posts \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "username": "spez",
    "sort": "new",
    "limit": 25
  }'

Sample JSON Output

SubScraper normalizes the response into a predictable schema, isolating titles, scores, subreddits, and timestamps:

user-posts-response.json
Clean JSON
{
  "success": true,
  "data": [
    {
      "id": "1abcde",
      "title": "Thoughts on our latest platform updates",
      "subreddit": "announcements",
      "author": "spez",
      "score": 1240,
      "num_comments": 890,
      "created_utc": 1729000000,
      "url": "https://www.reddit.com/r/announcements/comments/1abcde/...",
      "selftext": "We are rolling out new developer tools today..."
    }
  ],
  "pagination": {
    "has_more": true,
    "next_cursor": "t3_1abcde"
  }
}

Method 2: Using the Official TypeScript SDK

If you are building in Node.js, Next.js, or Bun, the @subscraper/sdk package provides complete TypeScript types:

user-posts.ts
TypeScript SDK
import { SubScraperClient } from "@subscraper/sdk";

const client = new SubScraperClient({
  apiKey: process.env.SUBSCRAPER_API_KEY!,
});

async function getUserSubmissions(username: string) {
  // Fetch user posts
  const posts = await client.getUserPosts({
    username,
    sort: "new",
    limit: 50,
  });

  for (const post of posts.data) {
    console.log(`[${post.subreddit}] ${post.title} (Score: ${post.score})`);
  }
}

getUserSubmissions("samaltman");