Search & Discovery

How to Search Reddit and Get Clean JSON in 2026

Programmatic Reddit search is crucial for brand monitoring, market research, and training AI models. Here is how to execute keyword searches across Reddit discussions and parse clean JSON payloads in minutes.

Try the Search Endpoint Free

Sign up in 30 seconds to get 30 free requests. No credit card required.

Start Free →

The Problem With Scraping Reddit Search URLs

In older workflows, developers queried URLs like https://www.reddit.com/search.json?q=query directly. Today, Reddit enforces:

  • Aggressive IP Rate Limits: After as few as 10 queries, server IPs receive 429 Too Many Requests.
  • Cryptic JSON Formats: Responses wrap results in nested data.children[].data structures with irrelevant styling data.
  • OAuth Token Overhead: Official Reddit API mandates OAuth token handshakes, secret keys, and client verification.

Executing a Search Request with SubScraper

SubScraper’s /api/v1/search endpoint accepts clean JSON parameters for query, sorting (relevance, top, new), timeframe, and optional subreddit filtering:

search-reddit.sh
cURL
curl -X POST https://www.subscraper.dev/api/v1/search \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "best mcp servers cursor",
    "sort": "top",
    "time": "month",
    "limit": 20
  }'

Clean JSON Response Schema

The response isolates essential conversational fields, making it immediately readable by frontend apps and LLM prompt pipelines:

search-response.json
Clean JSON
{
  "success": true,
  "data": [
    {
      "id": "1mcp01",
      "title": "Comprehensive Guide to Building MCP Servers in 2026",
      "author": "agent_builder",
      "subreddit": "ArtificialInteligence",
      "score": 834,
      "num_comments": 142,
      "created_utc": 1729000000,
      "url": "https://www.reddit.com/r/ArtificialInteligence/comments/1mcp01/...",
      "selftext": "Model Context Protocol has become the standard..."
    }
  ],
  "pagination": {
    "has_more": true,
    "next_cursor": "t3_1mcp01"
  }
}

TypeScript SDK Integration

If your codebase uses TypeScript, you can query Reddit discussions with typed arguments and responses:

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

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

async function runSocialListening() {
  // Search Reddit globally or within specific subreddits
  const results = await client.search({
    query: "Claude 3.5 Sonnet vs GPT-4o",
    sort: "relevance",
    time: "week",
    limit: 10,
  });

  console.log(`Found ${results.data.length} discussions:`);
  for (const post of results.data) {
    console.log(`• [${post.subreddit}] ${post.title} (Score: ${post.score})`);
  }
}

runSocialListening();