Reddit

Reddit Subreddit Posts

Get a subreddit's posts by name or URL. Sort by hot, new, top, rising or controversial, with a time window (past hour to all time) for top and controversial, and optionally only posts with one flair. Returns title, text, author, date, score, upvote ratio, comment count, flair, shared link, video and gallery links and NSFW flags for each post, 25 per page, up to about 1,000 posts. Works for NSFW subreddits. Supports fetching multiple pages in a single API call (billed per page).

Price: $0.003 per page. Free tier: 50 requests/month.

get/v1/reddit/subreddit/posts

Request

  • Base URL: https://apidirect.io
  • URL: https://apidirect.io/v1/reddit/subreddit/posts
  • Auth: API key in header X-API-Key

Query parameters

subredditstring

Subreddit name, with or without r/, e.g. Python. Provide exactly one of subreddit or url.

urlstring

Subreddit URL, e.g. https://www.reddit.com/r/Python/ (max 500 characters). Provide exactly one of subreddit or url.

sort_by'hot' | 'most_recent' | 'top' | 'rising' | 'controversial'

Sort order: hot, most_recent, top, rising, or controversial (default: hot)

posted_ago'1h' | '24h' | '7d' | '30d' | '12m' | 'all'

Time window for sort_by=top or sort_by=controversial: 1h, 24h, 7d, 30d, 12m, or all (default: 24h, Reddit's own default). Rejected with any other sort_by.

flairstring

Only posts with exactly this flair, e.g. Hiring (max 64 characters, not case-sensitive).

pagesinteger

Number of pages to fetch, 1-40 (default: 1). Each page returns up to 25 posts.

get_sentimentboolean

Set to true to add AI emotion analysis to each post (returned in the posts array). Adds a sentiment object containing emotions (joy, trust, fear, surprise, sadness, disgust, anger and anticipation, each scored 0-100), dominant_emotion, emotional_intensity (0-10), and polarity (positive, negative or neutral). Any post that cannot be scored returns sentiment: null.

Response

Successful response

subredditstring nullable
sort_bystring nullable
pagesnumber nullable
countnumber nullable

Changes

No recorded changes to this operation across all 1 revision of this API.