Reddit Comment Permalink API - Get a Comment

Single comment with parent context and replies

Retrieve a specific comment by its full Reddit permalink, including parent post context, ancestors, and nested replies. A comment whose post doesn't exist (or is no longer on Reddit at all) returns 404, and so does one in a community that doesn't exist or is banned; a post in a private, quarantined or premium-only community returns 403. Both carry error and code (not_found or forbidden), and neither costs a credit. A post that was removed or deleted still returns 200, with removed: true. Only a 503 is worth retrying.

POST /comment-permalink Content
https://api.fetchlayer.dev/reddit/comment-permalink
OpenAPI JSON

Headers

Authorization string required

Bearer token — your FetchLayer API key.

Parameters

url string required

Full Reddit comment permalink URL.

pages integer optional

Number of comment pages to expand. A comment-permalink call is billed 1 credit, whatever the pages. (default: 1)

Response Fields

comment-permalink

Single comment with parent context and replies

requestedUrl string

The Reddit URL the request was for.

finalUrl string

Final URL after redirects.

listingType string

Always comment-permalink for a successful response.

commentId string

Requested comment ID without the t1_ prefix.

postId string | null

Parent post ID.

subreddit string | null

Parent subreddit name.

subredditPrefixed string | null

Parent subreddit name with r/ prefix.

postTitle string | null

Parent post title.

postAuthor string | null

Parent post author.

postPermalink string | null

Absolute parent post permalink.

postUrl string | null

Parent post content URL.

focalCommentFound boolean

Whether the requested comment was found in the expanded tree.

focalComment object | null

Requested comment with nested children, or null when not found.

focalComment.id string | null

Focal comment ID.

focalComment.fullname string | null

Focal comment fullname.

focalComment.parentFullname string | null

Parent Reddit fullname.

focalComment.author string | null

Focal comment author.

focalComment.score number | null

Focal comment score.

focalComment.scoreText string | null

Focal comment score text.

focalComment.createdAt string | null

ISO 8601 comment creation timestamp.

focalComment.bodyText string

Plain-text focal comment body.

focalComment.bodyHtml string | null

HTML focal comment body.

focalComment.permalink string | null

Absolute focal comment permalink.

focalComment.depth number

Comment nesting depth.

focalComment.collapsed boolean

Whether the focal comment is collapsed.

focalComment.stickied boolean

Whether the focal comment is stickied.

focalComment.distinguished string | null

Moderator/admin distinction, or null.

focalComment.removed boolean | null

Whether Reddit has taken the comment down: true when it shows the comment as removed or deleted, false when it shows it normally. Reddit leaves out removed comments that have no replies, so only removed comments that still have replies appear.

focalComment.removedBy string | null

Who took it down: moderator_or_filter (the community moderators or an automatic filter, which Reddit shows the same way), reddit (removed by Reddit itself, when Reddit shows the comment that way) or author (deleted by its author). null when the comment is not removed. A comment shown by [deleted] with its text intact belongs to a deleted account and is not removed.

focalComment.authorFlair string | null

The commenter’s flair in that community, as text (emoji as :code:). null means the commenter wears no flair; it means unknown only when the lookup failed, and notes then says so.

focalComment.authorFlairRichtext object[] | null

The same flair as parts: text parts ({ type, text }) and emoji parts ({ type, code, imageUrl }). null when authorFlair is null.

focalComment.authorBadges string[] | null

Reddit achievement badges shown beside the commenter’s name, for example Top 1% Commenter. Not flair. [] means read and none; null means not read.

focalComment.children array

Nested child comment objects.

ancestorComments[].id string | null

Ancestor comment ID.

ancestorComments[].fullname string | null

Ancestor comment fullname.

ancestorComments[].parentFullname string | null

Ancestor parent fullname.

ancestorComments[].author string | null

Ancestor comment author.

ancestorComments[].score number | null

Ancestor comment score.

ancestorComments[].scoreText string | null

Ancestor score text.

ancestorComments[].createdAt string | null

ISO 8601 ancestor creation timestamp.

ancestorComments[].bodyText string

Plain-text ancestor comment body.

ancestorComments[].bodyHtml string | null

HTML ancestor comment body.

ancestorComments[].permalink string | null

Absolute ancestor comment permalink.

ancestorComments[].depth number

Ancestor nesting depth.

ancestorComments[].collapsed boolean

Whether the ancestor is collapsed.

ancestorComments[].stickied boolean

Whether the ancestor is stickied.

ancestorComments[].distinguished string | null

Moderator/admin distinction, or null.

ancestorComments[].removed boolean | null

Whether Reddit has taken the comment down: true when it shows the comment as removed or deleted, false when it shows it normally. Reddit leaves out removed comments that have no replies, so only removed comments that still have replies appear.

ancestorComments[].removedBy string | null

Who took it down: moderator_or_filter (the community moderators or an automatic filter, which Reddit shows the same way), reddit (removed by Reddit itself, when Reddit shows the comment that way) or author (deleted by its author). null when the comment is not removed. A comment shown by [deleted] with its text intact belongs to a deleted account and is not removed.

ancestorComments[].authorFlair string | null

The commenter’s flair in that community, as text (emoji as :code:). null means the commenter wears no flair; it means unknown only when the lookup failed, and notes then says so.

ancestorComments[].authorFlairRichtext object[] | null

The same flair as parts: text parts ({ type, text }) and emoji parts ({ type, code, imageUrl }). null when authorFlair is null.

ancestorComments[].authorBadges string[] | null

Reddit achievement badges shown beside the commenter’s name, for example Top 1% Commenter. Not flair. [] means read and none; null means not read.

replyCount number

Number of descendants under the focal comment.

commentPagesRequested number

Number of comment pages requested.

commentPagesScraped number

Pages of comments read.

remainingMoreCommentsCount number

Unexpanded more-comments placeholders remaining.

scrapedAt string

ISO 8601 time the result was produced.

transport string

The data source: always the platform id, "reddit".

Request

curl -X POST "https://api.fetchlayer.dev/reddit/comment-permalink" \
  -H "Authorization: Bearer ss-your-key" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://www.reddit.com/r/programming/comments/173viwj/meta_the_future_of_rprogramming/k45nozy/","pages":1}'

Response

{
  "listingType": "comment-permalink",
  "commentId": "k45nozy",
  "postId": "173viwj",
  "postTitle": "[META] The future of r/programming",
  "focalCommentFound": true,
  "focalComment": {
    "id": "k45nozy",
    "author": "DrunkensteinsMonster",
    "bodyText": "Biggest issues I see are the blogspam and the ads masquerading as tech blog posts…",
    "score": 200,
    "createdAt": "2023-10-09T17:26:25.760Z",
    "depth": 0,
    "collapsed": false,
    "stickied": false,
    "children": []
  },
  "ancestorComments": [],
  "replyCount": 0,
  "commentPagesRequested": 1,
  "commentPagesScraped": 1,
  "transport": "reddit"
}
Product overview Reddit API: what it returns, pricing and use cases