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/reddit/search',
headers={'Authorization': f'Bearer {API_KEY}'},
json={'query': query})
return r.json()["data"].get('results', [])Step 2: Pull comments for a thread
Pass the post URL or id.
import requests, os
API_KEY = os.environ['SCAVIO_API_KEY']
H = {'Authorization': f'Bearer {API_KEY}', 'Content-Type': 'application/json'}
def comments(post_id):
# post_id is the fullname (t3_...) or bare id from a search result.
r = requests.post('https://api.scavio.dev/api/v1/reddit/post/comments',
headers=H, json={'post_id': post_id})
r.raise_for_status()
return r.json()['data'].get('comments', [])
for c in comments('t3_1v6ngaf')[:5]:
print(c['author'], '-', c['text'][:80])Step 3: Monitor a subreddit
New posts in r/MachineLearning every hour.
def watch(subreddit):
r = requests.post('https://api.scavio.dev/api/v1/reddit/search',
headers={'Authorization': f'Bearer {API_KEY}'},
json={'query': f'subreddit:{subreddit}'})
return r.json()["data"].get('results', [])[: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/reddit/search',
headers={'Authorization': f'Bearer {API_KEY}'},
json={'query': query})
return r.json()["data"].get('results', [])
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/reddit/search', {
method: 'POST',
headers: { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({ query })
});
return (await r.json()).data.results;
}
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.