Near-real-time Reddit posts via public Atom RSS feeds.
No credentials required.
uv run python examples/reddit_example.pyfrom streams.reddit import RedditStream
stream = RedditStream(subreddits=["python", "technology"])
await stream.start()
async for event in stream:
post = event.payload
print(f"Post: {post.title} in r/{post.subreddit}")| Field | Type | Description |
|---|---|---|
id |
str |
Reddit submission ID (e.g. abc123) |
subreddit |
str |
Subreddit name |
title |
str |
Post title |
author |
str |
Username (without /u/ prefix) |
permalink |
str |
Full reddit.com URL |
description |
str |
HTML body / selftext excerpt |
created_utc |
datetime |
Submission time (UTC) |
- Polls
/r/{subreddit}/new/.rss?limit=25for each configured subreddit every 60 seconds - Deduplicates by post ID across polls — each post is emitted exactly once
- Uses
xml.etree.ElementTree(stdlib) to parse the Atom feed; no third-party Reddit library - When
subreddits=None, streams from a built-in list of 100 tech/data/AI subreddits
# .env (optional — a sensible default is used automatically)
REDDIT_USER_AGENT=my-app/1.0 (contact@example.com)- Comments are not available via this approach (they require per-post API requests)
- New posts typically appear within 60–120 seconds (one to two poll cycles)
- Reddit may throttle anonymous RSS requests on busy subreddits; the client logs warnings and continues