---
title: "Reddit Post Comments API (V1)"
description: "Retrieves comments for a Reddit post with pagination-token support. Use it to review a thread's discussion or continue through additional comment results for a known post."
aiUsagePrompt: true
---

# Reddit Post Comments API \(V1\)

<ApiTester
  method="GET"
  :path='JSON.parse("\"/api/reddit/get-post-comments/v1\"")'
  :summary='JSON.parse("\"Post Comments (V1)\"")'
  openapiDefinitionUrl="https://docs.justoneapi.com/openapi/reddit/post-comments-v1-en.json"
  openapiVersion="3.1.0"
  :parameters='JSON.parse("[{\"name\":\"token\",\"in\":\"query\",\"description\":\"Access token for this API service.\",\"required\":true,\"schema\":{\"type\":\"string\"}},{\"name\":\"postId\",\"in\":\"query\",\"description\":\"The unique identifier of the Reddit post.\",\"required\":true,\"schema\":{\"type\":\"string\"}},{\"name\":\"cursor\",\"in\":\"query\",\"description\":\"Pagination token for the next page of results.\",\"required\":false,\"schema\":{\"type\":\"string\",\"default\":\"\"}}]")'
  :requestBody='JSON.parse("null")'
  :responses='JSON.parse("{\"200\":{\"description\":\"OK\",\"content\":{\"application/json\":{\"schema\":{\"if\":{\"properties\":{\"code\":{\"const\":0}},\"required\":[\"code\"]},\"then\":{\"properties\":{\"data\":{\"type\":\"object\",\"description\":\"Reddit post comments with thread metadata and branch continuation information.\",\"properties\":{\"postInfoById\":{\"type\":\"object\",\"description\":\"Post and comment forest data returned for the requested post identifier.\",\"properties\":{\"id\":{\"type\":\"string\",\"description\":\"Reddit post identifier.\"},\"title\":{\"type\":\"string\",\"description\":\"Title of the Reddit post.\"},\"commentCount\":{\"type\":\"integer\",\"description\":\"Total comment count reported for the post.\"},\"commentForest\":{\"type\":\"object\",\"description\":\"Flat list of comment and continuation entries linked by parent identifiers.\",\"properties\":{\"pageInfo\":{\"type\":\"object\",\"description\":\"Pagination information returned with the comment forest.\",\"properties\":{\"commentCount\":{\"type\":[\"integer\",\"null\"],\"description\":\"Comment count reported for the forest, or null when unavailable.\"},\"hasNextPage\":{\"type\":\"boolean\",\"description\":\"Whether additional results are reported for the comment forest.\"}}},\"trees\":{\"type\":\"array\",\"description\":\"Ordered entries in the comment forest. Each entry can carry a comment node or a continuation marker.\",\"items\":{\"type\":\"object\",\"description\":\"One comment or continuation entry in the forest.\",\"properties\":{\"childCount\":{\"type\":\"integer\",\"description\":\"Reported child count for this tree entry.\"},\"depth\":{\"type\":\"integer\",\"description\":\"Depth within the comment thread. Top-level entries have depth zero.\"},\"parentId\":{\"type\":[\"string\",\"null\"],\"description\":\"Parent comment identifier. A top-level entry can return null.\"},\"node\":{\"type\":[\"object\",\"null\"],\"description\":\"Comment content and public metadata for this tree entry, or null for a continuation marker.\",\"properties\":{\"id\":{\"type\":\"string\",\"description\":\"Reddit comment identifier.\"},\"createdAt\":{\"type\":\"string\",\"description\":\"Comment creation time as ISO date-time text.\"},\"editedAt\":{\"description\":\"Time information for the most recent comment edit. The verified samples return null.\"},\"permalink\":{\"type\":\"string\",\"description\":\"Reddit permalink path for the comment.\"},\"content\":{\"type\":\"object\",\"description\":\"Content formats provided for this comment.\",\"properties\":{\"markdown\":{\"type\":\"string\",\"description\":\"Comment text returned in Markdown format.\"},\"preview\":{\"type\":\"string\",\"description\":\"Preview text returned for the comment.\"},\"richtext\":{\"type\":\"string\",\"description\":\"Rich-text document serialized as a JSON string.\"},\"richtextMedia\":{\"type\":\"array\",\"description\":\"Media entries referenced by the rich text. The verified samples return an empty list.\"},\"typeHint\":{\"type\":\"string\",\"description\":\"Content type hint reported for the comment text.\"},\"translationInfo\":{\"type\":\"object\",\"description\":\"Translation status information for the comment content.\",\"properties\":{\"isTranslated\":{\"type\":\"boolean\",\"description\":\"Whether the returned comment content is marked as translated.\"},\"translatedLanguage\":{\"description\":\"Language information for translated comment content. The verified samples return null.\"}}}}},\"score\":{\"type\":\"integer\",\"description\":\"Comment score reported by Reddit.\"},\"isScoreHidden\":{\"type\":\"boolean\",\"description\":\"Whether the comment score is marked as hidden.\"},\"isAdminTakedown\":{\"type\":\"boolean\",\"description\":\"Whether the comment is marked as taken down by Reddit administrators.\"},\"isArchived\":{\"type\":\"boolean\",\"description\":\"Whether the comment is marked as archived.\"},\"isCommercialCommunication\":{\"type\":\"boolean\",\"description\":\"Whether the comment is marked as commercial communication.\"},\"isLocked\":{\"type\":\"boolean\",\"description\":\"Whether the comment is marked as locked.\"},\"isRemoved\":{\"type\":\"boolean\",\"description\":\"Whether the comment is marked as removed.\"},\"isStickied\":{\"type\":\"boolean\",\"description\":\"Whether the comment is marked as pinned.\"},\"isTranslatable\":{\"type\":\"boolean\",\"description\":\"Whether the comment is marked as available for translation.\"},\"languageCode\":{\"type\":[\"string\",\"null\"],\"description\":\"Reported language code for the comment, or null when unavailable.\"},\"removedByCategory\":{\"description\":\"Removal category information returned for the comment. The verified samples return null.\"},\"distinguishedAs\":{\"description\":\"Role distinction information returned for the comment. The verified samples return null.\"},\"authorInfo\":{\"type\":\"object\",\"description\":\"Public Reddit account information returned for the comment author.\",\"properties\":{\"id\":{\"type\":\"string\",\"description\":\"Reddit account identifier for the comment author.\"},\"name\":{\"type\":\"string\",\"description\":\"Public account name shown for the comment author.\"},\"accountType\":{\"type\":\"string\",\"description\":\"Account type returned for the comment author.\"},\"iconSmall\":{\"type\":\"object\",\"description\":\"Small avatar image returned for the author.\",\"properties\":{\"dimensions\":{\"type\":\"object\",\"description\":\"Dimensions of the image in pixels.\",\"properties\":{\"height\":{\"type\":\"integer\",\"description\":\"Image height in pixels.\"},\"width\":{\"type\":\"integer\",\"description\":\"Image width in pixels.\"}}},\"url\":{\"type\":\"string\",\"description\":\"Public Reddit image URL returned for the avatar.\"}}},\"newIcon\":{\"type\":\"object\",\"description\":\"Avatar image returned in the new-icon field.\",\"properties\":{\"dimensions\":{\"type\":\"object\",\"description\":\"Dimensions of the image in pixels.\",\"properties\":{\"height\":{\"type\":\"integer\",\"description\":\"Image height in pixels.\"},\"width\":{\"type\":\"integer\",\"description\":\"Image width in pixels.\"}}},\"url\":{\"type\":\"string\",\"description\":\"Public Reddit image URL returned for the avatar.\"}}},\"snoovatarIcon\":{\"type\":[\"object\",\"null\"],\"description\":\"Snoovatar image returned for the author, or null when unavailable.\",\"properties\":{\"dimensions\":{\"type\":\"object\",\"description\":\"Dimensions of the image in pixels.\",\"properties\":{\"height\":{\"type\":\"integer\",\"description\":\"Image height in pixels.\"},\"width\":{\"type\":\"integer\",\"description\":\"Image width in pixels.\"}}},\"url\":{\"type\":\"string\",\"description\":\"Public Reddit image URL returned for the avatar.\"}}},\"isCakeDayNow\":{\"type\":\"boolean\",\"description\":\"Whether the author account is marked as celebrating its Reddit anniversary.\"},\"profile\":{\"type\":\"object\",\"description\":\"Public profile attributes returned for the comment author.\",\"properties\":{\"isNsfw\":{\"type\":\"boolean\",\"description\":\"Whether the author profile is marked as NSFW.\"}}}}},\"authorCommunityBadge\":{\"type\":[\"object\",\"null\"],\"description\":\"Public community badge data for the comment author, or null when unavailable.\",\"properties\":{\"accessibilityLabel\":{\"type\":\"string\",\"description\":\"Accessibility label for the community badge.\"},\"label\":{\"type\":\"string\",\"description\":\"Display text for the community badge.\"},\"image\":{\"type\":\"object\",\"description\":\"Image information for the community badge.\",\"properties\":{\"url\":{\"type\":\"string\",\"description\":\"Public image URL for the community badge.\"}}}}},\"authorFlair\":{\"type\":[\"object\",\"null\"],\"description\":\"Public flair returned for the comment author, or null when unavailable.\",\"properties\":{\"text\":{\"type\":\"string\",\"description\":\"Display text for the author flair.\"}}}}},\"more\":{\"type\":[\"object\",\"null\"],\"description\":\"Continuation metadata for this branch, or null when unavailable.\",\"properties\":{\"count\":{\"type\":\"integer\",\"description\":\"Reported count of comments represented by this continuation entry.\"},\"cursor\":{\"type\":\"string\",\"description\":\"Opaque continuation cursor for this branch. Pass it unchanged as the cursor query parameter with the same postId.\"},\"isTooDeepForCount\":{\"type\":\"boolean\",\"description\":\"Whether the branch is reported as too deep to supply a count.\"}}}}}}}},\"subreddit\":{\"type\":\"object\",\"description\":\"Public community information for the post.\",\"properties\":{\"id\":{\"type\":\"string\",\"description\":\"Reddit community identifier.\"},\"name\":{\"type\":\"string\",\"description\":\"Name of the Reddit community.\"},\"prefixedName\":{\"type\":\"string\",\"description\":\"Community name with its Reddit prefix.\"},\"isQuarantined\":{\"type\":\"boolean\",\"description\":\"Whether the community is marked as quarantined.\"},\"allowedMediaInComments\":{\"type\":\"array\",\"description\":\"Media types reported as allowed in comments in the community.\",\"items\":{\"type\":\"string\",\"description\":\"One reported media type allowed in comments.\"}}}}}}}}}},\"allOf\":[{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}]}}}},\"400\":{\"description\":\"Invalid request parameters or body\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"401\":{\"description\":\"Invalid or inactive access token\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"403\":{\"description\":\"Permission denied\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"429\":{\"description\":\"Request rate or daily quota limit exceeded\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"500\":{\"description\":\"Internal server error\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"503\":{\"description\":\"Service temporarily unavailable\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}}}")'
  :servers='JSON.parse("[{\"url\":\"https://api.justoneapi.com\",\"description\":\"Global production API (default)\"}]")'
  :security='JSON.parse("[]")'
  :securitySchemes='JSON.parse("{}")'
  :schemas='JSON.parse("{}")'
/>

<ApiHealthSection :api='JSON.parse("\"/api/reddit/get-post-comments/v1\"")' />

<p>Retrieves comments for a Reddit post with pagination-token support. Use it to review a thread's discussion or continue through additional comment results for a known post.</p>

## Parameters

<div class="api-doc-table api-doc-table--params">

| Name | In | Type | Required | Default | Description |
| --- | --- | --- | --- | --- | --- |
| <code>token</code> | query | <code>string</code> | Yes | - | Access token for this API service. |
| <code>postId</code> | query | <code>string</code> | Yes | - | The unique identifier of the Reddit post. |
| <code>cursor</code> | query | <code>string</code> | No | <code></code> | Pagination token for the next page of results. |

</div>

## Code Samples

::: code-group

```bash [🐚 cURL]
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/reddit/get-post-comments/v1?token=YOUR_API_KEY&postId=VALUE'
```

```text [🤖 AI Prompt]
I want to use the "Post Comments (V1)" API from JustOneAPI.
Base URL: https://api.justoneapi.com.
API Path: /api/reddit/get-post-comments/v1?token=YOUR_API_KEY&postId=VALUE
API Endpoint: BASE_URL + /api/reddit/get-post-comments/v1?token=YOUR_API_KEY&postId=VALUE
HTTP Method: GET
Authentication: Append the "token" query parameter to the URL.
OpenAPI Definition: https://docs.justoneapi.com/openapi/reddit/post-comments-v1-en.json

Parameters:
- token (query): Access token for this API service. (Required)
- postId (query): The unique identifier of the Reddit post. (Required)
- cursor (query): Pagination token for the next page of results.

Return format: safely handle JSON or text according to the actual Content-Type.

Response Handling & Error Codes:
1. Business results should be determined by the "code" field in the response body (code 0 means success).
2. Timeout Recommendation: Set the request timeout to 120 seconds. If 120 seconds is too long for your use case, use at least 60 seconds, but a small number of requests may time out before receiving a result.
3. Business Code Reference:
   - 0: Success
   - 100: Invalid or Inactive Token
   - 301: Collection Failed. Please Retry.
   - 302: Rate Limit Exceeded
   - 303: Daily Quota Exceeded
   - 400: Invalid Parameters
   - 500: Internal Server Error
   - 600: Permission Denied
   - 601: Insufficient Balance
   - 602: Token Budget Exceeded
4. Code 601 means the shared account balance is insufficient. Code 602 means the current API token's own cumulative budget limit has been reached. Token budget limits do not transfer funds out of the shared account balance.

Please help me write a script in my preferred programming language to call this API and handle the response.
```

```python [🐍 Python]
import requests

BASE_URL = "https://api.justoneapi.com"  # Provided by OpenAPI servers

url = BASE_URL + "/api/reddit/get-post-comments/v1?token=YOUR_API_KEY&postId=VALUE"
response = requests.get(url, timeout=120)
print(response.status_code)
if response.content:
    content_type = response.headers.get("content-type", "").lower()
    if "json" in content_type:
        try:
            print(response.json())
        except ValueError:
            print(response.text)
    elif content_type.startswith("text/") or "xml" in content_type or content_type.split(";", 1)[0].strip() in {"application/javascript", "application/x-www-form-urlencoded", "application/graphql"}:
        print(response.text)
    else:
        with open("response.bin", "wb") as output:
            output.write(response.content)
        print(f"Saved {len(response.content)} bytes to response.bin")
```

```js [🌐 JavaScript]
const BASE_URL = "https://api.justoneapi.com"; // Provided by OpenAPI servers
const url = BASE_URL + "/api/reddit/get-post-comments/v1?token=YOUR_API_KEY&postId=VALUE";

const response = await fetch(url, {
  method: "GET",
  signal: AbortSignal.timeout(120000)
});
console.log(response.status);
const responseBytes = await response.arrayBuffer();
if (responseBytes.byteLength) {
  const contentType = (response.headers.get("content-type") || "").toLowerCase();
  const mediaType = contentType.split(";", 1)[0].trim();
  const textual = contentType.startsWith("text/") || contentType.includes("json") || contentType.includes("xml") || ["application/javascript", "application/x-www-form-urlencoded", "application/graphql"].includes(mediaType);
  if (textual) {
    const responseText = new TextDecoder().decode(responseBytes);
    let data = responseText;
    if (contentType.includes("json")) {
      try { data = JSON.parse(responseText); } catch { /* Keep the raw body. */ }
    }
    console.log(data);
  } else {
    console.log(`Received ${responseBytes.byteLength} binary bytes`);
  }
}
```

```java [☕ Java]
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;

public class Main {
    public static void main(String[] args) throws Exception {
        final String BASE_URL = "https://api.justoneapi.com"; // Provided by OpenAPI servers
        final String url = BASE_URL + "/api/reddit/get-post-comments/v1?token=YOUR_API_KEY&postId=VALUE";

        HttpClient client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(120)).build();
        HttpRequest.Builder builder = HttpRequest.newBuilder()
            .uri(URI.create(url))
            .timeout(Duration.ofSeconds(120))
            .method("GET", HttpRequest.BodyPublishers.noBody());

        HttpRequest request = builder.build();

        HttpResponse<byte[]> response = client.send(request, HttpResponse.BodyHandlers.ofByteArray());
        System.out.println(response.statusCode());
        String contentType = response.headers().firstValue("content-type").orElse("").toLowerCase();
        String mediaType = contentType.split(";", 2)[0].trim();
        if (contentType.startsWith("text/") || contentType.contains("json") || contentType.contains("xml") || mediaType.equals("application/javascript") || mediaType.equals("application/x-www-form-urlencoded") || mediaType.equals("application/graphql")) {
            System.out.println(new String(response.body(), StandardCharsets.UTF_8));
        } else {
            Files.write(Path.of("response.bin"), response.body());
            System.out.println("Saved " + response.body().length + " bytes to response.bin");
        }
    }
}
```

```go [🐹 Go]
package main

import (
	"fmt"
	"io"
	"os"
	"strings"
	"net/http"
	"time"
)

const BASE_URL = "https://api.justoneapi.com" // Provided by OpenAPI servers

func main() {
	client := &http.Client{Timeout: 120 * time.Second}
	url := BASE_URL + "/api/reddit/get-post-comments/v1?token=YOUR_API_KEY&postId=VALUE"
	req, _ := http.NewRequest("GET", url, nil)
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	fmt.Println(resp.StatusCode)
	bodyBytes, _ := io.ReadAll(resp.Body)
	contentType := strings.ToLower(resp.Header.Get("Content-Type"))
	mediaType := strings.TrimSpace(strings.SplitN(contentType, ";", 2)[0])
	if strings.HasPrefix(contentType, "text/") || strings.Contains(contentType, "json") || strings.Contains(contentType, "xml") || mediaType == "application/javascript" || mediaType == "application/x-www-form-urlencoded" || mediaType == "application/graphql" {
		fmt.Println(string(bodyBytes))
	} else {
		os.WriteFile("response.bin", bodyBytes, 0600)
		fmt.Printf("Saved %d bytes to response.bin\n", len(bodyBytes))
	}
}
```

```php [🐘 PHP]
<?php
$BASE_URL = 'https://api.justoneapi.com'; // Provided by OpenAPI servers
$url = $BASE_URL . '/api/reddit/get-post-comments/v1?token=YOUR_API_KEY&postId=VALUE';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
$contentType = strtolower((string) curl_getinfo($ch, CURLINFO_CONTENT_TYPE));
curl_close($ch);
echo $status . PHP_EOL;
$mediaType = trim(explode(';', $contentType, 2)[0]);
if (str_starts_with($contentType, 'text/') || str_contains($contentType, 'json') || str_contains($contentType, 'xml') || in_array($mediaType, ['application/javascript', 'application/x-www-form-urlencoded', 'application/graphql'], true)) {
    echo $response;
} else {
    file_put_contents('response.bin', $response);
    echo 'Saved ' . strlen($response) . ' bytes to response.bin' . PHP_EOL;
}
```

:::

<div style="text-align: right; margin-top: -20px; margin-bottom: 20px;">
<a href="/openapi/reddit/post-comments-v1-en.json" target="_blank" style="font-size: 12px; color: var(--vp-c-text-3); text-decoration: none; opacity: 0.8;">[OpenAPI Definition (JSON)]</a>
</div>

## Response Fields

Key fields in a successful response (`code = 0`).

<div class="api-doc-table api-doc-table--response">

| Field path | Type | Description |
| --- | --- | --- |
| <code>data</code> | <code>object</code> | Reddit post comments with thread metadata and branch continuation information. |
| <code>data.postInfoById</code> | <code>object</code> | Post and comment forest data returned for the requested post identifier. |
| <code>data.postInfoById.id</code> | <code>string</code> | Reddit post identifier. |
| <code>data.postInfoById.title</code> | <code>string</code> | Title of the Reddit post. |
| <code>data.postInfoById.commentCount</code> | <code>integer</code> | Total comment count reported for the post. |
| <code>data.postInfoById.commentForest</code> | <code>object</code> | Flat list of comment and continuation entries linked by parent identifiers. |
| <code>data.postInfoById.commentForest.pageInfo</code> | <code>object</code> | Pagination information returned with the comment forest. |
| <code>data.postInfoById.commentForest.pageInfo.commentCount</code> | <code>integer &#124; null</code> | Comment count reported for the forest, or null when unavailable. |
| <code>data.postInfoById.commentForest.pageInfo.hasNextPage</code> | <code>boolean</code> | Whether additional results are reported for the comment forest. |
| <code>data.postInfoById.commentForest.trees</code> | <code>array</code> | Ordered entries in the comment forest. Each entry can carry a comment node or a continuation marker. |
| <code>data.postInfoById.commentForest.trees[]</code> | <code>object</code> | One comment or continuation entry in the forest. |
| <code>data.postInfoById.commentForest.trees[].childCount</code> | <code>integer</code> | Reported child count for this tree entry. |
| <code>data.postInfoById.commentForest.trees[].depth</code> | <code>integer</code> | Depth within the comment thread. Top-level entries have depth zero. |
| <code>data.postInfoById.commentForest.trees[].parentId</code> | <code>string &#124; null</code> | Parent comment identifier. A top-level entry can return null. |
| <code>data.postInfoById.commentForest.trees[].node</code> | <code>object &#124; null</code> | Comment content and public metadata for this tree entry, or null for a continuation marker. |
| <code>data.postInfoById.commentForest.trees[].node.id</code> | <code>string</code> | Reddit comment identifier. |
| <code>data.postInfoById.commentForest.trees[].node.createdAt</code> | <code>string</code> | Comment creation time as ISO date-time text. |
| <code>data.postInfoById.commentForest.trees[].node.editedAt</code> | - | Time information for the most recent comment edit. The verified samples return null. |
| <code>data.postInfoById.commentForest.trees[].node.permalink</code> | <code>string</code> | Reddit permalink path for the comment. |
| <code>data.postInfoById.commentForest.trees[].node.content</code> | <code>object</code> | Content formats provided for this comment. |
| <code>data.postInfoById.commentForest.trees[].node.content.markdown</code> | <code>string</code> | Comment text returned in Markdown format. |
| <code>data.postInfoById.commentForest.trees[].node.content.preview</code> | <code>string</code> | Preview text returned for the comment. |
| <code>data.postInfoById.commentForest.trees[].node.content.richtext</code> | <code>string</code> | Rich-text document serialized as a JSON string. |
| <code>data.postInfoById.commentForest.trees[].node.content.richtextMedia</code> | <code>array</code> | Media entries referenced by the rich text. The verified samples return an empty list. |
| <code>data.postInfoById.commentForest.trees[].node.content.typeHint</code> | <code>string</code> | Content type hint reported for the comment text. |
| <code>data.postInfoById.commentForest.trees[].node.content.translationInfo</code> | <code>object</code> | Translation status information for the comment content. |
| <code>data.postInfoById.commentForest.trees[].node.content.translationInfo.isTranslated</code> | <code>boolean</code> | Whether the returned comment content is marked as translated. |
| <code>data.postInfoById.commentForest.trees[].node.content.translationInfo.translatedLanguage</code> | - | Language information for translated comment content. The verified samples return null. |
| <code>data.postInfoById.commentForest.trees[].node.score</code> | <code>integer</code> | Comment score reported by Reddit. |
| <code>data.postInfoById.commentForest.trees[].node.isScoreHidden</code> | <code>boolean</code> | Whether the comment score is marked as hidden. |
| <code>data.postInfoById.commentForest.trees[].node.isAdminTakedown</code> | <code>boolean</code> | Whether the comment is marked as taken down by Reddit administrators. |
| <code>data.postInfoById.commentForest.trees[].node.isArchived</code> | <code>boolean</code> | Whether the comment is marked as archived. |
| <code>data.postInfoById.commentForest.trees[].node.isCommercialCommunication</code> | <code>boolean</code> | Whether the comment is marked as commercial communication. |
| <code>data.postInfoById.commentForest.trees[].node.isLocked</code> | <code>boolean</code> | Whether the comment is marked as locked. |
| <code>data.postInfoById.commentForest.trees[].node.isRemoved</code> | <code>boolean</code> | Whether the comment is marked as removed. |
| <code>data.postInfoById.commentForest.trees[].node.isStickied</code> | <code>boolean</code> | Whether the comment is marked as pinned. |
| <code>data.postInfoById.commentForest.trees[].node.isTranslatable</code> | <code>boolean</code> | Whether the comment is marked as available for translation. |
| <code>data.postInfoById.commentForest.trees[].node.languageCode</code> | <code>string &#124; null</code> | Reported language code for the comment, or null when unavailable. |
| <code>data.postInfoById.commentForest.trees[].node.removedByCategory</code> | - | Removal category information returned for the comment. The verified samples return null. |
| <code>data.postInfoById.commentForest.trees[].node.distinguishedAs</code> | - | Role distinction information returned for the comment. The verified samples return null. |
| <code>data.postInfoById.commentForest.trees[].node.authorInfo</code> | <code>object</code> | Public Reddit account information returned for the comment author. |
| <code>data.postInfoById.commentForest.trees[].node.authorInfo.id</code> | <code>string</code> | Reddit account identifier for the comment author. |
| <code>data.postInfoById.commentForest.trees[].node.authorInfo.name</code> | <code>string</code> | Public account name shown for the comment author. |
| <code>data.postInfoById.commentForest.trees[].node.authorInfo.accountType</code> | <code>string</code> | Account type returned for the comment author. |
| <code>data.postInfoById.commentForest.trees[].node.authorInfo.iconSmall</code> | <code>object</code> | Small avatar image returned for the author. |
| <code>data.postInfoById.commentForest.trees[].node.authorInfo.iconSmall.dimensions</code> | <code>object</code> | Dimensions of the image in pixels. |
| <code>data.postInfoById.commentForest.trees[].node.authorInfo.iconSmall.dimensions.height</code> | <code>integer</code> | Image height in pixels. |
| <code>data.postInfoById.commentForest.trees[].node.authorInfo.iconSmall.dimensions.width</code> | <code>integer</code> | Image width in pixels. |
| <code>data.postInfoById.commentForest.trees[].node.authorInfo.iconSmall.url</code> | <code>string</code> | Public Reddit image URL returned for the avatar. |
| <code>data.postInfoById.commentForest.trees[].node.authorInfo.newIcon</code> | <code>object</code> | Avatar image returned in the new-icon field. |
| <code>data.postInfoById.commentForest.trees[].node.authorInfo.newIcon.dimensions</code> | <code>object</code> | Dimensions of the image in pixels. |
| <code>data.postInfoById.commentForest.trees[].node.authorInfo.newIcon.dimensions.height</code> | <code>integer</code> | Image height in pixels. |
| <code>data.postInfoById.commentForest.trees[].node.authorInfo.newIcon.dimensions.width</code> | <code>integer</code> | Image width in pixels. |
| <code>data.postInfoById.commentForest.trees[].node.authorInfo.newIcon.url</code> | <code>string</code> | Public Reddit image URL returned for the avatar. |
| <code>data.postInfoById.commentForest.trees[].node.authorInfo.snoovatarIcon</code> | <code>object &#124; null</code> | Snoovatar image returned for the author, or null when unavailable. |
| <code>data.postInfoById.commentForest.trees[].node.authorInfo.snoovatarIcon.dimensions</code> | <code>object</code> | Dimensions of the image in pixels. |
| <code>data.postInfoById.commentForest.trees[].node.authorInfo.snoovatarIcon.dimensions.height</code> | <code>integer</code> | Image height in pixels. |
| <code>data.postInfoById.commentForest.trees[].node.authorInfo.snoovatarIcon.dimensions.width</code> | <code>integer</code> | Image width in pixels. |
| <code>data.postInfoById.commentForest.trees[].node.authorInfo.snoovatarIcon.url</code> | <code>string</code> | Public Reddit image URL returned for the avatar. |
| <code>data.postInfoById.commentForest.trees[].node.authorInfo.isCakeDayNow</code> | <code>boolean</code> | Whether the author account is marked as celebrating its Reddit anniversary. |
| <code>data.postInfoById.commentForest.trees[].node.authorInfo.profile</code> | <code>object</code> | Public profile attributes returned for the comment author. |
| <code>data.postInfoById.commentForest.trees[].node.authorInfo.profile.isNsfw</code> | <code>boolean</code> | Whether the author profile is marked as NSFW. |
| <code>data.postInfoById.commentForest.trees[].node.authorCommunityBadge</code> | <code>object &#124; null</code> | Public community badge data for the comment author, or null when unavailable. |
| <code>data.postInfoById.commentForest.trees[].node.authorCommunityBadge.accessibilityLabel</code> | <code>string</code> | Accessibility label for the community badge. |
| <code>data.postInfoById.commentForest.trees[].node.authorCommunityBadge.label</code> | <code>string</code> | Display text for the community badge. |
| <code>data.postInfoById.commentForest.trees[].node.authorCommunityBadge.image</code> | <code>object</code> | Image information for the community badge. |
| <code>data.postInfoById.commentForest.trees[].node.authorCommunityBadge.image.url</code> | <code>string</code> | Public image URL for the community badge. |
| <code>data.postInfoById.commentForest.trees[].node.authorFlair</code> | <code>object &#124; null</code> | Public flair returned for the comment author, or null when unavailable. |
| <code>data.postInfoById.commentForest.trees[].node.authorFlair.text</code> | <code>string</code> | Display text for the author flair. |
| <code>data.postInfoById.commentForest.trees[].more</code> | <code>object &#124; null</code> | Continuation metadata for this branch, or null when unavailable. |
| <code>data.postInfoById.commentForest.trees[].more.count</code> | <code>integer</code> | Reported count of comments represented by this continuation entry. |
| <code>data.postInfoById.commentForest.trees[].more.cursor</code> | <code>string</code> | Opaque continuation cursor for this branch. Pass it unchanged as the cursor query parameter with the same postId. |
| <code>data.postInfoById.commentForest.trees[].more.isTooDeepForCount</code> | <code>boolean</code> | Whether the branch is reported as too deep to supply a count. |
| <code>data.postInfoById.subreddit</code> | <code>object</code> | Public community information for the post. |
| <code>data.postInfoById.subreddit.id</code> | <code>string</code> | Reddit community identifier. |
| <code>data.postInfoById.subreddit.name</code> | <code>string</code> | Name of the Reddit community. |
| <code>data.postInfoById.subreddit.prefixedName</code> | <code>string</code> | Community name with its Reddit prefix. |
| <code>data.postInfoById.subreddit.isQuarantined</code> | <code>boolean</code> | Whether the community is marked as quarantined. |
| <code>data.postInfoById.subreddit.allowedMediaInComments</code> | <code>array</code> | Media types reported as allowed in comments in the community. |
| <code>data.postInfoById.subreddit.allowedMediaInComments[]</code> | <code>string</code> | One reported media type allowed in comments. |

</div>

## Response Example

<ApiExampleSection :api='JSON.parse("\"/api/reddit/get-post-comments/v1\"")' />

