{
  "openapi": "3.1.0",
  "info": {
    "title": "FetchLayer Reddit API — Community",
    "version": "1.0.0",
    "description": "Subreddit metadata, posts, and discovery."
  },
  "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": {
    "/community-posts": {
      "post": {
        "operationId": "community-posts",
        "tags": [
          "Community"
        ],
        "summary": "Posts from any subreddit — hot, new, top, rising",
        "description": "Retrieve the current post feed for a subreddit, or for several at once (python+rust). Several communities are billed per community: 1 credit per community per page of 25 posts, so python+rust+golang is 3 credits a page; a request the balance cannot cover is refused with a 402 before any work. Supports sorting by hot, new, top, rising, and controversial. With createdAfter and/or createdBefore, returns only the posts created in that window (sort new only); a window not fully walked in one request comes back with a nextCursor to continue, and Reddit lists only about the newest 1,000 posts of a community, so older posts in the window may not be available (notes says so).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "subreddit": {
                    "type": "string",
                    "description": "Subreddit name (without r/), or several joined with + for one combined feed, such as python+rust. The posts come back mixed, in the order the sort gives. Each distinct community is billed: 1 credit per community per page."
                  },
                  "sort": {
                    "type": "string",
                    "description": "Feed sort order: hot, new, top, rising, or controversial. With createdAfter or createdBefore it defaults to new, and only new is accepted.",
                    "example": "hot"
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximum number of posts to return.",
                    "example": "25"
                  },
                  "time": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Time filter for top and controversial sorts: hour, day, week, month, year, or all."
                  },
                  "pages": {
                    "type": "integer",
                    "description": "How many pages of results to return, at most. Each page holds 25 results. If omitted, results continue until `limit` is reached (or the 45s time budget ends, returning partial results with `incompleteReason: \"scrape_timeout\"`), billed as `ceil(items returned / 25)`. If passed, results are capped at that many pages and billed per page actually returned (see `pagesScraped` in the response)."
                  },
                  "after": {
                    "type": "string",
                    "description": "Continue after this post: pass nextCursor from a previous response (a post fullname such as t3_abc123, or a bare id). Use the same sort and time."
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Extra fields per post: [\"body\"] adds the full post body as bodyText, bodyHtml and bodyMarkdown. Off by default, as it makes responses about three times larger. [\"media\"] adds media[] to each post, 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."
                  },
                  "createdAfter": {
                    "type": "string",
                    "description": "Only posts created at or after this time (ISO 8601: a date such as `2026-10-01`, or a date-time with an offset such as `2026-10-01T12:00:00Z`). Works with sort `new` only (the default when a date is given); any other sort is a 400. limit counts posts inside the window, and pinned posts outside it are dropped. If the window is not fully walked within the time limit, pass nextCursor as after with the same createdAfter/createdBefore to continue; nextCursor is null once the window’s start is reached."
                  },
                  "createdBefore": {
                    "type": "string",
                    "description": "Only posts created before this time (ISO 8601, as `createdAfter`). Works with sort `new` only. It must be later than createdAfter, or the request is a 400."
                  }
                },
                "additionalProperties": false,
                "required": [
                  "subreddit"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "subreddit": "programming",
                    "sort": "top",
                    "limit": 10,
                    "time": "week"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "listingType": {
                      "type": "string",
                      "description": "Always community-posts for a successful response."
                    },
                    "requestedUrl": {
                      "type": "string",
                      "description": "The Reddit URL the request was for."
                    },
                    "finalUrl": {
                      "type": "string",
                      "description": "Final URL after redirects."
                    },
                    "subreddit": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Subreddit name without the r/ prefix."
                    },
                    "subredditPrefixed": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Subreddit name with the r/ prefix."
                    },
                    "sort": {
                      "type": "string",
                      "description": "Applied feed sort order."
                    },
                    "time": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Applied time filter, or null when none was supplied."
                    },
                    "listingTitle": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Display title of the subreddit listing."
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "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 the post has no flair."
                          },
                          "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."
                          },
                          "previewText": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Text preview for self posts, or null when unavailable."
                          },
                          "thumbnailUrl": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Post thumbnail URL, or null when unavailable."
                          },
                          "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). Reddit leaves removed posts out of this listing, so a listed post is false; null appears only when its status could not be read."
                          },
                          "removedByCategory": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Almost always null: Reddit leaves removed posts out of this listing. When removed is true (rare), the same values as the post route."
                          },
                          "authorId": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The author’s account id (t2_…), which stays the same if the username changes."
                          },
                          "subredditId": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The subreddit’s id (t5_…)."
                          },
                          "numCrossposts": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Exact number of crossposts; null when it could not be checked."
                          },
                          "postType": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "What kind of post it is: text, link, image, video or gallery; null when not known. Only text posts have a body."
                          },
                          "media": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "object",
                              "additionalProperties": true,
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "description": "image, gallery_item (one slide of a gallery, in Reddit's order), video, or link_preview (a link post's preview image)."
                                },
                                "url": {
                                  "type": "string",
                                  "description": "The real, unblurred media. Reddit-hosted video has no single MP4 with audio: url is the video's HLS streaming playlist (.m3u8, audio and video together, playable by HLS players such as ffmpeg, VLC or hls.js). Embedded videos (for example Streamable or YouTube) point to the provider's page."
                                },
                                "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": "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.**"
                          },
                          "linkUrl": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "What a non-text post points to: the external site, the image, video or gallery, or a crosspost’s original. Null for a text post. url is unchanged."
                          },
                          "bodyText": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Only with include [\"body\"]: the full post body as plain text. Null when postType is not text. For a text post, null means a title-only post with no body text, or — when a note says so — a body that could not be returned this time."
                          },
                          "bodyHtml": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Only with include [\"body\"]: the full post body as HTML."
                          },
                          "bodyMarkdown": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Only with include [\"body\"]: the full post body as Markdown, converted from the HTML — it renders the same, but is not byte-identical to what the author typed."
                          }
                        },
                        "additionalProperties": true
                      }
                    },
                    "itemCount": {
                      "type": "number",
                      "description": "Number of posts returned in items."
                    },
                    "nextPageUrl": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The next page’s address, or null at the end. On endpoints that take `after` it is an api.fetchlayer.dev address: POST it with your key to get the next page (a body is optional; fields you send override the address), or pass its `after` parameter as `after`."
                    },
                    "prevPageUrl": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The previous page’s address (its `before` parameter is the cursor), or null."
                    },
                    "pagesRequested": {
                      "type": "number",
                      "description": "Number of pages requested."
                    },
                    "pagesScraped": {
                      "type": "number",
                      "description": "Pages of results returned. This is what the request is billed at: 1 credit per page actually returned, never per page requested."
                    },
                    "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."
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as after to continue exactly where this response stopped, even partway through a page; null at the end."
                    }
                  },
                  "additionalProperties": true
                },
                "examples": {
                  "default": {
                    "value": {
                      "listingType": "community-posts",
                      "requestedUrl": "https://www.reddit.com/r/programming/top/?t=week",
                      "finalUrl": "https://www.reddit.com/r/programming/top/?t=week",
                      "subreddit": "programming",
                      "subredditPrefixed": "r/programming",
                      "sort": "top",
                      "time": "week",
                      "listingTitle": "Programming",
                      "items": [
                        {
                          "id": "xyz",
                          "fullname": "t3_xyz",
                          "subreddit": "programming",
                          "subredditPrefixed": "r/programming",
                          "title": "Example programming post",
                          "author": "coder123",
                          "score": 2500,
                          "scoreText": "2.5K",
                          "commentCount": 320,
                          "commentCountText": "320",
                          "permalink": "https://www.reddit.com/r/programming/comments/xyz/example_programming_post/",
                          "shortlink": "https://redd.it/xyz",
                          "url": "https://example.com/article",
                          "domain": "example.com",
                          "createdAt": "2026-08-13T03:00:00.000Z",
                          "flair": "Discussion",
                          "previewText": null,
                          "thumbnailUrl": null,
                          "nsfw": false,
                          "spoiler": false,
                          "locked": false,
                          "stickied": false
                        }
                      ],
                      "itemCount": 1,
                      "nextPageUrl": null,
                      "prevPageUrl": null,
                      "pagesRequested": 1,
                      "pagesScraped": 1,
                      "scrapedAt": "2026-08-13T03:00:01.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": []
          }
        ]
      }
    },
    "/domain-posts": {
      "post": {
        "operationId": "domain-posts",
        "tags": [
          "Community"
        ],
        "summary": "Posts that link to a site — hot, new, top, rising",
        "description": "Retrieve the Reddit posts that link to one site, such as github.com. Subdomains are included, so github.com also finds posts linking to gist.github.com. Supports sorting by hot, new, top, rising and controversial, with the same post fields, paging and include as community-posts. A site no post links to answers 200 with an empty items list and the note \"No posts link to this site.\" Billed per page like community-posts: 1 credit per page of 25 posts.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "domain": {
                    "type": "string",
                    "description": "The site posts link to, such as github.com. A full URL is reduced to its host and a leading www. is dropped. Subdomains are included. Anything that is not a site name is a 400."
                  },
                  "sort": {
                    "type": "string",
                    "description": "Feed sort order: hot, new, top, rising, or controversial.",
                    "example": "hot"
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximum number of posts to return.",
                    "example": "25"
                  },
                  "time": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Time filter for top and controversial sorts: hour, day, week, month, year, or all."
                  },
                  "pages": {
                    "type": "integer",
                    "description": "How many pages of results to return, at most. Each page holds 25 results. If omitted, results continue until `limit` is reached (or the 45s time budget ends, returning partial results with `incompleteReason: \"scrape_timeout\"`), billed as `ceil(items returned / 25)`. If passed, results are capped at that many pages and billed per page actually returned (see `pagesScraped` in the response)."
                  },
                  "after": {
                    "type": "string",
                    "description": "Continue after this post: pass nextCursor from a previous response (a post fullname such as t3_abc123, or a bare id). Use the same sort and time."
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Extra fields per post: [\"body\"] adds the full post body as bodyText, bodyHtml and bodyMarkdown. Off by default, as it makes responses about three times larger. [\"media\"] adds media[] to each post, 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": [
                  "domain"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "domain": "github.com",
                    "sort": "top",
                    "time": "week",
                    "limit": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "listingType": {
                      "type": "string",
                      "description": "Always domain-posts for a successful response."
                    },
                    "requestedUrl": {
                      "type": "string",
                      "description": "The Reddit URL the request was for."
                    },
                    "finalUrl": {
                      "type": "string",
                      "description": "Final URL after redirects."
                    },
                    "domain": {
                      "type": "string",
                      "description": "The site as searched: a host in lower case, without a leading www."
                    },
                    "sort": {
                      "type": "string",
                      "description": "Applied feed sort order."
                    },
                    "time": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Applied time filter, or null when none was supplied."
                    },
                    "listingTitle": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Display title of the listing."
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "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 the post has no flair."
                          },
                          "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."
                          },
                          "previewText": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Text preview for self posts, or null when unavailable."
                          },
                          "thumbnailUrl": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Post thumbnail URL, or null when unavailable."
                          },
                          "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). Reddit leaves removed posts out of this listing, so a listed post is false; null appears only when its status could not be read."
                          },
                          "removedByCategory": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Almost always null: Reddit leaves removed posts out of this listing. When removed is true (rare), the same values as the post route."
                          },
                          "authorId": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The author’s account id (t2_…), which stays the same if the username changes."
                          },
                          "subredditId": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The subreddit’s id (t5_…)."
                          },
                          "numCrossposts": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Exact number of crossposts; null when it could not be checked."
                          },
                          "postType": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "What kind of post it is: text, link, image, video or gallery; null when not known. Only text posts have a body."
                          },
                          "media": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "object",
                              "additionalProperties": true,
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "description": "image, gallery_item (one slide of a gallery, in Reddit's order), video, or link_preview (a link post's preview image)."
                                },
                                "url": {
                                  "type": "string",
                                  "description": "The real, unblurred media. Reddit-hosted video has no single MP4 with audio: url is the video's HLS streaming playlist (.m3u8, audio and video together, playable by HLS players such as ffmpeg, VLC or hls.js). Embedded videos (for example Streamable or YouTube) point to the provider's page."
                                },
                                "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": "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.**"
                          },
                          "linkUrl": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "What a non-text post points to: the external site, the image, video or gallery, or a crosspost’s original. Null for a text post. url is unchanged."
                          },
                          "bodyText": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Only with include [\"body\"]: the full post body as plain text. Null when postType is not text. For a text post, null means a title-only post with no body text, or — when a note says so — a body that could not be returned this time."
                          },
                          "bodyHtml": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Only with include [\"body\"]: the full post body as HTML."
                          },
                          "bodyMarkdown": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Only with include [\"body\"]: the full post body as Markdown, converted from the HTML — it renders the same, but is not byte-identical to what the author typed."
                          }
                        },
                        "additionalProperties": true
                      }
                    },
                    "itemCount": {
                      "type": "number",
                      "description": "Number of posts returned in items."
                    },
                    "nextPageUrl": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The next page’s address, or null at the end. On endpoints that take `after` it is an api.fetchlayer.dev address: POST it with your key to get the next page (a body is optional; fields you send override the address), or pass its `after` parameter as `after`."
                    },
                    "prevPageUrl": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The previous page’s address (its `before` parameter is the cursor), or null."
                    },
                    "pagesRequested": {
                      "type": "number",
                      "description": "Number of pages requested."
                    },
                    "pagesScraped": {
                      "type": "number",
                      "description": "Pages of results returned. This is what the request is billed at: 1 credit per page actually returned, never per page requested."
                    },
                    "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."
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as after to continue exactly where this response stopped, even partway through a page; null at the end."
                    }
                  },
                  "additionalProperties": true
                },
                "examples": {
                  "default": {
                    "value": {
                      "listingType": "domain-posts",
                      "requestedUrl": "https://www.reddit.com/domain/github.com/top/?t=week",
                      "finalUrl": "https://www.reddit.com/domain/github.com/top/?t=week",
                      "domain": "github.com",
                      "sort": "top",
                      "time": "week",
                      "listingTitle": "Posts linking to github.com",
                      "items": [
                        {
                          "id": "xyz",
                          "fullname": "t3_xyz",
                          "subreddit": "opensource",
                          "subredditPrefixed": "r/opensource",
                          "title": "A small tool that does one thing well",
                          "author": "maintainer42",
                          "score": 1800,
                          "scoreText": "1.8K",
                          "commentCount": 120,
                          "commentCountText": "120",
                          "permalink": "https://www.reddit.com/r/opensource/comments/xyz/a_small_tool_that_does_one_thing_well/",
                          "shortlink": "https://redd.it/xyz",
                          "url": "https://github.com/example/tool",
                          "domain": "github.com",
                          "createdAt": "2026-11-10T09:00:00.000Z",
                          "flair": "Project",
                          "previewText": null,
                          "thumbnailUrl": null,
                          "nsfw": false,
                          "spoiler": false,
                          "locked": false,
                          "stickied": false
                        }
                      ],
                      "itemCount": 1,
                      "nextCursor": "t3_xyz",
                      "pagesRequested": 1,
                      "pagesScraped": 1,
                      "notes": [],
                      "scrapedAt": "2026-11-10T09:30: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": []
          }
        ]
      }
    },
    "/community-details": {
      "post": {
        "operationId": "community-details",
        "tags": [
          "Community"
        ],
        "summary": "Subreddit metadata and rules — activity, description, rules, and branding",
        "description": "Get subreddit metadata including activity counts, description, creation time, icon, banner and NSFW status, plus the community's rules: each rule's number, title and explanation as text and HTML, in the community's own order. A subreddit that doesn't exist or is banned returns 404, and one that is private, quarantined or premium-only returns 403; both carry error and code (not_found or forbidden), and neither costs a credit. Only a 503 is worth retrying.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "subreddit": {
                    "type": "string",
                    "description": "Subreddit name (without r/)."
                  }
                },
                "additionalProperties": false,
                "required": [
                  "subreddit"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "subreddit": "programming"
                  }
                }
              }
            }
          }
        },
        "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."
                    },
                    "subreddit": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Subreddit name without the r/ prefix."
                    },
                    "subredditPrefixed": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Subreddit name with the r/ prefix."
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Caveats about this result, for example why the member count is null. Read it before treating a null as zero."
                    },
                    "title": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Community display title."
                    },
                    "descriptionText": {
                      "type": "string",
                      "description": "Plain-text community description."
                    },
                    "descriptionHtml": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "HTML community description when available."
                    },
                    "memberCount": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "The exact number of members (subscribers), as Reddit counts them — never weekly visitors or contributions. Null when memberCountStatus is not-available or temporarily-unavailable."
                    },
                    "memberCountText": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Member count as text, e.g. \"6.9M members\"."
                    },
                    "weeklyVisitors": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Unique visitors in the last week."
                    },
                    "weeklyContributions": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Posts and comments contributed in the last week."
                    },
                    "activeCount": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Deprecated — the same value as weeklyContributions, kept for existing integrations."
                    },
                    "activeCountText": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Deprecated — weeklyContributions as text, labelled the way the community names its contributors."
                    },
                    "createdAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "ISO 8601 community creation timestamp."
                    },
                    "nsfw": {
                      "type": "boolean",
                      "description": "Whether the community marks itself as 18+ (NSFW)."
                    },
                    "iconUrl": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Community icon URL."
                    },
                    "bannerUrl": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Community banner URL."
                    },
                    "url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Absolute subreddit URL."
                    },
                    "rules": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true,
                        "properties": {
                          "number": {
                            "type": "number",
                            "description": "Position in the community’s list, starting at 1."
                          },
                          "title": {
                            "type": "string",
                            "description": "The rule as the community names it."
                          },
                          "descriptionText": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The rule’s explanation as plain text. Paragraphs are separate lines and list items start with \"- \". Null when the rule has no explanation."
                          },
                          "descriptionHtml": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The same explanation as HTML with links, emphasis and lists kept. Links are absolute."
                          }
                        }
                      },
                      "description": "The community's rules in its own order. Empty when the community publishes none."
                    },
                    "scrapedAt": {
                      "type": "string",
                      "description": "ISO 8601 time the result was produced."
                    },
                    "transport": {
                      "type": "string",
                      "description": "The data source: always the platform id, \"reddit\"."
                    },
                    "subredditId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The subreddit’s id (t5_…)."
                    },
                    "memberCountStatus": {
                      "type": "string",
                      "description": "Whether memberCount could be given. available: it is the exact count. not-available: Reddit does not publish it for this community, for example an NSFW one; asking again will not fill it. temporarily-unavailable: not available this time; asking again later usually fills it."
                    }
                  },
                  "additionalProperties": true
                },
                "examples": {
                  "default": {
                    "value": {
                      "subreddit": "programming",
                      "subredditPrefixed": "r/programming",
                      "title": "Programming",
                      "descriptionText": "Computer Programming",
                      "memberCount": 6919460,
                      "memberCountText": "6.9M members",
                      "weeklyVisitors": 215398,
                      "weeklyContributions": 2556,
                      "activeCount": 2556,
                      "activeCountText": "3K weekly contributions",
                      "createdAt": "2008-01-25T00:00:00.000Z",
                      "nsfw": false,
                      "url": "https://www.reddit.com/r/programming/",
                      "rules": [
                        {
                          "number": 1,
                          "title": "No LLM-Written Content",
                          "descriptionText": "If you don't want to write it, we don't want to read it. This includes the use of LLMs for translation or summarisation. Moderators reserve discretion in ambiguous cases.",
                          "descriptionHtml": "<p> If you don't want to write it, we don't want to read it. This includes the use of LLMs for translation or summarisation. Moderators reserve discretion in ambiguous cases. </p>"
                        },
                        {
                          "number": 2,
                          "title": "AI-related posts must comply with the AI Policy",
                          "descriptionText": "Content about LLMs and AI is generally considered off-topic unless they are deeply technical. Refer to our wiki for more details.",
                          "descriptionHtml": "<p> Content about LLMs and AI is generally considered off-topic unless they are <em>deeply technical</em>. Refer to our <a href=\"https://www.reddit.com/r/programming/wiki/ai-policy/\">wiki</a> for more details. </p>"
                        }
                      ],
                      "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": []
          }
        ]
      }
    },
    "/community-comments": {
      "post": {
        "operationId": "community-comments",
        "tags": [
          "Community"
        ],
        "summary": "The latest comments in a subreddit",
        "description": "Retrieve a subreddit’s latest comments, newest first, each with the post it was left on (title, URL and author). There is no sort parameter. The comment each one replies to is not included: parentFullname is always null, and contextUrl opens the reply chain. A community with no comments answers 200 with an empty items list and the note \"This community has no comments to list.\" An unknown or banned community is a 404; a private, quarantined or premium one is a 403. Billed per page like the other listings: 1 credit per page of 25.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "subreddit": {
                    "type": "string",
                    "description": "Subreddit name, with or without r/ (Python or r/Python)."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximum number of comments to return.",
                    "example": "25"
                  },
                  "pages": {
                    "type": "integer",
                    "description": "How many pages of results to return, at most. Each page holds 25 results. If omitted, results continue until `limit` is reached (or the 45s time budget ends, returning partial results with `incompleteReason: \"scrape_timeout\"`), billed as `ceil(items returned / 25)`. If passed, results are capped at that many pages and billed per page actually returned (see `pagesScraped` in the response)."
                  },
                  "after": {
                    "type": "string",
                    "description": "Continue after this comment: pass nextCursor from a previous response (a comment fullname such as t1_abc123)."
                  },
                  "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": [
                  "subreddit"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "subreddit": "python",
                    "limit": 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 community-comments for a successful response."
                    },
                    "subreddit": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Subreddit name without the r/ prefix."
                    },
                    "subredditPrefixed": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Subreddit name with the r/ prefix."
                    },
                    "listingTitle": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Display title of the listing, or null when unavailable."
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as after to continue where this response stopped; null at the end."
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Caveats about this result, for example \"This profile shows no public comments.\" when the profile has none."
                    },
                    "items": {
                      "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."
                          },
                          "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": "Comment author."
                          },
                          "parentPostTitle": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Parent post title."
                          },
                          "parentPostAuthor": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Parent post author."
                          },
                          "parentPostUrl": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Parent post URL."
                          },
                          "permalink": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Absolute comment permalink."
                          },
                          "contextUrl": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Comment URL including Reddit context."
                          },
                          "fullCommentsUrl": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "URL of the full comments page."
                          },
                          "createdAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "ISO 8601 creation timestamp."
                          },
                          "score": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "The comment’s score, or null while Reddit is still hiding it (never 0)."
                          },
                          "scoreText": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Score text as displayed by Reddit."
                          },
                          "replyCount": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Reply count when available."
                          },
                          "replyCountText": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Reply count text as displayed by Reddit."
                          },
                          "bodyText": {
                            "type": "string",
                            "description": "Plain-text comment body."
                          },
                          "bodyHtml": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "HTML comment body when available."
                          },
                          "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."
                          },
                          "distinguished": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Moderator/admin distinction, or null."
                          },
                          "stickied": {
                            "type": "boolean",
                            "description": "Whether the comment is stickied."
                          },
                          "removed": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "Always null on this route: a community’s comment listing does not show whether a comment was removed."
                          },
                          "removedBy": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Always null on this route, for the same reason as removed."
                          },
                          "authorId": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The author’s account id (t2_…)."
                          },
                          "subredditId": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The subreddit’s id (t5_…)."
                          },
                          "postFullname": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The fullname of the post the comment is on (t3_…)."
                          },
                          "parentFullname": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Always null on this route: the listing names the post a comment is on (postFullname, parentPostTitle, parentPostUrl, parentPostAuthor), not the comment it replies to. Open contextUrl to see the reply chain."
                          },
                          "bodyMarkdown": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Only with include [\"bodyMarkdown\"]: the comment’s body as Markdown, converted from bodyHtml."
                          }
                        },
                        "additionalProperties": true
                      }
                    },
                    "itemCount": {
                      "type": "number",
                      "description": "Number of entries returned in items."
                    },
                    "nextPageUrl": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The next page’s address, or null at the end. On endpoints that take `after` it is an api.fetchlayer.dev address: POST it with your key to get the next page (a body is optional; fields you send override the address), or pass its `after` parameter as `after`."
                    },
                    "prevPageUrl": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The previous page’s address (its `before` parameter is the cursor), or null."
                    },
                    "pagesRequested": {
                      "type": "number",
                      "description": "Number of pages requested."
                    },
                    "pagesScraped": {
                      "type": "number",
                      "description": "Pages of results returned. This is what the request is billed at: 1 credit per page actually returned, never per page requested."
                    },
                    "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": "community-comments",
                      "subreddit": "python",
                      "subredditPrefixed": "r/python",
                      "listingTitle": "Python",
                      "items": [
                        {
                          "id": "abc123",
                          "fullname": "t1_abc123",
                          "subreddit": "Python",
                          "subredditPrefixed": "r/Python",
                          "author": "coder123",
                          "parentPostTitle": "What are you building this week?",
                          "parentPostAuthor": "AutoModerator",
                          "parentPostUrl": "https://www.reddit.com/r/Python/comments/xyz/what_are_you_building_this_week/",
                          "permalink": "https://www.reddit.com/r/Python/comments/xyz/what_are_you_building_this_week/abc123/",
                          "contextUrl": "https://www.reddit.com/r/Python/comments/xyz/what_are_you_building_this_week/abc123/?context=3",
                          "createdAt": "2026-11-13T09:00:00.000Z",
                          "score": null,
                          "bodyText": "A small CLI that renames photos by date.",
                          "authorFlair": null,
                          "removed": null,
                          "removedBy": null,
                          "postFullname": "t3_xyz",
                          "parentFullname": null
                        }
                      ],
                      "itemCount": 1,
                      "nextCursor": "t1_abc123",
                      "pagesRequested": 1,
                      "pagesScraped": 1,
                      "notes": [],
                      "scrapedAt": "2026-11-13T09:00:05.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": []
          }
        ]
      }
    }
  }
}