{
  "openapi": "3.1.0",
  "info": {
    "title": "FetchLayer Reddit API — Content",
    "version": "1.0.0",
    "description": "Retrieve posts, comments, and threaded discussions."
  },
  "servers": [
    {
      "url": "https://api.fetchlayer.dev/reddit"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "description": "Every error, on every route. Branch on code and retryable rather than on the text; on a 5xx the text is generic. MCP tool errors carry the same fields in structuredContent, and as a JSON text block.",
        "properties": {
          "error": {
            "type": "string",
            "description": "What went wrong, in words. For a 400, what to change."
          },
          "status": {
            "type": "integer",
            "description": "The HTTP status, repeated in the body."
          },
          "code": {
            "type": "string",
            "description": "The kind of error, stable: invalid_input, unauthorized, insufficient_credits, forbidden, not_found, expired, quota_exceeded, cancelled, time_limit, temporarily_unavailable, posts_unavailable, store_unreachable, upstream_error, internal_error, tool_error. A platform may add its own; more may be added. Treat a code you do not recognise by its retryable flag."
          },
          "retryable": {
            "type": "boolean",
            "description": "Whether asking again can succeed."
          },
          "requestId": {
            "type": "string",
            "description": "This request’s id, also sent as the X-Request-Id header. Quote it when reporting a problem."
          },
          "missing": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "With invalid_input when the request's parameters are refused before the request runs: the parameters that were missing. Always present on those errors, empty when nothing was missing."
          }
        },
        "required": [
          "error",
          "code",
          "retryable",
          "requestId"
        ]
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API Key",
        "description": "Send your FetchLayer key as Authorization: Bearer ss-your-key. No Reddit OAuth credentials are required."
      }
    }
  },
  "paths": {
    "/post": {
      "post": {
        "operationId": "post",
        "tags": [
          "Content"
        ],
        "summary": "Full post body + depth-limited comment tree",
        "description": "Retrieve a single post by its full Reddit URL. Returns post metadata, body content, media, outbound links, and top-level comments with descendants through the requested depth. A post that 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. A post whose comments Reddit counts but shows none of, because they were removed or deleted, also returns 200, with comments empty and a note saying so. Only a 503 is worth retrying.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "Full Reddit post URL."
                  },
                  "pages": {
                    "type": "integer",
                    "description": "Number of top-level comment pages to expand. Billing: 1 credit per 2 comment pages actually read, rounded up (1–2 pages = 1 credit, 3–4 = 2, 5 = 3), never per page requested; commentPagesScraped in the response is the count billed. A post with few comments fits on one page.",
                    "example": "5"
                  },
                  "depth": {
                    "type": "integer",
                    "description": "How deep to follow each thread: replies are returned down to this nesting depth (0 is top-level comments only). Deeper trees take longer: depth 10 takes about 40 seconds. Replies below the depth, or that Reddit did not show, are listed in moreComments with a token to load them.",
                    "example": "5"
                  },
                  "commentDepth": {
                    "type": "integer",
                    "description": "Another name for depth: threads are followed to this nesting depth (0 returns top-level comments only). Ignored when depth is also given."
                  },
                  "commentLimit": {
                    "type": "integer",
                    "description": "Maximum number of top-level comments. Replies to the comments kept are returned through the requested depth."
                  },
                  "totalCommentLimit": {
                    "type": "integer",
                    "description": "Most comments to return in total, counted in tree order (1 or more). What is left out comes back as moreComments entries that load it."
                  },
                  "sort": {
                    "type": "string",
                    "description": "Order of the comments, as on Reddit: best, top, new, controversial, old or qa. Omit it for Reddit’s default (best). Replies loaded through moreComments keep the same order."
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Extra fields per comment: [\"bodyMarkdown\"] adds each comment’s body as Markdown (links, lists, quotes and code), converted from bodyHtml. Off by default to keep responses small. On this route [\"media\"] replaces the post's media field with the richer media[] below (the post itself, not its comments), in display order: images, gallery slides with captions, videos with a still (poster), link preview images, with sizes, plus blurredUrl for NSFW or spoiler media. Same price as without it."
                  }
                },
                "additionalProperties": false,
                "required": [
                  "url"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "url": "https://www.reddit.com/r/programming/comments/173viwj/meta_the_future_of_rprogramming/",
                    "pages": 5,
                    "depth": 5,
                    "commentLimit": 10
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestedUrl": {
                      "type": "string",
                      "description": "The Reddit URL the request was for."
                    },
                    "finalUrl": {
                      "type": "string",
                      "description": "Final URL after redirects."
                    },
                    "id": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Reddit post ID without the t3_ prefix."
                    },
                    "fullname": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Reddit post fullname, including the t3_ prefix."
                    },
                    "subreddit": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Subreddit name without the r/ prefix."
                    },
                    "subredditPrefixed": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Subreddit name with the r/ prefix."
                    },
                    "author": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Author username."
                    },
                    "title": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Post title."
                    },
                    "permalink": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Absolute URL of the Reddit comments page."
                    },
                    "shortlink": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Short redd.it URL for the post."
                    },
                    "url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Absolute post content URL."
                    },
                    "domain": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Hostname or Reddit domain associated with the post."
                    },
                    "createdAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "ISO 8601 creation timestamp."
                    },
                    "flair": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Post flair text, or null when absent."
                    },
                    "score": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Post score."
                    },
                    "scoreText": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Score text as displayed by Reddit."
                    },
                    "commentCount": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Comment count."
                    },
                    "commentCountText": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Comment count text as displayed by Reddit."
                    },
                    "nsfw": {
                      "type": "boolean",
                      "description": "Whether the post is marked NSFW."
                    },
                    "spoiler": {
                      "type": "boolean",
                      "description": "Whether the post is marked as a spoiler."
                    },
                    "locked": {
                      "type": "boolean",
                      "description": "Whether the post is locked."
                    },
                    "stickied": {
                      "type": "boolean",
                      "description": "Whether the post is stickied."
                    },
                    "removed": {
                      "type": [
                        "boolean",
                        "null"
                      ],
                      "description": "true when the post has been removed or deleted, false when it is live, null when its status could not be read for this response (notes says how many)."
                    },
                    "removedByCategory": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Who removed it, as Reddit reports it: moderator, reddit (spam filters), automod_filtered, deleted (by its author), anti_evil_ops, content_takedown, copyright_takedown. null when not removed or unknown."
                    },
                    "editedAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "ISO 8601 edit timestamp, or null."
                    },
                    "bodyText": {
                      "type": "string",
                      "description": "Plain-text post body."
                    },
                    "bodyHtml": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "HTML post body when available."
                    },
                    "archived": {
                      "type": "boolean",
                      "description": "Whether the post is archived."
                    },
                    "authorId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The author’s account id (t2_…), which stays the same if the username changes; null for a deleted account."
                    },
                    "subredditId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The subreddit’s id (t5_…)."
                    },
                    "numCrossposts": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "How many times the post has been crossposted; null when it could not be checked."
                    },
                    "postType": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "text, link, image, video or gallery; null when it could not be checked. Only text posts have a body."
                    },
                    "linkUrl": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "What a non-text post points to; null for a text post or when it could not be checked."
                    },
                    "bodyMarkdown": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The body as Markdown, converted from bodyHtml; null when the post has no body."
                    },
                    "upvoteRatio": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Share of votes that are upvotes, from 0 to 1."
                    },
                    "awardCount": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "Awards on the post, as Reddit counts them."
                    },
                    "distinguished": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "moderator or admin when the post is distinguished; null otherwise."
                    },
                    "media": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": "object",
                        "additionalProperties": true,
                        "properties": {
                          "width": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Width in pixels; null when not known."
                          },
                          "height": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Height in pixels; null when not known."
                          },
                          "caption": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "gallery_item only: the slide's caption, null when it has none."
                          },
                          "poster": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "additionalProperties": true,
                            "description": "video only: a still image of the video, { url, width, height }."
                          },
                          "blurredUrl": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Reddit's blurred version of an NSFW or spoiler post's media, when Reddit provides one; otherwise null. The post keeps its nsfw and spoiler flags; url is always the real media."
                          }
                        }
                      },
                      "description": "With include [\"media\"]: Only with include [\"media\"]. The post's media, in display order. null for a text post, a removed post, or a post whose media could not be read on that request; notes says how many. Image and gallery originals (i.redd.it) are stable addresses. Preview and poster addresses (preview.redd.it, external-preview.redd.it) can expire or change, so **download them rather than linking to them long-term.**"
                    },
                    "outboundLinks": {
                      "type": "array",
                      "description": "Absolute outbound links found in the post.",
                      "items": {
                        "type": "string"
                      }
                    },
                    "comments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Comment ID without the t1_ prefix."
                          },
                          "fullname": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Reddit comment fullname."
                          },
                          "parentFullname": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Parent Reddit fullname."
                          },
                          "author": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Comment author."
                          },
                          "score": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Comment score."
                          },
                          "scoreText": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Score text as displayed by Reddit."
                          },
                          "createdAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "ISO 8601 creation timestamp."
                          },
                          "bodyText": {
                            "type": "string",
                            "description": "Plain-text comment body."
                          },
                          "bodyHtml": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "HTML comment body when available."
                          },
                          "bodyMarkdown": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Only with include [\"bodyMarkdown\"]: the body as Markdown, converted from bodyHtml."
                          },
                          "permalink": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Absolute comment permalink."
                          },
                          "depth": {
                            "type": "number",
                            "description": "Comment nesting depth."
                          },
                          "collapsed": {
                            "type": "boolean",
                            "description": "Whether the comment is collapsed."
                          },
                          "stickied": {
                            "type": "boolean",
                            "description": "Whether the comment is stickied."
                          },
                          "distinguished": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Moderator/admin distinction, or null."
                          },
                          "removed": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "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."
                          },
                          "removedBy": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "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."
                          },
                          "children": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "additionalProperties": true
                            },
                            "description": "Nested child comment objects with the same comment shape."
                          },
                          "authorId": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The author’s account id (t2_…); null for a deleted account or when Reddit does not show it."
                          },
                          "postFullname": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The post the comment is on (t3_…)."
                          },
                          "parentId": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "What the comment replies to: another comment (t1_…), or the post (t3_…) for a top-level comment."
                          },
                          "isSubmitter": {
                            "type": "boolean",
                            "description": "Whether the comment’s author is the post’s author."
                          },
                          "editedAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "ISO 8601 time the comment was last edited; null when it was not edited or Reddit does not show it."
                          },
                          "awardCount": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Awards on the comment, as Reddit counts them."
                          },
                          "authorFlair": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "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."
                          },
                          "authorFlairRichtext": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "object",
                              "additionalProperties": true
                            },
                            "description": "The same flair as parts: text parts ({ type, text }) and emoji parts ({ type, code, imageUrl }). null when authorFlair is null."
                          },
                          "authorBadges": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "string"
                            },
                            "description": "Reddit achievement badges shown beside the commenter’s name, for example Top 1% Commenter. Not flair. [] means read and none; null means not read."
                          }
                        },
                        "additionalProperties": true
                      }
                    },
                    "commentCountFromTree": {
                      "type": "number",
                      "description": "Number of comments extracted into the tree."
                    },
                    "commentPagesRequested": {
                      "type": "number",
                      "description": "Number of comment pages requested."
                    },
                    "commentPagesScraped": {
                      "type": "number",
                      "description": "Pages of comments read. The call is billed 1 credit per 2 of them, rounded up (minimum 1), never by the pages requested."
                    },
                    "remainingMoreCommentsCount": {
                      "type": "number",
                      "description": "Unexpanded more-comments placeholders remaining."
                    },
                    "moreComments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true,
                        "properties": {
                          "parentId": {
                            "type": "string",
                            "description": "The comment (t1_…) whose replies these are."
                          },
                          "depth": {
                            "type": "integer",
                            "description": "The depth the hidden replies sit at in the thread (the parent’s depth plus one)."
                          },
                          "count": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "How many replies Reddit says are hidden; null when it does not say."
                          },
                          "expandToken": {
                            "type": "string",
                            "description": "Pass to more-comments to load these replies. It belongs to this post; a token from anywhere else is a 400."
                          }
                        }
                      },
                      "description": "Replies this response did not load: one entry per parent comment. Pass an entry’s expandToken to more-comments to load them. Empty when nothing is hidden."
                    },
                    "scrapedAt": {
                      "type": "string",
                      "description": "ISO 8601 time the result was produced."
                    },
                    "transport": {
                      "type": "string",
                      "description": "The data source: always the platform id, \"reddit\"."
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Caveats about this result, for example how many posts had a removal status that could not be checked. When author flair could not be looked up for some commenters, it says so: those comments have authorFlair: null (unknown), not no flair. When Reddit counts comments on the post but shows none, comments is empty and notes says \"Reddit counts N comments on this post but shows none, usually because they were removed.\""
                    }
                  },
                  "additionalProperties": true
                },
                "examples": {
                  "default": {
                    "value": {
                      "id": "173viwj",
                      "title": "Example post",
                      "author": "reddituser",
                      "score": 1500,
                      "commentCount": 87,
                      "bodyText": "This is the post body...",
                      "permalink": "https://www.reddit.com/r/programming/comments/173viwj/example_post/",
                      "createdAt": "2026-08-13T03:00:00.000Z",
                      "comments": [
                        {
                          "id": "c1",
                          "author": "user1",
                          "bodyText": "Great post!",
                          "score": 42,
                          "depth": 0,
                          "parentId": "t3_173viwj",
                          "isSubmitter": false,
                          "children": []
                        }
                      ],
                      "moreComments": [
                        {
                          "parentId": "t1_c1",
                          "depth": 1,
                          "count": 12,
                          "expandToken": "m2.…"
                        }
                      ],
                      "commentCountFromTree": 1,
                      "commentPagesRequested": 1,
                      "commentPagesScraped": 1,
                      "transport": "reddit"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/more-comments": {
      "post": {
        "operationId": "more-comments",
        "tags": [
          "Content"
        ],
        "summary": "Load the replies a post response left out",
        "description": "Load replies a post response did not include: pass one of its `moreComments[].expandToken` values. Returns those replies nested, at their depth in the thread, with their own `moreComments` for anything still hidden below them. A token that did not come from a post response is a 400. Takes about 2 to 9 seconds; 1 credit per call.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expandToken": {
                    "type": "string",
                    "description": "A `moreComments[].expandToken` from a post response: loads the replies it stands for."
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Extra fields per comment: [\"bodyMarkdown\"] adds each comment’s body as Markdown (links, lists, quotes and code), converted from bodyHtml. Off by default to keep responses small."
                  }
                },
                "additionalProperties": false,
                "required": [
                  "expandToken"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "expandToken": "m2.…"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestedUrl": {
                      "type": "string",
                      "description": "The post the replies belong to."
                    },
                    "parentId": {
                      "type": "string",
                      "description": "The comment (t1_…) these replies are under."
                    },
                    "comments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Comment ID without the t1_ prefix."
                          },
                          "fullname": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Reddit comment fullname."
                          },
                          "parentFullname": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Parent Reddit fullname."
                          },
                          "author": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Comment author."
                          },
                          "score": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Comment score."
                          },
                          "scoreText": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Score text as displayed by Reddit."
                          },
                          "createdAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "ISO 8601 creation timestamp."
                          },
                          "bodyText": {
                            "type": "string",
                            "description": "Plain-text comment body."
                          },
                          "bodyHtml": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "HTML comment body when available."
                          },
                          "bodyMarkdown": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Only with include [\"bodyMarkdown\"]: the body as Markdown, converted from bodyHtml."
                          },
                          "permalink": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Absolute comment permalink."
                          },
                          "depth": {
                            "type": "number",
                            "description": "Comment nesting depth."
                          },
                          "collapsed": {
                            "type": "boolean",
                            "description": "Whether the comment is collapsed."
                          },
                          "stickied": {
                            "type": "boolean",
                            "description": "Whether the comment is stickied."
                          },
                          "distinguished": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Moderator/admin distinction, or null."
                          },
                          "removed": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "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."
                          },
                          "removedBy": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "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."
                          },
                          "children": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "additionalProperties": true
                            },
                            "description": "Nested child comment objects with the same comment shape."
                          },
                          "authorId": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The author’s account id (t2_…); null for a deleted account or when Reddit does not show it."
                          },
                          "postFullname": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The post the comment is on (t3_…)."
                          },
                          "parentId": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "What the comment replies to: another comment (t1_…), or the post (t3_…) for a top-level comment."
                          },
                          "isSubmitter": {
                            "type": "boolean",
                            "description": "Whether the comment’s author is the post’s author."
                          },
                          "editedAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "ISO 8601 time the comment was last edited; null when it was not edited or Reddit does not show it."
                          },
                          "awardCount": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Awards on the comment, as Reddit counts them."
                          },
                          "authorFlair": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "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."
                          },
                          "authorFlairRichtext": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "object",
                              "additionalProperties": true
                            },
                            "description": "The same flair as parts: text parts ({ type, text }) and emoji parts ({ type, code, imageUrl }). null when authorFlair is null."
                          },
                          "authorBadges": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "string"
                            },
                            "description": "Reddit achievement badges shown beside the commenter’s name, for example Top 1% Commenter. Not flair. [] means read and none; null means not read."
                          }
                        },
                        "additionalProperties": true
                      }
                    },
                    "commentCount": {
                      "type": "integer",
                      "description": "Number of comments returned, nested replies included."
                    },
                    "moreComments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true,
                        "properties": {
                          "parentId": {
                            "type": "string",
                            "description": "The comment (t1_…) whose replies these are."
                          },
                          "depth": {
                            "type": "integer",
                            "description": "The depth the hidden replies sit at in the thread (the parent’s depth plus one)."
                          },
                          "count": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "How many replies Reddit says are hidden; null when it does not say."
                          },
                          "expandToken": {
                            "type": "string",
                            "description": "Pass to more-comments to load these replies. It belongs to this post; a token from anywhere else is a 400."
                          }
                        }
                      },
                      "description": "Replies still hidden below the ones returned, one entry per parent comment, each with a token to load them. Empty when nothing is hidden."
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Caveats about this result, for example a field that could not be checked. When author flair could not be looked up for some commenters, it says so: those comments have authorFlair: null (unknown), not no flair."
                    },
                    "scrapedAt": {
                      "type": "string",
                      "description": "ISO 8601 time the result was produced."
                    },
                    "transport": {
                      "type": "string",
                      "description": "The data source: always the platform id, \"reddit\"."
                    }
                  },
                  "additionalProperties": true
                },
                "examples": {
                  "default": {
                    "value": {
                      "requestedUrl": "https://www.reddit.com/r/programming/comments/173viwj/example_post/",
                      "parentId": "t1_c1",
                      "comments": [
                        {
                          "id": "c7",
                          "fullname": "t1_c7",
                          "author": "user7",
                          "bodyText": "Agreed.",
                          "score": 5,
                          "depth": 1,
                          "parentId": "t1_c1",
                          "isSubmitter": false,
                          "children": []
                        }
                      ],
                      "commentCount": 1,
                      "moreComments": [],
                      "notes": [],
                      "scrapedAt": "2026-10-25T12:00:00.000Z",
                      "transport": "reddit"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/comment-permalink": {
      "post": {
        "operationId": "comment-permalink",
        "tags": [
          "Content"
        ],
        "summary": "Single comment with parent context and replies",
        "description": "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.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "Full Reddit comment permalink URL."
                  },
                  "pages": {
                    "type": "integer",
                    "description": "Number of comment pages to expand. A comment-permalink call is billed 1 credit, whatever the pages.",
                    "example": "1"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "url"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "url": "https://www.reddit.com/r/programming/comments/173viwj/meta_the_future_of_rprogramming/k45nozy/",
                    "pages": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestedUrl": {
                      "type": "string",
                      "description": "The Reddit URL the request was for."
                    },
                    "finalUrl": {
                      "type": "string",
                      "description": "Final URL after redirects."
                    },
                    "listingType": {
                      "type": "string",
                      "description": "Always comment-permalink for a successful response."
                    },
                    "commentId": {
                      "type": "string",
                      "description": "Requested comment ID without the t1_ prefix."
                    },
                    "postId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Parent post ID."
                    },
                    "subreddit": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Parent subreddit name."
                    },
                    "subredditPrefixed": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Parent subreddit name with r/ prefix."
                    },
                    "postTitle": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Parent post title."
                    },
                    "postAuthor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Parent post author."
                    },
                    "postPermalink": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Absolute parent post permalink."
                    },
                    "postUrl": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Parent post content URL."
                    },
                    "focalCommentFound": {
                      "type": "boolean",
                      "description": "Whether the requested comment was found in the expanded tree."
                    },
                    "focalComment": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "additionalProperties": true,
                      "description": "Requested comment with nested children, or null when not found.",
                      "properties": {
                        "id": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Focal comment ID."
                        },
                        "fullname": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Focal comment fullname."
                        },
                        "parentFullname": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Parent Reddit fullname."
                        },
                        "author": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Focal comment author."
                        },
                        "score": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Focal comment score."
                        },
                        "scoreText": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Focal comment score text."
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "ISO 8601 comment creation timestamp."
                        },
                        "bodyText": {
                          "type": "string",
                          "description": "Plain-text focal comment body."
                        },
                        "bodyHtml": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "HTML focal comment body."
                        },
                        "permalink": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Absolute focal comment permalink."
                        },
                        "depth": {
                          "type": "number",
                          "description": "Comment nesting depth."
                        },
                        "collapsed": {
                          "type": "boolean",
                          "description": "Whether the focal comment is collapsed."
                        },
                        "stickied": {
                          "type": "boolean",
                          "description": "Whether the focal comment is stickied."
                        },
                        "distinguished": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Moderator/admin distinction, or null."
                        },
                        "removed": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "description": "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."
                        },
                        "removedBy": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "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."
                        },
                        "authorFlair": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "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."
                        },
                        "authorFlairRichtext": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "object",
                            "additionalProperties": true
                          },
                          "description": "The same flair as parts: text parts ({ type, text }) and emoji parts ({ type, code, imageUrl }). null when authorFlair is null."
                        },
                        "authorBadges": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "string"
                          },
                          "description": "Reddit achievement badges shown beside the commenter’s name, for example Top 1% Commenter. Not flair. [] means read and none; null means not read."
                        },
                        "children": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "additionalProperties": true
                          },
                          "description": "Nested child comment objects."
                        }
                      }
                    },
                    "ancestorComments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Ancestor comment ID."
                          },
                          "fullname": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Ancestor comment fullname."
                          },
                          "parentFullname": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Ancestor parent fullname."
                          },
                          "author": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Ancestor comment author."
                          },
                          "score": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Ancestor comment score."
                          },
                          "scoreText": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Ancestor score text."
                          },
                          "createdAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "ISO 8601 ancestor creation timestamp."
                          },
                          "bodyText": {
                            "type": "string",
                            "description": "Plain-text ancestor comment body."
                          },
                          "bodyHtml": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "HTML ancestor comment body."
                          },
                          "permalink": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Absolute ancestor comment permalink."
                          },
                          "depth": {
                            "type": "number",
                            "description": "Ancestor nesting depth."
                          },
                          "collapsed": {
                            "type": "boolean",
                            "description": "Whether the ancestor is collapsed."
                          },
                          "stickied": {
                            "type": "boolean",
                            "description": "Whether the ancestor is stickied."
                          },
                          "distinguished": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Moderator/admin distinction, or null."
                          },
                          "removed": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "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."
                          },
                          "removedBy": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "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."
                          },
                          "authorFlair": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "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."
                          },
                          "authorFlairRichtext": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "object",
                              "additionalProperties": true
                            },
                            "description": "The same flair as parts: text parts ({ type, text }) and emoji parts ({ type, code, imageUrl }). null when authorFlair is null."
                          },
                          "authorBadges": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "string"
                            },
                            "description": "Reddit achievement badges shown beside the commenter’s name, for example Top 1% Commenter. Not flair. [] means read and none; null means not read."
                          }
                        },
                        "additionalProperties": true
                      }
                    },
                    "replyCount": {
                      "type": "number",
                      "description": "Number of descendants under the focal comment."
                    },
                    "commentPagesRequested": {
                      "type": "number",
                      "description": "Number of comment pages requested."
                    },
                    "commentPagesScraped": {
                      "type": "number",
                      "description": "Pages of comments read."
                    },
                    "remainingMoreCommentsCount": {
                      "type": "number",
                      "description": "Unexpanded more-comments placeholders remaining."
                    },
                    "scrapedAt": {
                      "type": "string",
                      "description": "ISO 8601 time the result was produced."
                    },
                    "transport": {
                      "type": "string",
                      "description": "The data source: always the platform id, \"reddit\"."
                    }
                  },
                  "additionalProperties": true
                },
                "examples": {
                  "default": {
                    "value": {
                      "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"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    }
  }
}