Reddit's 2023 API pricing change made bulk Reddit access prohibitively expensive for most startups. Scavio's Reddit endpoint proxies the public Reddit data layer with no OAuth and no per-app rate caps. This tutorial walks through the common patterns: post search, comment threads, and subreddit monitoring.
Prerequisites
- Python 3.10+
- A Scavio API key
- A subreddit or query target
Walkthrough
Step 1: Search posts by query
Scavio returns Reddit posts ranked by relevance or recency.
import requests, os
API_KEY = os.environ['SCAVIO_API_KEY']
def search(query, time='month'):
r = requests.post('https://api.scavio.dev/api/v1/search',
headers={'x-api-key': API_KEY},
json={'platform': 'reddit', 'query': query, 'time': time})
return r.json().get('posts', [])Step 2: Pull comments for a thread
Pass the post URL or id.
def comments(post_url):
r = requests.post('https://api.scavio.dev/api/v1/search',
headers={'x-api-key': API_KEY},
json={'platform': 'reddit_comments', 'query': post_url})
return r.json().get('comments', [])Step 3: Monitor a subreddit
New posts in r/MachineLearning every hour.
def watch(subreddit):
r = requests.post('https://api.scavio.dev/api/v1/search',
headers={'x-api-key': API_KEY},
json={'platform': 'reddit', 'query': f'subreddit:{subreddit}', 'sort': 'new'})
return r.json().get('posts', [])[:25]Step 4: Filter for buyer intent
Regex for 'looking for', 'recommend', 'alternative'.
import re
BUYER = re.compile(r'\b(looking for|recommend|alternative to|help me)\b', re.I)
def intent(posts):
return [p for p in posts if BUYER.search(p.get('title', '') + p.get('selftext', ''))]Step 5: Write to a CSV for SDRs
One row per intent signal.
import csv
def export(posts):
with open('reddit_intent.csv', 'w') as f:
w = csv.DictWriter(f, fieldnames=['title', 'url', 'subreddit'])
w.writeheader(); w.writerows(posts)Python Example
import os, requests
API_KEY = os.environ['SCAVIO_API_KEY']
def reddit(query):
r = requests.post('https://api.scavio.dev/api/v1/search',
headers={'x-api-key': API_KEY},
json={'platform': 'reddit', 'query': query, 'time': 'week'})
return r.json().get('posts', [])
for p in reddit('looking for serp api')[:10]:
print(p['title'], p['url'])JavaScript Example
const API_KEY = process.env.SCAVIO_API_KEY;
export async function reddit(query) {
const r = await fetch('https://api.scavio.dev/api/v1/search', {
method: 'POST',
headers: { 'x-api-key': API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({ platform: 'reddit', query, time: 'week' })
});
return (await r.json()).posts;
}
const posts = await reddit('looking for serp api');
console.log(posts.slice(0, 10));Expected Output
25 posts per subreddit watch, filtered to ~3-5 buyer-intent signals. Typical SDR workflow: 10 minutes/day, 5-15 qualified leads per week.