Fetch Reddit Posts
Reddit Integration
Fetch Reddit Posts
Fetch media posts from specified subreddits with filtering and sorting
POST
Fetch Reddit Posts
Overview
This endpoint fetches posts with media content from Reddit using the centralized Reddit service. It supports multiple subreddits, sorting options, time ranges, and URL exclusion for deduplication.Rate Limiting
This endpoint is protected by Reddit API rate limiting. The service handles Reddit’s rate limits with exponential backoff and jittered retries.Request Body
Comma-separated list of subreddit names. Can include
r/ prefix or not.Examples:"pics,aww,cats""r/pics,r/aww""pics"
Maximum number of posts to return (1-100)
Array of media URLs to exclude from results. Useful for pagination and deduplication.URLs are normalized before comparison to catch duplicates across different formats.
Reddit sorting method:
hot- Currently trending postsnew- Most recent poststop- Highest scoring posts
Time range for
top sorting:hour- Past hourday- Past 24 hoursweek- Past weekmonth- Past monthyear- Past yearall- All time
sortBy=topWhether to include text posts (posts without media URLs)
Response
Returns an array of Reddit posts with media content.Reddit post ID
Post title
Reddit username of the post author
Subreddit name (without
r/ prefix)Reddit post URL
Direct URL to the media content (image, GIF, or video)
Thumbnail image URL
Post score (upvotes minus downvotes)
Number of comments
Unix timestamp of post creation
Whether the post contains video content
Whether the post is marked as NSFW
Whether the post is marked as a spoiler
Examples
Basic Fetch
Fetch with Sorting and Time Range
Fetch with URL Exclusion (Pagination)
Include Text Posts
Response Example
Error Responses
No Valid Subreddits
Status:400 Bad Request
Reddit Service Not Configured
Status:503 Service Unavailable
No Media Found
Status:404 Not Found
Rate Limited
Status:429 Too Many Requests
Reddit API Error
Status:500 Internal Server Error
Notes
- The service automatically filters posts to only return those with media URLs
- Duplicate media URLs are automatically removed within a single response
- The endpoint fetches more posts than requested (typically 50+) to allow for filtering and exclusions
- Results are randomly sampled to provide variety
- Subreddit names are case-insensitive and normalized (strips
r/prefix, URLs, etc.) - The service caches Reddit API tokens and handles authentication automatically
- Jittered retry logic helps reduce transient Reddit API errors