Overview
Available credits
Base rate
Rate limit
API key
No active key
Send it in the x-api-key header. Keys in the URL are rejected.
Production Batch Starter Scripts & Quickstart
Copy-Paste Production Scripts
Start scraping Reddit in 30 seconds
Paginates hot/top posts from any subreddit using next_cursor (up to 100 posts/call).
GET /v1/subreddit/posts · Python
import csv, requests
API_KEY = "rd_live_your_api_key"
posts, cursor = [], None
while len(posts) < 500:
params = {"subreddit": "saas", "sort": "hot", "limit": 100}
if cursor:
params["cursor"] = cursor
res = requests.get(
"https://api.redditdataapi.io/v1/subreddit/posts",
params=params,
headers={"x-api-key": API_KEY},
timeout=30,
).json()
data = res.get("data") or {}
items = data.get("items") or []
if not items:
break
posts.extend(items)
if not data.get("has_more") or not data.get("next_cursor"):
break
cursor = data["next_cursor"]
with open("reddit_posts.csv", "w", newline="", encoding="utf-8") as f:
w = csv.DictWriter(f, fieldnames=["id", "subreddit", "author", "score", "num_comments", "title"])
w.writeheader()
for p in posts:
w.writerow({k: p.get(k) for k in ["id", "subreddit", "author", "score", "num_comments", "title"]})
print(f"Saved {len(posts)} posts to reddit_posts.csv")