Get posts from a specific subreddit.
Endpoint
/v1/reddit/subreddits/{subreddit}/posts
Path
Subreddit name, optional `r/` prefix, or Reddit subreddit URL. Must match Reddit's exact casing. Lists posts for this subreddit.
Query
Optional sort order for the returned posts.
Optional timeframe used with time-based sort orders.
Opaque pagination cursor from a previous response (`data.page.nextCursor`).
const response = await fetch( "https://api.socialfetch.dev/v1/reddit/subreddits/AskReddit/posts?sort=best", { headers: { "x-api-key": "YOUR_API_KEY" } } ); const data = await response.json(); console.log(data);