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.
/api/reddit/comments$0.0015 / callFull 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
| Parameter | Type | Required | Description |
|---|---|---|---|
permalink | string | One of these four | Post permalink (e.g. /r/X/comments/abc/title/). A full Reddit URL here works too |
url | string | One of these four | Any 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_id | string | One of these four | Reddit post id (e.g. 1sgjld3); a t3_ prefix is optional |
id | string | One of these four | Same as post_id |
limit | number | No | Maximum top-level comments, 1-500 (default 100) |
depth | number | No | Maximum reply depth, 1-10. depth=1 returns top-level comments only; absent, Reddit's full tree |
sort | string | No | confidence (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.
| Status | code | Meaning |
|---|---|---|
400 | PERMALINK_REQUIRED | None of permalink, url, post_id or id was given |
400 | INVALID_PARAM | permalink is not a post permalink, or limit, depth or sort is out of range |
400 | NOT_A_REDDIT_URL | The URL is not on reddit.com or redd.it |
400 | NOT_A_POST_URL | A Reddit URL that does not point at a post |
400 | SHARE_LINK_UNSUPPORTED | A Reddit share link, which does not contain the post id |
400 | INVALID_POST_ID | post_id or id is not a post id (a t1_ comment id, for example) |
400 | CONFLICTING_PARAMS | Two of url, post_id and id name different posts |
401 | Missing Bearer token | |
402 | Out of credits, see rate limits and errors | |
403 | Invalid 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:
| Field | Values | Meaning |
|---|---|---|
listing_status | truncated | unknown | Never complete. Without a cursor to page, we will not claim you have the whole thread. |
exhausted_reason | comment_tree_more | comment_tree | comment_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.
/api/reddit/comments/{postId}$0.0015 / call| Parameter | Type | Required | Description |
|---|---|---|---|
postId | string | Yes | Reddit 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 shape | Use when |
|---|---|
GET /api/reddit/comments?permalink=/r/{sub}/comments/{postId}/ | You have the permalink |
GET /api/reddit/post/{postId}/comments | You 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.
Bulk posts by ID (up to 100)
Bulk-fetch posts by comma-separated t3_ fullnames, up to 100 per call. Hydrate post IDs you already have, or backfill fields, without one request per post.
Comment Tree by Post ID
Fetch a Reddit post together with its full comment tree using only the post id. No permalink to build, same response shape and same price as the permalink form.
