Back to Blog
General

Reddit Scraper API: Extract Subreddits, Posts, Comments & Ads

February 23, 2026
5 min read
S
By SociaVault Team
redditscraper apisubredditcommentssocial media data

Reddit Scraper API: Extract Reddit Data for Research & Analysis

Reddit is a goldmine for market research, product feedback, and sentiment analysis. This guide shows you how to scrape subreddits, posts, comments, and ads.

Reddit API Endpoints

EndpointDescription
SubredditGet posts from a subreddit
Post CommentsGet comments from a post
Simple CommentsGet limited comments easily
SearchSearch Reddit posts
Ads SearchSearch Reddit ads
Ad DetailsGet specific ad info

Subreddit Scraper

Get posts from any subreddit:

const response = await fetch('https://api.sociavault.com/reddit/subreddit', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    name: 'programming'
  })
});

const subreddit = await response.json();

Response

{
  "subreddit": {
    "name": "programming",
    "title": "programming",
    "description": "Computer Programming",
    "subscribers": 5800000,
    "activeUsers": 12500
  },
  "posts": [
    {
      "id": "abc123",
      "title": "Why I switched from Python to Rust",
      "author": "rust_evangelist",
      "upvotes": 2500,
      "downvotes": 150,
      "comments": 450,
      "url": "https://www.reddit.com/r/programming/comments/abc123",
      "createdAt": "2026-01-08T10:30:00Z",
      "flair": "Discussion",
      "isStickied": false,
      "awards": 5
    }
  ],
  "hasMore": true
}

Post Comments Scraper

Get all comments from a Reddit post:

const response = await fetch('https://api.sociavault.com/reddit/post/comments', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    url: 'https://www.reddit.com/r/programming/comments/abc123'
  })
});

const comments = await response.json();

Response

{
  "comments": [
    {
      "id": "xyz789",
      "text": "I made the same switch last year and never looked back!",
      "author": "developer123",
      "upvotes": 350,
      "createdAt": "2026-01-08T11:00:00Z",
      "replies": [
        {
          "id": "xyz790",
          "text": "What was your biggest challenge?",
          "author": "curious_dev",
          "upvotes": 45
        }
      ]
    }
  ],
  "totalComments": 450
}

Simple Comments

Get a specific number of comments with a cleaner response:

const response = await fetch('https://api.sociavault.com/reddit/post/comments/simple', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    url: 'https://www.reddit.com/r/programming/comments/abc123',
    amount: 50
  })
});

Search Reddit

Search posts across Reddit:

const response = await fetch('https://api.sociavault.com/reddit/search', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    query: 'best API tools 2026'
  })
});

const results = await response.json();

Reddit Ads

Search and analyze Reddit ads:

// Search ads
const adsSearch = await fetch('https://api.sociavault.com/reddit/ads/search', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    query: 'saas'
  })
});

// Get ad details
const adDetails = await fetch('https://api.sociavault.com/reddit/ads', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    id: 'ad_id_here'
  })
});

Use Cases

Product Research

Analyze what people say about products:

async function researchProduct(productName) {
  const results = await searchReddit(productName);
  
  // Analyze sentiment
  const posts = results.posts;
  const sentiment = posts.map(p => ({
    title: p.title,
    upvotes: p.upvotes,
    sentiment: analyzeSentiment(p.title)
  }));
  
  return sentiment;
}

Market Research

Find trending topics in a niche:

async function analyzeTrends(subredditName) {
  const { posts } = await getSubreddit(subredditName);
  
  // Find trending topics
  const topics = {};
  posts.forEach(post => {
    const words = post.title.toLowerCase().split(/\s+/);
    words.forEach(w => {
      if (w.length > 4) topics[w] = (topics[w] || 0) + post.upvotes;
    });
  });
  
  return Object.entries(topics)
    .sort((a, b) => b[1] - a[1])
    .slice(0, 20);
}

Competitor Analysis

Track mentions of competitors:

async function trackCompetitors(competitors) {
  const mentions = {};
  
  for (const competitor of competitors) {
    const results = await searchReddit(competitor);
    mentions[competitor] = {
      totalPosts: results.posts.length,
      totalUpvotes: results.posts.reduce((s, p) => s + p.upvotes, 0),
      sentiment: results.posts.filter(p => p.upvotes > 0).length / results.posts.length
    };
  }
  
  return mentions;
}

Customer Feedback Mining

Extract feedback from relevant subreddits:

async function mineFeedback(subreddits, keywords) {
  const feedback = [];
  
  for (const sub of subreddits) {
    const { posts } = await getSubreddit(sub);
    
    const relevant = posts.filter(p =>
      keywords.some(k => p.title.toLowerCase().includes(k))
    );
    
    for (const post of relevant) {
      const { comments } = await getPostComments(post.url);
      feedback.push({
        post: post.title,
        comments: comments.slice(0, 10)
      });
    }
  }
  
  return feedback;
}

Ad Research

Analyze competitor advertising:

async function analyzeAds(keyword) {
  const ads = await searchAds(keyword);
  
  const analysis = ads.map(ad => ({
    headline: ad.headline,
    targeting: ad.subreddits,
    creative: ad.imageUrl
  }));
  
  return analysis;
}

Frequently Asked Questions

Can I scrape private subreddits?

No, only public subreddits are accessible. Private communities require membership.

How far back can I get posts?

You can access historical posts through pagination, though Reddit's search has limitations on very old content.

Are NSFW subreddits supported?

The API focuses on SFW content. NSFW subreddits may have limited access.

Can I get user post history?

Currently, the API focuses on subreddit and post-based scraping. User profiles aren't directly supported.

How does this compare to Reddit's official API?

SociaVault provides similar data access without Reddit's strict rate limits and API key requirements.

Get Started

Sign up free and start extracting Reddit data.

Documentation: /docs/api-reference/reddit/subreddit

Found this helpful?

Share it with others who might benefit

Ready to Try SociaVault?

Start extracting social media data with our powerful API. No credit card required.