OverviewProductsPlatformsAPI ReferenceResources
Reddit Search

Get the comments of a Reddit post

GEThttps://zernio.com/api/v1/reddit/comments/{postId}

Temporarily unavailable: Reddit has blocked third-party apps from its API, so this endpoint returns 503 PLATFORM_DISABLED until Reddit restores access. Reddit Ads is not affected.

Reads the comments of any Reddit post the connected account can see, for example one found through /v1/reddit/feed or /v1/reddit/search, straight from Reddit on every call.

Authentication

AuthorizationBearer tokenRequired

API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.

Path parameters

postIdstringRequired

Reddit post id, with or without the t3_ prefix (as id or fullname on RedditPost).

Query parameters

accountIdstringRequired

An active Reddit account the request is made as.

sortstringDefault newOne of new | top | best | controversial | old | qa
limitintegerDefault 25

Maximum number of top-level comments.

commentIdstring

Return only this comment and its replies, with or without the t1_ prefix; pass an id from more to expand it.

Responses

Success· the request worked

Errors· the request failed

How it behaves

Thread shape

  • The tree comes flattened in thread order (a reply follows its parent).
  • Rebuild it from parentId, which is t3_… for a reply to the post and t1_… for a reply to a comment.
  • Deleted and removed comments are passed through as Reddit sends them ([deleted] / [removed]).
  • Where Reddit truncates a thread, the ids it left out are listed in more. commentId fetches one such comment with its replies.

Errors

  • 404 platform_api_error: Reddit no longer serves the post.
  • 403 platform_api_error: the subreddit is private.

For comments on posts published through Zernio, /v1/inbox/comments/{postId} adds caching, moderation and replies.

GET/v1/reddit/comments/{postId}
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.reddit.getRedditPostComments({  path: {    postId: 'post_abc123',  },  query: {    accountId: 'account_abc123',  },});console.log(data);
{  "post": {    "id": "1abc23",    "fullname": "t3_1abc23",    "title": "We moved our scheduling to an API",    "author": "founder_jo",    "subreddit": "saas",    "url": "https://www.reddit.com/r/saas/comments/1abc23/we_moved_our_scheduling_to_an_api/",    "permalink": "https://www.reddit.com/r/saas/comments/1abc23/we_moved_our_scheduling_to_an_api/",    "selftext": "Long story short...",    "score": 88,    "numComments": 41,    "createdUtc": 1791190000,    "over18": false,    "stickied": false,    "flairText": null,    "isGallery": false  },  "items": [    {      "id": "k9x2f1",      "fullname": "t1_k9x2f1",      "parentId": "t3_1abc23",      "author": "someone",      "body": "We moved to Zernio last month...",      "permalink": "https://www.reddit.com/r/saas/comments/1abc23/we_moved_our_scheduling_to_an_api/k9x2f1/",      "createdUtc": 1791200000,      "score": 12,      "numReplies": 1,      "depth": 0,      "isSubmitter": false,      "edited": false,      "stickied": false,      "distinguished": null    },    {      "id": "k9x3aa",      "fullname": "t1_k9x3aa",      "parentId": "t1_k9x2f1",      "author": "founder_jo",      "body": "Same here.",      "permalink": "https://www.reddit.com/r/saas/comments/1abc23/we_moved_our_scheduling_to_an_api/k9x3aa/",      "createdUtc": 1791200600,      "score": 3,      "numReplies": 0,      "depth": 1,      "isSubmitter": true,      "edited": false,      "stickied": false,      "distinguished": null    }  ],  "more": [    "k9x9zz",    "k9xa01"  ]}
OpenAPI specification
Was this page helpful?