RedditapisRedditapis
Posts

Get Reddit Post Comments by Permalink

Fetch the full comment tree for a Reddit post by permalink, every top-level comment, nested reply, upvotes, and author metadata in one HTTP GET call.

GET/api/reddit/comments$0.0015 / call

Full comment tree for a post. Returns a clean wrapper with the post, native Reddit comment tree nodes, and a pagination cursor.

Name the post however you hold it: its permalink, its URL, or its id. Pass exactly one of the first four parameters below.

Query Parameters

ParameterTypeRequiredDescription
permalinkstringOne of these fourPost permalink (e.g. /r/X/comments/abc/title/). A full Reddit URL here works too
urlstringOne of these fourAny reddit.com, www.reddit.com, old.reddit.com or redd.it post URL, e.g. https://www.reddit.com/r/X/comments/abc/title/ or https://redd.it/abc
post_idstringOne of these fourReddit post id (e.g. 1sgjld3); a t3_ prefix is optional
idstringOne of these fourSame as post_id
limitnumberNoMaximum top-level comments, 1-500 (default 100)
depthnumberNoMaximum reply depth, 1-10. depth=1 returns top-level comments only; absent, Reddit's full tree
sortstringNoconfidence (Reddit's best), top, new, controversial, old or qa; absent, Reddit's default

A URL is only read, never fetched: we take the post id or permalink out of it and read the thread from Reddit ourselves. A URL on any other host is refused with a 400. Reddit share links (/r/X/s/AbC123) do not contain the post id; open one in a browser and pass the URL it lands on.

A large thread is sized by these three knobs: limit=20&depth=1&sort=top reads the twenty best top-level comments and nothing below them. The response's meta block (limit_used, depth_used, sort_used) echoes what was applied, so a client can tell a small thread from a trimmed one.

Example

curl -H "Authorization: Bearer $TOKEN" \
  "https://api.redditapis.com/api/reddit/comments?permalink=/r/ClaudeCode/comments/1sgjld3/"
const response = await fetch(
  "https://api.redditapis.com/api/reddit/comments?permalink=/r/ClaudeCode/comments/1sgjld3/",
  { headers: { Authorization: "Bearer TOKEN" } }
);
import requests

response = requests.get(
    "https://api.redditapis.com/api/reddit/comments",
    params={"permalink": "/r/ClaudeCode/comments/1sgjld3/"},
    headers={"Authorization": "Bearer TOKEN"},
)

With a URL or an id:

curl -H "Authorization: Bearer $TOKEN" \
  "https://api.redditapis.com/api/reddit/comments?url=https://redd.it/1sgjld3"

curl -H "Authorization: Bearer $TOKEN" \
  "https://api.redditapis.com/api/reddit/comments?post_id=t3_1sgjld3"

Errors

Every 400 carries a stable code to branch on and a hint naming what to send instead. error keeps its wording, so existing checks still match.

StatuscodeMeaning
400PERMALINK_REQUIREDNone of permalink, url, post_id or id was given
400INVALID_PARAMpermalink is not a post permalink, or limit, depth or sort is out of range
400NOT_A_REDDIT_URLThe URL is not on reddit.com or redd.it
400NOT_A_POST_URLA Reddit URL that does not point at a post
400SHARE_LINK_UNSUPPORTEDA Reddit share link, which does not contain the post id
400INVALID_POST_IDpost_id or id is not a post id (a t1_ comment id, for example)
400CONFLICTING_PARAMSTwo of url, post_id and id name different posts
401Missing Bearer token
402Out of credits, see rate limits and errors
403Invalid Bearer token
{
  "error": "permalink is required",
  "code": "PERMALINK_REQUIRED",
  "field": "permalink",
  "hint": "Pass one of permalink=/r/<subreddit>/comments/<id>/<slug>/, url=<a reddit.com, old.reddit.com, www.reddit.com or redd.it post URL>, post_id=<id> or id=<id> (a t3_ prefix is optional)"
}

Response Shape

{
  "post": { "...": "same post shape as /api/reddit/post/:id" },
  "comments": [
    {
      "kind": "t1",
      "data": { "id": "abc", "body": "...", "author": "user123" }
    }
  ],
  "after": null
}

comments is Reddit's native comment tree, each node has kind: "t1" and data.replies containing child comments. post follows the posts field shape.

after is always empty here, and it means nothing

A comment thread is not a paged listing. Reddit gives no usable cursor for one, so after comes back null on a four-comment thread and on a four-thousand comment thread alike. If you read it the way you read a listing cursor, every thread looks complete.

The response tells you what it actually knows, in two extra fields:

FieldValuesMeaning
listing_statustruncated | unknownNever complete. Without a cursor to page, we will not claim you have the whole thread.
exhausted_reasoncomment_tree_more | comment_treecomment_tree_more means Reddit marked a branch as cut short, so there are definitely comments you did not get. comment_tree means we saw no such marker, which is not proof the thread is whole.

A cut-short branch appears in comments as a node with kind: "more", carrying the ids of what was left out. See fetching by post id for how to read those.

Fetch by post ID instead of permalink

If you already have the post ID and not the full permalink, call the ID form. It returns the exact same response shape at the same price, so you never have to build a permalink just to read a thread.

GET/api/reddit/comments/{postId}$0.0015 / call
ParameterTypeRequiredDescription
postIdstringYesReddit post id (e.g. 1sgjld3)
curl -H "Authorization: Bearer $TOKEN" \
  "https://api.redditapis.com/api/reddit/comments/1sgjld3"

This is an alias of GET /api/reddit/post/{postId}/comments, both run the same handler. All three of these return the same thing:

URL shapeUse when
GET /api/reddit/comments?permalink=/r/{sub}/comments/{postId}/You have the permalink
GET /api/reddit/post/{postId}/commentsYou have the post ID
GET /api/reddit/comments/{postId}You have the post ID

Adding the ID form did not change the permalink form above; it still works exactly as documented, and existing integrations need no changes.

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

On this page