TypeScript SDK

The official SubScraper SDK is the easiest way to interact with Reddit data in your Node.js or browser applications. It provides full TypeScript types and a clean, promise-based API.

Installation

npm install @subscraper/sdk

Getting Started

First, get your API key from the dashboard. Then initialize the client:

import { SubScraperClient } from '@subscraper/sdk';

const client = new SubScraperClient({
  apiKey: 'sk-your-api-key-here' // Get this from your dashboard
});

Example: Search Posts

// Search Reddit posts by keyword
const result = await client.searchPosts({
  query: 'nextjs',
  limit: 3,
  sort: 'top',
  time: 'year'
});

console.log(result.results);

Example: Get User Profile

// Fetch user karma, bio, and account age
const profile = await client.getUserProfile({
  username: 'shittymorph'
});

console.log(`Total Karma: ${profile.karma.post + profile.karma.comment}`);