RedditapisRedditapis
Listings & Search

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.

GET/api/reddit/posts$0.002 / call

Posts from a subreddit. Supports all Reddit sort tabs: New / Hot / Top / Rising / Controversial / Best.

Query Parameters

ParameterTypeRequiredDescription
subredditstringYesSubreddit name (no r/ prefix)
sortstringNonew (default) | hot | top | rising | controversial | best
tstringNoTimeframe for sort=top/controversial: hour | day | week | month | year | all
limitnumberNoNumber of posts to return, 1-100 (default 25)
afterstringNoPagination 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:

pagepostscumulativeafter
1-9100900present
1083983null

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 tabsnew, hot, top, rising, controversial, best each return a different listing.
  • Timeframes — pair sort=top with t=hour|day|week|month|year|all to slice history into chunks that individually stay under the cap.
  • Search/api/reddit/search with 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

FieldTypeNotes
idstringPost id without prefix
namestringFull id with t3_ prefix — use as the after cursor
titlestringPost title
authorstringUsername (no u/ prefix)
author_infoobject{ 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.
permalinkstringPath on reddit.com
urlstringFull reddit.com URL
link_urlstring | nullExternal link / media URL the post points at. null for self/text posts since the post has no separate destination.
textstringSelf-post body (empty for link/image posts)
subredditstringSubreddit name (no r/ prefix)
upvotesnumberNet votes (upvotes − downvotes). Reddit doesn't expose raw counts.
commentsnumberComment count
upvote_rationumberApproximate (Reddit fuzzes this for fresh posts)
over_18, stickied, locked, spoilerbooleanPost flags
is_selfbooleanTrue for text/self posts
is_crosspostbooleanTrue if this post was crossposted from another subreddit
crosspost_originobject | nullWhen is_crosspost: true, the original post (id, name, title, author, subreddit, permalink, url, created_utc, created). null otherwise.
created_utcnumberUnix epoch seconds
createdstringISO-8601 form of created_utc

Independent third-party API for developers and researchers. Not affiliated with, endorsed by, or sponsored by Reddit, Inc.

On this page