Fetch Posts From Any Subreddit by Sort
Fetch posts from any subreddit via a simple HTTP GET. Supports all Reddit sort tabs — New, Hot, Top, Rising, Controversial, Best — plus timeframe, cursor.
/api/reddit/posts$0.002 / callPosts from a subreddit. Supports all Reddit sort tabs: New / Hot / Top / Rising / Controversial / Best.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
subreddit | string | Yes | Subreddit name (no r/ prefix) |
sort | string | No | new (default) | hot | top | rising | controversial | best |
t | string | No | Timeframe for sort=top/controversial: hour | day | week | month | year | all |
limit | number | No | Number of posts to return, 1-100 (default 25) |
after | string | No | Pagination cursor (e.g. t3_xxx). Reddit caps any single listing at roughly 1000 posts — see Pagination depth below. |
Pagination depth
Reddit caps a single listing at roughly 1000 posts. Page past that and after
comes back null, even when the subreddit plainly holds more history.
This is a Reddit platform limit, not a limit we add, and it applies to every client hitting a listing — including reddit.com itself. We pass Reddit's cursor straight through, so when Reddit stops issuing one, pagination ends.
Measured on r/stocks, 100 posts per page:
| page | posts | cumulative | after |
|---|---|---|---|
| 1-9 | 100 | 900 | present |
| 10 | 83 | 983 | null |
The last page comes back partial and after comes back null, which looks
identical to genuinely reaching the end of a small subreddit. There is no field
that distinguishes the two, because the API is stateless and a single response
carries no notion of how deep you have paged. If you need to tell them apart,
track the cumulative count yourself: stopping near 1000 is the cap, stopping well
short of it is a genuinely exhausted listing.
Getting more than 1000 posts
Narrow the window rather than paging deeper. Each of these is a separate listing with its own ~1000 budget:
- Sort tabs —
new,hot,top,rising,controversial,besteach return a different listing. - Timeframes — pair
sort=topwitht=hour|day|week|month|year|allto slice history into chunks that individually stay under the cap. - Search —
/api/reddit/searchwith a query scoped to the subreddit reaches posts a listing will not.
Example
curl -H "Authorization: Bearer $TOKEN" \
"https://api.redditapis.com/api/reddit/posts?subreddit=ClaudeCode&sort=top&t=week"const response = await fetch(
"https://api.redditapis.com/api/reddit/posts?subreddit=ClaudeCode&sort=top&t=week",
{ headers: { Authorization: "Bearer TOKEN" } }
);
const data = await response.json();import requests
response = requests.get(
"https://api.redditapis.com/api/reddit/posts",
params={"subreddit": "ClaudeCode", "sort": "top", "t": "week"},
headers={"Authorization": "Bearer TOKEN"},
)Response Shape
{
"posts": [
{
"id": "1tkez6e",
"name": "t3_1tkez6e",
"title": "...",
"author": "user123",
"author_info": {
"fullname": "t2_ugmf7dmn",
"premium": false,
"is_blocked": false,
"flair": null
},
"permalink": "/r/ClaudeCode/comments/1tkez6e/...",
"url": "https://reddit.com/r/ClaudeCode/comments/1tkez6e/...",
"link_url": "https://i.redd.it/ec3ynsn66n2h1.png",
"text": "",
"subreddit": "ClaudeCode",
"upvotes": 42,
"comments": 12,
"upvote_ratio": 0.96,
"over_18": false,
"stickied": false,
"locked": false,
"spoiler": false,
"is_self": false,
"is_crosspost": true,
"crosspost_origin": {
"id": "1tkbqvk",
"name": "t3_1tkbqvk",
"title": "...",
"author": "Agitated_Usual7089",
"subreddit": "Class12thBoard",
"permalink": "/r/Class12thBoard/comments/1tkbqvk/...",
"url": "https://reddit.com/r/Class12thBoard/comments/1tkbqvk/...",
"created_utc": 1779435116,
"created": "2026-05-22T07:31:56.000Z"
},
"created_utc": 1779445765,
"created": "2026-05-22T10:29:25.000Z"
}
],
"after": "t3_xyz"
}Response Fields
| Field | Type | Notes |
|---|---|---|
id | string | Post id without prefix |
name | string | Full id with t3_ prefix — use as the after cursor |
title | string | Post title |
author | string | Username (no u/ prefix) |
author_info | object | { fullname, premium, is_blocked, flair }. fullname is the t2_xxx account id. flair is null when no flair is set, otherwise { text, type, background_color, text_color }. For karma / account age / profile icon call /api/reddit/user/:name. |
permalink | string | Path on reddit.com |
url | string | Full reddit.com URL |
link_url | string | null | External link / media URL the post points at. null for self/text posts since the post has no separate destination. |
text | string | Self-post body (empty for link/image posts) |
subreddit | string | Subreddit name (no r/ prefix) |
upvotes | number | Net votes (upvotes − downvotes). Reddit doesn't expose raw counts. |
comments | number | Comment count |
upvote_ratio | number | Approximate (Reddit fuzzes this for fresh posts) |
over_18, stickied, locked, spoiler | boolean | Post flags |
is_self | boolean | True for text/self posts |
is_crosspost | boolean | True if this post was crossposted from another subreddit |
crosspost_origin | object | null | When is_crosspost: true, the original post (id, name, title, author, subreddit, permalink, url, created_utc, created). null otherwise. |
created_utc | number | Unix epoch seconds |
created | string | ISO-8601 form of created_utc |
Independent third-party API for developers and researchers. Not affiliated with, endorsed by, or sponsored by Reddit, Inc.
Overview
Simple HTTP API for Reddit. Fetch posts, search communities, scrape comments, log in, comment, vote, and send DMs. Bearer auth, JSON, no OAuth.
Search Posts
Search Reddit posts globally or restrict to a subreddit — mirrors the Posts tab on reddit.com search. Supports sort, timeframe, NSFW filter, and pagination.
