{
  "openapi": "3.1.0",
  "info": {
    "title": "FetchLayer Reddit API",
    "version": "1.0.0",
    "description": "Independent Reddit API with structured JSON responses, Bearer auth, and 15 REST endpoints for search, content, communities, users, discovery, and utility workflows. PRAW users can keep their code: point PRAW at FetchLayer with a few lines of praw.ini (read-only; see /documentation/reddit/praw)."
  },
  "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": {
    "/search": {
      "post": {
        "operationId": "search",
        "tags": [
          "Search"
        ],
        "summary": "Posts matching a keyword — globally or within a subreddit",
        "description": "Search Reddit posts by keyword. Optionally narrow to a specific subreddit. Results include title, score, comment count, author, and permalink.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "Search keyword or phrase."
                  },
                  "subreddit": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Limit search to a specific subreddit."
                  },
                  "sort": {
                    "type": "string",
                    "description": "Sort order: relevance, new, comments, top or hot.",
                    "example": "relevance"
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximum number of results to return. With the default `pages: 1`, a request returns at most one page of results, which can be fewer than `limit`.",
                    "example": "25"
                  },
                  "time": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Time filter: hour, day, week, month, year, or all."
                  },
                  "pages": {
                    "type": "integer",
                    "description": "How many pages of results to return, at most. A page holds as many results as Reddit shows on it (often 7 to 25), so a larger `limit` needs `pages` above 1 to be filled. When the pages run out before `limit` and more results remain, `notes` says so and `nextCursor` continues. Each page is billed as one, so the credits a request costs equal the pages it actually returns (see `pagesScraped` in the response).",
                    "example": "1"
                  },
                  "after": {
                    "type": "string",
                    "description": "Continue where a previous response stopped: pass its nextCursor. Use the same query, subreddit, sort and time."
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Extra fields per post: [\"body\"] adds the full body of each text post as bodyText, bodyHtml and bodyMarkdown. Off by default: it adds about 1–2 seconds when a few results are text posts, and up to about 20 when all of them are. [\"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": [
                  "query"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "query": "developer tools",
                    "subreddit": "webdev",
                    "sort": "top",
                    "time": "week",
                    "limit": 10
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestedUrl": {
                      "type": "string",
                      "description": "The Reddit URL the request was for."
                    },
                    "finalUrl": {
                      "type": "string",
                      "description": "Final URL after redirects."
                    },
                    "listingType": {
                      "type": "string",
                      "description": "Always search for a successful response."
                    },
                    "query": {
                      "type": "string",
                      "description": "Search query."
                    },
                    "sort": {
                      "type": "string",
                      "description": "Applied sort order."
                    },
                    "time": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Applied time filter."
                    },
                    "subredditFilter": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Applied subreddit filter."
                    },
                    "resultCountText": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Result count text displayed by Reddit."
                    },
                    "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 absent."
                          },
                          "score": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Post score."
                          },
                          "scoreText": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Score text as displayed by Reddit."
                          },
                          "commentCount": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Comment count."
                          },
                          "commentCountText": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Comment count text as displayed by Reddit."
                          },
                          "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 body of a text post 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 same body as HTML."
                          },
                          "bodyMarkdown": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Only with include [\"body\"]: the same body as Markdown, converted from the HTML — it renders the same, but is not byte-identical to what the author typed."
                          }
                        },
                        "additionalProperties": true
                      }
                    },
                    "listingTitle": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Display title of the listing, or null when unavailable."
                    },
                    "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\"."
                    },
                    "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": "search",
                      "query": "developer tools",
                      "sort": "top",
                      "time": "week",
                      "subredditFilter": "webdev",
                      "items": [
                        {
                          "id": "1wi3mi5",
                          "title": "Is vibe coding creating a hidden technical debt crisis?",
                          "subreddit": "webdev",
                          "author": "powleads",
                          "score": 3241,
                          "commentCount": 418,
                          "url": "https://www.reddit.com/r/webdev/comments/1wi3mi5/",
                          "createdAt": "2026-08-13T03:00:00.000Z",
                          "nsfw": false,
                          "spoiler": false,
                          "locked": false,
                          "stickied": false
                        }
                      ],
                      "itemCount": 1,
                      "pagesRequested": 1,
                      "pagesScraped": 1,
                      "transport": "reddit"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/search-comments": {
      "post": {
        "operationId": "search-comments",
        "tags": [
          "Search"
        ],
        "summary": "Comments matching a keyword — globally or within a subreddit",
        "description": "Search Reddit comments by keyword. Optionally narrow to a specific subreddit. Results include comment body, score, author, subreddit, and permalink.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "Search keyword or phrase."
                  },
                  "subreddit": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Limit search to a specific subreddit."
                  },
                  "sort": {
                    "type": "string",
                    "description": "Sort order: relevance, new, comments, top.",
                    "example": "relevance"
                  },
                  "time": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Time filter: hour, day, week, month, year, or all."
                  },
                  "after": {
                    "type": "string",
                    "description": "Continue where a previous response stopped: pass its nextCursor. Use the same query, subreddit, sort and time."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximum number of results to return.",
                    "example": "25"
                  },
                  "pages": {
                    "type": "integer",
                    "description": "How many pages of results to return, at most. Each page is billed as one, so the credits a request costs equal the pages it actually returns (see `pagesScraped` in the response).",
                    "example": "1"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "query"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "query": "mcp",
                    "sort": "top",
                    "time": "all",
                    "limit": 25
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestedUrl": {
                      "type": "string",
                      "description": "The Reddit URL the request was for."
                    },
                    "finalUrl": {
                      "type": "string",
                      "description": "Final URL after redirects."
                    },
                    "listingType": {
                      "type": "string",
                      "description": "Always comment-search for a successful response."
                    },
                    "listingTitle": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Display title of the result listing."
                    },
                    "resultCountText": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Result count text displayed by Reddit."
                    },
                    "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": "Comment score."
                          },
                          "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 here: comment history and search results do not show whether a comment was removed. Use the post or comment permalink endpoint for removal status."
                          },
                          "removedBy": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Always null here, 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": "What the comment replies to: another comment (t1_…), or the post itself (t3_…) for a top-level comment."
                          }
                        },
                        "additionalProperties": true
                      }
                    },
                    "itemCount": {
                      "type": "number",
                      "description": "Number of comments returned in items."
                    },
                    "nextCursorUrl": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The next page as an api.fetchlayer.dev address, or null at the end. POST it with your key to get the next page (a body is optional; fields you send override the address). Its `after` parameter is nextCursor."
                    },
                    "prevCursorUrl": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Previous page address, or null."
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as after, with the same query, subreddit, sort and time, to get the next page; null at the end."
                    },
                    "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": "comment-search",
                      "items": [
                        {
                          "id": "xyz123",
                          "bodyText": "MCP has been a game changer for my workflow.",
                          "subreddit": "programming",
                          "author": "devuser",
                          "score": 342,
                          "permalink": "https://www.reddit.com/r/programming/comments/.../comment/...",
                          "createdAt": "2026-08-13T03:00:00.000Z",
                          "stickied": false
                        }
                      ],
                      "itemCount": 1,
                      "pagesRequested": 1,
                      "pagesScraped": 1,
                      "transport": "reddit"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/post": {
      "post": {
        "operationId": "post",
        "tags": [
          "Content"
        ],
        "summary": "Full post body + depth-limited comment tree",
        "description": "Retrieve a single post by its full Reddit URL. Returns post metadata, body content, media, outbound links, and top-level comments with descendants through the requested depth. A post that doesn't exist (or is no longer on Reddit at all) returns 404, and so does one in a community that doesn't exist or is banned; a post in a private, quarantined or premium-only community returns 403. Both carry error and code (not_found or forbidden), and neither costs a credit. A post that was removed or deleted still returns 200, with removed: true. A post whose comments Reddit counts but shows none of, because they were removed or deleted, also returns 200, with comments empty and a note saying so. Only a 503 is worth retrying.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "Full Reddit post URL."
                  },
                  "pages": {
                    "type": "integer",
                    "description": "Number of top-level comment pages to expand. Billing: 1 credit per 2 comment pages actually read, rounded up (1–2 pages = 1 credit, 3–4 = 2, 5 = 3), never per page requested; commentPagesScraped in the response is the count billed. A post with few comments fits on one page.",
                    "example": "5"
                  },
                  "depth": {
                    "type": "integer",
                    "description": "How deep to follow each thread: replies are returned down to this nesting depth (0 is top-level comments only). Deeper trees take longer: depth 10 takes about 40 seconds. Replies below the depth, or that Reddit did not show, are listed in moreComments with a token to load them.",
                    "example": "5"
                  },
                  "commentDepth": {
                    "type": "integer",
                    "description": "Another name for depth: threads are followed to this nesting depth (0 returns top-level comments only). Ignored when depth is also given."
                  },
                  "commentLimit": {
                    "type": "integer",
                    "description": "Maximum number of top-level comments. Replies to the comments kept are returned through the requested depth."
                  },
                  "totalCommentLimit": {
                    "type": "integer",
                    "description": "Most comments to return in total, counted in tree order (1 or more). What is left out comes back as moreComments entries that load it."
                  },
                  "sort": {
                    "type": "string",
                    "description": "Order of the comments, as on Reddit: best, top, new, controversial, old or qa. Omit it for Reddit’s default (best). Replies loaded through moreComments keep the same order."
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Extra fields per comment: [\"bodyMarkdown\"] adds each comment’s body as Markdown (links, lists, quotes and code), converted from bodyHtml. Off by default to keep responses small. On this route [\"media\"] replaces the post's media field with the richer media[] below (the post itself, not its comments), in display order: images, gallery slides with captions, videos with a still (poster), link preview images, with sizes, plus blurredUrl for NSFW or spoiler media. Same price as without it."
                  }
                },
                "additionalProperties": false,
                "required": [
                  "url"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "url": "https://www.reddit.com/r/programming/comments/173viwj/meta_the_future_of_rprogramming/",
                    "pages": 5,
                    "depth": 5,
                    "commentLimit": 10
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestedUrl": {
                      "type": "string",
                      "description": "The Reddit URL the request was for."
                    },
                    "finalUrl": {
                      "type": "string",
                      "description": "Final URL after redirects."
                    },
                    "id": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Reddit post ID without the t3_ prefix."
                    },
                    "fullname": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Reddit post fullname, including the t3_ prefix."
                    },
                    "subreddit": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Subreddit name without the r/ prefix."
                    },
                    "subredditPrefixed": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Subreddit name with the r/ prefix."
                    },
                    "author": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Author username."
                    },
                    "title": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Post title."
                    },
                    "permalink": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Absolute URL of the Reddit comments page."
                    },
                    "shortlink": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Short redd.it URL for the post."
                    },
                    "url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Absolute post content URL."
                    },
                    "domain": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Hostname or Reddit domain associated with the post."
                    },
                    "createdAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "ISO 8601 creation timestamp."
                    },
                    "flair": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Post flair text, or null when absent."
                    },
                    "score": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Post score."
                    },
                    "scoreText": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Score text as displayed by Reddit."
                    },
                    "commentCount": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Comment count."
                    },
                    "commentCountText": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Comment count text as displayed by Reddit."
                    },
                    "nsfw": {
                      "type": "boolean",
                      "description": "Whether the post is marked NSFW."
                    },
                    "spoiler": {
                      "type": "boolean",
                      "description": "Whether the post is marked as a spoiler."
                    },
                    "locked": {
                      "type": "boolean",
                      "description": "Whether the post is locked."
                    },
                    "stickied": {
                      "type": "boolean",
                      "description": "Whether the post is stickied."
                    },
                    "removed": {
                      "type": [
                        "boolean",
                        "null"
                      ],
                      "description": "true when the post has been removed or deleted, false when it is live, null when its status could not be read for this response (notes says how many)."
                    },
                    "removedByCategory": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Who removed it, as Reddit reports it: moderator, reddit (spam filters), automod_filtered, deleted (by its author), anti_evil_ops, content_takedown, copyright_takedown. null when not removed or unknown."
                    },
                    "editedAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "ISO 8601 edit timestamp, or null."
                    },
                    "bodyText": {
                      "type": "string",
                      "description": "Plain-text post body."
                    },
                    "bodyHtml": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "HTML post body when available."
                    },
                    "archived": {
                      "type": "boolean",
                      "description": "Whether the post is archived."
                    },
                    "authorId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The author’s account id (t2_…), which stays the same if the username changes; null for a deleted account."
                    },
                    "subredditId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The subreddit’s id (t5_…)."
                    },
                    "numCrossposts": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "How many times the post has been crossposted; null when it could not be checked."
                    },
                    "postType": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "text, link, image, video or gallery; null when it could not be checked. Only text posts have a body."
                    },
                    "linkUrl": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "What a non-text post points to; null for a text post or when it could not be checked."
                    },
                    "bodyMarkdown": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The body as Markdown, converted from bodyHtml; null when the post has no body."
                    },
                    "upvoteRatio": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Share of votes that are upvotes, from 0 to 1."
                    },
                    "awardCount": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "Awards on the post, as Reddit counts them."
                    },
                    "distinguished": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "moderator or admin when the post is distinguished; null otherwise."
                    },
                    "media": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": "object",
                        "additionalProperties": true,
                        "properties": {
                          "width": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Width in pixels; null when not known."
                          },
                          "height": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Height in pixels; null when not known."
                          },
                          "caption": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "gallery_item only: the slide's caption, null when it has none."
                          },
                          "poster": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "additionalProperties": true,
                            "description": "video only: a still image of the video, { url, width, height }."
                          },
                          "blurredUrl": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Reddit's blurred version of an NSFW or spoiler post's media, when Reddit provides one; otherwise null. The post keeps its nsfw and spoiler flags; url is always the real media."
                          }
                        }
                      },
                      "description": "With include [\"media\"]: Only with include [\"media\"]. The post's media, in display order. null for a text post, a removed post, or a post whose media could not be read on that request; notes says how many. Image and gallery originals (i.redd.it) are stable addresses. Preview and poster addresses (preview.redd.it, external-preview.redd.it) can expire or change, so **download them rather than linking to them long-term.**"
                    },
                    "outboundLinks": {
                      "type": "array",
                      "description": "Absolute outbound links found in the post.",
                      "items": {
                        "type": "string"
                      }
                    },
                    "comments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Comment ID without the t1_ prefix."
                          },
                          "fullname": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Reddit comment fullname."
                          },
                          "parentFullname": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Parent Reddit fullname."
                          },
                          "author": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Comment author."
                          },
                          "score": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Comment score."
                          },
                          "scoreText": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Score text as displayed by Reddit."
                          },
                          "createdAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "ISO 8601 creation timestamp."
                          },
                          "bodyText": {
                            "type": "string",
                            "description": "Plain-text comment body."
                          },
                          "bodyHtml": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "HTML comment body when available."
                          },
                          "bodyMarkdown": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Only with include [\"bodyMarkdown\"]: the body as Markdown, converted from bodyHtml."
                          },
                          "permalink": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Absolute comment permalink."
                          },
                          "depth": {
                            "type": "number",
                            "description": "Comment nesting depth."
                          },
                          "collapsed": {
                            "type": "boolean",
                            "description": "Whether the comment is collapsed."
                          },
                          "stickied": {
                            "type": "boolean",
                            "description": "Whether the comment is stickied."
                          },
                          "distinguished": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Moderator/admin distinction, or null."
                          },
                          "removed": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "Whether Reddit has taken the comment down: true when it shows the comment as removed or deleted, false when it shows it normally. Reddit leaves out removed comments that have no replies, so only removed comments that still have replies appear."
                          },
                          "removedBy": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Who took it down: moderator_or_filter (the community moderators or an automatic filter, which Reddit shows the same way), reddit (removed by Reddit itself, when Reddit shows the comment that way) or author (deleted by its author). null when the comment is not removed. A comment shown by [deleted] with its text intact belongs to a deleted account and is not removed."
                          },
                          "children": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "additionalProperties": true
                            },
                            "description": "Nested child comment objects with the same comment shape."
                          },
                          "authorId": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The author’s account id (t2_…); null for a deleted account or when Reddit does not show it."
                          },
                          "postFullname": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The post the comment is on (t3_…)."
                          },
                          "parentId": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "What the comment replies to: another comment (t1_…), or the post (t3_…) for a top-level comment."
                          },
                          "isSubmitter": {
                            "type": "boolean",
                            "description": "Whether the comment’s author is the post’s author."
                          },
                          "editedAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "ISO 8601 time the comment was last edited; null when it was not edited or Reddit does not show it."
                          },
                          "awardCount": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Awards on the comment, as Reddit counts them."
                          },
                          "authorFlair": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The commenter’s flair in that community, as text (emoji as :code:). null means the commenter wears no flair; it means unknown only when the lookup failed, and notes then says so."
                          },
                          "authorFlairRichtext": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "object",
                              "additionalProperties": true
                            },
                            "description": "The same flair as parts: text parts ({ type, text }) and emoji parts ({ type, code, imageUrl }). null when authorFlair is null."
                          },
                          "authorBadges": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "string"
                            },
                            "description": "Reddit achievement badges shown beside the commenter’s name, for example Top 1% Commenter. Not flair. [] means read and none; null means not read."
                          }
                        },
                        "additionalProperties": true
                      }
                    },
                    "commentCountFromTree": {
                      "type": "number",
                      "description": "Number of comments extracted into the tree."
                    },
                    "commentPagesRequested": {
                      "type": "number",
                      "description": "Number of comment pages requested."
                    },
                    "commentPagesScraped": {
                      "type": "number",
                      "description": "Pages of comments read. The call is billed 1 credit per 2 of them, rounded up (minimum 1), never by the pages requested."
                    },
                    "remainingMoreCommentsCount": {
                      "type": "number",
                      "description": "Unexpanded more-comments placeholders remaining."
                    },
                    "moreComments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true,
                        "properties": {
                          "parentId": {
                            "type": "string",
                            "description": "The comment (t1_…) whose replies these are."
                          },
                          "depth": {
                            "type": "integer",
                            "description": "The depth the hidden replies sit at in the thread (the parent’s depth plus one)."
                          },
                          "count": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "How many replies Reddit says are hidden; null when it does not say."
                          },
                          "expandToken": {
                            "type": "string",
                            "description": "Pass to more-comments to load these replies. It belongs to this post; a token from anywhere else is a 400."
                          }
                        }
                      },
                      "description": "Replies this response did not load: one entry per parent comment. Pass an entry’s expandToken to more-comments to load them. Empty when nothing is hidden."
                    },
                    "scrapedAt": {
                      "type": "string",
                      "description": "ISO 8601 time the result was produced."
                    },
                    "transport": {
                      "type": "string",
                      "description": "The data source: always the platform id, \"reddit\"."
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Caveats about this result, for example how many posts had a removal status that could not be checked. When author flair could not be looked up for some commenters, it says so: those comments have authorFlair: null (unknown), not no flair. When Reddit counts comments on the post but shows none, comments is empty and notes says \"Reddit counts N comments on this post but shows none, usually because they were removed.\""
                    }
                  },
                  "additionalProperties": true
                },
                "examples": {
                  "default": {
                    "value": {
                      "id": "173viwj",
                      "title": "Example post",
                      "author": "reddituser",
                      "score": 1500,
                      "commentCount": 87,
                      "bodyText": "This is the post body...",
                      "permalink": "https://www.reddit.com/r/programming/comments/173viwj/example_post/",
                      "createdAt": "2026-08-13T03:00:00.000Z",
                      "comments": [
                        {
                          "id": "c1",
                          "author": "user1",
                          "bodyText": "Great post!",
                          "score": 42,
                          "depth": 0,
                          "parentId": "t3_173viwj",
                          "isSubmitter": false,
                          "children": []
                        }
                      ],
                      "moreComments": [
                        {
                          "parentId": "t1_c1",
                          "depth": 1,
                          "count": 12,
                          "expandToken": "m2.…"
                        }
                      ],
                      "commentCountFromTree": 1,
                      "commentPagesRequested": 1,
                      "commentPagesScraped": 1,
                      "transport": "reddit"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/more-comments": {
      "post": {
        "operationId": "more-comments",
        "tags": [
          "Content"
        ],
        "summary": "Load the replies a post response left out",
        "description": "Load replies a post response did not include: pass one of its `moreComments[].expandToken` values. Returns those replies nested, at their depth in the thread, with their own `moreComments` for anything still hidden below them. A token that did not come from a post response is a 400. Takes about 2 to 9 seconds; 1 credit per call.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expandToken": {
                    "type": "string",
                    "description": "A `moreComments[].expandToken` from a post response: loads the replies it stands for."
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Extra fields per comment: [\"bodyMarkdown\"] adds each comment’s body as Markdown (links, lists, quotes and code), converted from bodyHtml. Off by default to keep responses small."
                  }
                },
                "additionalProperties": false,
                "required": [
                  "expandToken"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "expandToken": "m2.…"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestedUrl": {
                      "type": "string",
                      "description": "The post the replies belong to."
                    },
                    "parentId": {
                      "type": "string",
                      "description": "The comment (t1_…) these replies are under."
                    },
                    "comments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Comment ID without the t1_ prefix."
                          },
                          "fullname": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Reddit comment fullname."
                          },
                          "parentFullname": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Parent Reddit fullname."
                          },
                          "author": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Comment author."
                          },
                          "score": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Comment score."
                          },
                          "scoreText": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Score text as displayed by Reddit."
                          },
                          "createdAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "ISO 8601 creation timestamp."
                          },
                          "bodyText": {
                            "type": "string",
                            "description": "Plain-text comment body."
                          },
                          "bodyHtml": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "HTML comment body when available."
                          },
                          "bodyMarkdown": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Only with include [\"bodyMarkdown\"]: the body as Markdown, converted from bodyHtml."
                          },
                          "permalink": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Absolute comment permalink."
                          },
                          "depth": {
                            "type": "number",
                            "description": "Comment nesting depth."
                          },
                          "collapsed": {
                            "type": "boolean",
                            "description": "Whether the comment is collapsed."
                          },
                          "stickied": {
                            "type": "boolean",
                            "description": "Whether the comment is stickied."
                          },
                          "distinguished": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Moderator/admin distinction, or null."
                          },
                          "removed": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "Whether Reddit has taken the comment down: true when it shows the comment as removed or deleted, false when it shows it normally. Reddit leaves out removed comments that have no replies, so only removed comments that still have replies appear."
                          },
                          "removedBy": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Who took it down: moderator_or_filter (the community moderators or an automatic filter, which Reddit shows the same way), reddit (removed by Reddit itself, when Reddit shows the comment that way) or author (deleted by its author). null when the comment is not removed. A comment shown by [deleted] with its text intact belongs to a deleted account and is not removed."
                          },
                          "children": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "additionalProperties": true
                            },
                            "description": "Nested child comment objects with the same comment shape."
                          },
                          "authorId": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The author’s account id (t2_…); null for a deleted account or when Reddit does not show it."
                          },
                          "postFullname": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The post the comment is on (t3_…)."
                          },
                          "parentId": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "What the comment replies to: another comment (t1_…), or the post (t3_…) for a top-level comment."
                          },
                          "isSubmitter": {
                            "type": "boolean",
                            "description": "Whether the comment’s author is the post’s author."
                          },
                          "editedAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "ISO 8601 time the comment was last edited; null when it was not edited or Reddit does not show it."
                          },
                          "awardCount": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Awards on the comment, as Reddit counts them."
                          },
                          "authorFlair": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The commenter’s flair in that community, as text (emoji as :code:). null means the commenter wears no flair; it means unknown only when the lookup failed, and notes then says so."
                          },
                          "authorFlairRichtext": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "object",
                              "additionalProperties": true
                            },
                            "description": "The same flair as parts: text parts ({ type, text }) and emoji parts ({ type, code, imageUrl }). null when authorFlair is null."
                          },
                          "authorBadges": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "string"
                            },
                            "description": "Reddit achievement badges shown beside the commenter’s name, for example Top 1% Commenter. Not flair. [] means read and none; null means not read."
                          }
                        },
                        "additionalProperties": true
                      }
                    },
                    "commentCount": {
                      "type": "integer",
                      "description": "Number of comments returned, nested replies included."
                    },
                    "moreComments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true,
                        "properties": {
                          "parentId": {
                            "type": "string",
                            "description": "The comment (t1_…) whose replies these are."
                          },
                          "depth": {
                            "type": "integer",
                            "description": "The depth the hidden replies sit at in the thread (the parent’s depth plus one)."
                          },
                          "count": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "How many replies Reddit says are hidden; null when it does not say."
                          },
                          "expandToken": {
                            "type": "string",
                            "description": "Pass to more-comments to load these replies. It belongs to this post; a token from anywhere else is a 400."
                          }
                        }
                      },
                      "description": "Replies still hidden below the ones returned, one entry per parent comment, each with a token to load them. Empty when nothing is hidden."
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Caveats about this result, for example a field that could not be checked. When author flair could not be looked up for some commenters, it says so: those comments have authorFlair: null (unknown), not no flair."
                    },
                    "scrapedAt": {
                      "type": "string",
                      "description": "ISO 8601 time the result was produced."
                    },
                    "transport": {
                      "type": "string",
                      "description": "The data source: always the platform id, \"reddit\"."
                    }
                  },
                  "additionalProperties": true
                },
                "examples": {
                  "default": {
                    "value": {
                      "requestedUrl": "https://www.reddit.com/r/programming/comments/173viwj/example_post/",
                      "parentId": "t1_c1",
                      "comments": [
                        {
                          "id": "c7",
                          "fullname": "t1_c7",
                          "author": "user7",
                          "bodyText": "Agreed.",
                          "score": 5,
                          "depth": 1,
                          "parentId": "t1_c1",
                          "isSubmitter": false,
                          "children": []
                        }
                      ],
                      "commentCount": 1,
                      "moreComments": [],
                      "notes": [],
                      "scrapedAt": "2026-10-25T12:00:00.000Z",
                      "transport": "reddit"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/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": []
          }
        ]
      }
    },
    "/user-profile": {
      "post": {
        "operationId": "user-profile",
        "tags": [
          "User"
        ],
        "summary": "Karma, bio, account age, and public profile info",
        "description": "Retrieve public profile information for any Reddit user including karma breakdown, account age, and bio.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "username": {
                    "type": "string",
                    "description": "Reddit username."
                  }
                },
                "additionalProperties": false,
                "required": [
                  "username"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "username": "spez"
                  }
                }
              }
            }
          }
        },
        "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."
                    },
                    "username": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Reddit username."
                    },
                    "displayName": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Profile display name."
                    },
                    "aboutText": {
                      "type": "string",
                      "description": "Plain-text profile description."
                    },
                    "aboutHtml": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "HTML profile description when available."
                    },
                    "postKarma": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Post karma."
                    },
                    "postKarmaText": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Post karma text as displayed by Reddit."
                    },
                    "commentKarma": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Comment karma."
                    },
                    "commentKarmaText": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Comment karma text as displayed by Reddit."
                    },
                    "createdAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The day the account was created, as 00:00 UTC on that day (ISO 8601): Reddit publishes only the day, not the time."
                    },
                    "ageText": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable account age."
                    },
                    "followers": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Follower count shown on the profile. null when the user hides it or has none; a rounded count (e.g. 34.2k) adds an entry to notes."
                    },
                    "avatarUrl": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Profile avatar URL."
                    },
                    "bannerUrl": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Profile banner URL."
                    },
                    "trophies": {
                      "type": "array",
                      "description": "Trophy names displayed on the profile.",
                      "items": {
                        "type": "string"
                      }
                    },
                    "isGold": {
                      "type": "boolean",
                      "description": "Whether Reddit marks the account as Gold."
                    },
                    "url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Absolute Reddit profile URL."
                    },
                    "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 that the follower count is rounded and may be approximate."
                    },
                    "userId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The account’s id (t2_…), which stays the same if the username changes."
                    },
                    "createdAtPrecision": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "How precise createdAt is: always \"date\" (only the day is published), or null when createdAt is null."
                    }
                  },
                  "additionalProperties": true
                },
                "examples": {
                  "default": {
                    "value": {
                      "username": "spez",
                      "displayName": "spez",
                      "aboutText": "Reddit profile description.",
                      "postKarma": 800000,
                      "postKarmaText": "800K",
                      "commentKarma": 700000,
                      "commentKarmaText": "700K",
                      "createdAt": "2005-06-23T00:00:00.000Z",
                      "ageText": "21 years",
                      "followers": null,
                      "isGold": true,
                      "trophies": [
                        "Verified Email"
                      ],
                      "url": "https://www.reddit.com/user/spez/",
                      "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": []
          }
        ]
      }
    },
    "/user-posts": {
      "post": {
        "operationId": "user-posts",
        "tags": [
          "User"
        ],
        "summary": "All public posts submitted by a user",
        "description": "Retrieve the public post history for a Reddit user. Supports pagination. A deleted or suspended account, or a name that was never registered, returns 404 with error \"No public Reddit profile was found for this name.\" and code not_found (retryable false), and costs no credit; when that cannot be confirmed, the answer is a 503 worth retrying. A profile with no public posts returns 200 with an empty items list and the note \"This profile shows no public posts.\"",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "username": {
                    "type": "string",
                    "description": "Reddit username."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximum number of posts 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": "Pagination cursor (after)."
                  },
                  "sort": {
                    "type": "string",
                    "description": "Order of the posts: new, hot or top. Omit it for newest first, as before."
                  },
                  "time": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Time window for sort top: hour, day, week, month, year or all. Ignored for other orders."
                  },
                  "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": [
                  "username"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "username": "spez",
                    "limit": 10
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestedUrl": {
                      "type": "string",
                      "description": "The Reddit URL the request was for."
                    },
                    "finalUrl": {
                      "type": "string",
                      "description": "Final URL after redirects."
                    },
                    "listingType": {
                      "type": "string",
                      "description": "Always user-posts for a successful response."
                    },
                    "username": {
                      "type": "string",
                      "description": "Requested Reddit username."
                    },
                    "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 absent."
                          },
                          "score": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Post score."
                          },
                          "scoreText": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Score text as displayed by Reddit."
                          },
                          "commentCount": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Comment count."
                          },
                          "commentCountText": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Comment count text as displayed by Reddit."
                          },
                          "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). The profile feed keeps a user’s removed posts, so true appears here."
                          },
                          "removedByCategory": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "When removed is true: reddit (Reddit’s spam filters), moderator (the community’s moderators), content_takedown (removed by Reddit), deleted (the author deleted it), or null when the page does not say by whom (for example a post awaiting moderator approval). null when removed is false."
                          },
                          "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
                      }
                    },
                    "listingTitle": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Display title of the listing, or null when unavailable."
                    },
                    "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\"."
                    },
                    "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, or \"This profile shows no public posts.\" when the profile has none."
                    }
                  },
                  "additionalProperties": true
                },
                "examples": {
                  "default": {
                    "value": {
                      "listingType": "user-posts",
                      "username": "spez",
                      "items": [
                        {
                          "id": "abc",
                          "title": "Announcing new features",
                          "subreddit": "reddit",
                          "score": 5000,
                          "commentCount": 800,
                          "permalink": "https://www.reddit.com/r/reddit/comments/abc/",
                          "createdAt": "2026-08-13T03:00:00.000Z",
                          "nsfw": false,
                          "spoiler": false,
                          "locked": false,
                          "stickied": false
                        }
                      ],
                      "itemCount": 1,
                      "nextPageUrl": "https://api.fetchlayer.dev/reddit/user-posts?after=t3_abc",
                      "pagesRequested": 1,
                      "pagesScraped": 1,
                      "transport": "reddit"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/user-comments": {
      "post": {
        "operationId": "user-comments",
        "tags": [
          "User"
        ],
        "summary": "Comment history for any public user",
        "description": "Retrieve the public comment history for a Reddit user. Supports pagination. A deleted or suspended account, or a name that was never registered, returns 404 with error \"No public Reddit profile was found for this name.\" and code not_found (retryable false), and costs no credit; when that cannot be confirmed, the answer is a 503 worth retrying. A profile with no public comments returns 200 with an empty items list and the note \"This profile shows no public comments.\"",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "username": {
                    "type": "string",
                    "description": "Reddit username."
                  },
                  "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": "Pagination cursor (after)."
                  },
                  "sort": {
                    "type": "string",
                    "description": "Order of the comments: new, hot or top. Omit it for newest first, as before."
                  },
                  "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."
                  },
                  "time": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Time window for sort top: hour, day, week, month, year or all. Ignored for other orders."
                  }
                },
                "additionalProperties": false,
                "required": [
                  "username"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "username": "spez",
                    "limit": 10
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestedUrl": {
                      "type": "string",
                      "description": "The Reddit URL the request was for."
                    },
                    "finalUrl": {
                      "type": "string",
                      "description": "Final URL after redirects."
                    },
                    "listingType": {
                      "type": "string",
                      "description": "Always user-comments for a successful response."
                    },
                    "username": {
                      "type": "string",
                      "description": "Requested Reddit username."
                    },
                    "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": "Comment score."
                          },
                          "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 here: comment history and search results do not show whether a comment was removed. Use the post or comment permalink endpoint for removal status."
                          },
                          "removedBy": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Always null here, 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": "What the comment replies to: another comment (t1_…), or the post itself (t3_…) for a top-level comment."
                          },
                          "bodyMarkdown": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Only with include [\"bodyMarkdown\"]: the comment’s body as Markdown, converted from bodyHtml."
                          }
                        },
                        "additionalProperties": true
                      }
                    },
                    "listingTitle": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Display title of the listing, or null when unavailable."
                    },
                    "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\"."
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Caveats about this result, for example \"This profile shows no public comments.\" when the profile has none."
                    }
                  },
                  "additionalProperties": true
                },
                "examples": {
                  "default": {
                    "value": {
                      "listingType": "user-comments",
                      "username": "spez",
                      "items": [
                        {
                          "id": "xyz",
                          "bodyText": "Thanks for the feedback!",
                          "subreddit": "reddit",
                          "score": 250,
                          "parentPostTitle": "Announcing new features",
                          "permalink": "https://www.reddit.com/r/reddit/comments/abc/comment/xyz/",
                          "createdAt": "2026-08-13T03:00:00.000Z",
                          "stickied": false
                        }
                      ],
                      "itemCount": 1,
                      "nextPageUrl": "https://api.fetchlayer.dev/reddit/user-comments?after=t1_xyz",
                      "pagesRequested": 1,
                      "pagesScraped": 1,
                      "transport": "reddit"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/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": []
          }
        ]
      }
    },
    "/search-communities": {
      "post": {
        "operationId": "search-communities",
        "tags": [
          "Search"
        ],
        "summary": "Find subreddits by keyword",
        "description": "Search for subreddits matching a keyword. Returns community names, descriptions, URLs, metadata text, and NSFW status.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "Search keyword."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Max results.",
                    "example": "25"
                  },
                  "pages": {
                    "type": "integer",
                    "description": "How many pages of results to return, at most. Each page holds 10 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 / 10)`. 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 where a previous response stopped: pass its nextCursor. Use the same query."
                  }
                },
                "additionalProperties": false,
                "required": [
                  "query"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "query": "programming",
                    "limit": 5
                  }
                }
              }
            }
          }
        },
        "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 search-communities for a successful response."
                    },
                    "query": {
                      "type": "string",
                      "description": "Community search query."
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "subreddit": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Subreddit name without the r/ prefix."
                          },
                          "subredditPrefixed": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Subreddit name with the r/ prefix."
                          },
                          "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."
                          },
                          "url": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Absolute subreddit URL."
                          },
                          "metaText": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Metadata text displayed by Reddit."
                          },
                          "nsfw": {
                            "type": "boolean",
                            "description": "Whether the community marks itself as 18+ (NSFW)."
                          }
                        },
                        "additionalProperties": true
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as after, with the same query, to continue exactly where this response stopped; null at the end."
                    },
                    "listingTitle": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Display title of the listing, or null when unavailable."
                    },
                    "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": "search-communities",
                      "query": "programming",
                      "items": [
                        {
                          "subreddit": "programming",
                          "subredditPrefixed": "r/programming",
                          "title": "Programming",
                          "descriptionText": "Computer Programming",
                          "url": "https://www.reddit.com/r/programming/",
                          "metaText": "Programming community",
                          "nsfw": false
                        }
                      ],
                      "itemCount": 1,
                      "pagesRequested": 1,
                      "pagesScraped": 1,
                      "transport": "reddit"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/search-users": {
      "post": {
        "operationId": "search-users",
        "tags": [
          "Search"
        ],
        "summary": "Find Reddit users by name",
        "description": "Search for Reddit users by username. Returns matching profile names, descriptions, metadata, and URLs.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "Username to search for."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Max results.",
                    "example": "10"
                  },
                  "pages": {
                    "type": "integer",
                    "description": "How many pages of results to return, at most. Each page holds 10 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 / 10)`. 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 where a previous response stopped: pass its nextCursor. Use the same query."
                  }
                },
                "additionalProperties": false,
                "required": [
                  "query"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "query": "spez",
                    "limit": 5
                  }
                }
              }
            }
          }
        },
        "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 search-users for a successful response."
                    },
                    "query": {
                      "type": "string",
                      "description": "User search query."
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "username": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Reddit username."
                          },
                          "displayName": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Profile display name."
                          },
                          "descriptionText": {
                            "type": "string",
                            "description": "Plain-text profile description."
                          },
                          "descriptionHtml": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "HTML profile description when available."
                          },
                          "url": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Absolute Reddit profile URL."
                          },
                          "metaText": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Metadata text displayed by Reddit."
                          }
                        },
                        "additionalProperties": true
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as after, with the same query, to continue exactly where this response stopped; null at the end."
                    },
                    "listingTitle": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Display title of the listing, or null when unavailable."
                    },
                    "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": "search-users",
                      "query": "spez",
                      "items": [
                        {
                          "username": "spez",
                          "displayName": "spez",
                          "descriptionText": "Reddit profile description.",
                          "url": "https://www.reddit.com/user/spez/",
                          "metaText": "Reddit user"
                        }
                      ],
                      "itemCount": 1,
                      "pagesRequested": 1,
                      "pagesScraped": 1,
                      "transport": "reddit"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/comment-permalink": {
      "post": {
        "operationId": "comment-permalink",
        "tags": [
          "Content"
        ],
        "summary": "Single comment with parent context and replies",
        "description": "Retrieve a specific comment by its full Reddit permalink, including parent post context, ancestors, and nested replies. A comment whose post doesn't exist (or is no longer on Reddit at all) returns 404, and so does one in a community that doesn't exist or is banned; a post in a private, quarantined or premium-only community returns 403. Both carry error and code (not_found or forbidden), and neither costs a credit. A post that was removed or deleted still returns 200, with removed: true. Only a 503 is worth retrying.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "Full Reddit comment permalink URL."
                  },
                  "pages": {
                    "type": "integer",
                    "description": "Number of comment pages to expand. A comment-permalink call is billed 1 credit, whatever the pages.",
                    "example": "1"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "url"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "url": "https://www.reddit.com/r/programming/comments/173viwj/meta_the_future_of_rprogramming/k45nozy/",
                    "pages": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestedUrl": {
                      "type": "string",
                      "description": "The Reddit URL the request was for."
                    },
                    "finalUrl": {
                      "type": "string",
                      "description": "Final URL after redirects."
                    },
                    "listingType": {
                      "type": "string",
                      "description": "Always comment-permalink for a successful response."
                    },
                    "commentId": {
                      "type": "string",
                      "description": "Requested comment ID without the t1_ prefix."
                    },
                    "postId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Parent post ID."
                    },
                    "subreddit": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Parent subreddit name."
                    },
                    "subredditPrefixed": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Parent subreddit name with r/ prefix."
                    },
                    "postTitle": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Parent post title."
                    },
                    "postAuthor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Parent post author."
                    },
                    "postPermalink": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Absolute parent post permalink."
                    },
                    "postUrl": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Parent post content URL."
                    },
                    "focalCommentFound": {
                      "type": "boolean",
                      "description": "Whether the requested comment was found in the expanded tree."
                    },
                    "focalComment": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "additionalProperties": true,
                      "description": "Requested comment with nested children, or null when not found.",
                      "properties": {
                        "id": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Focal comment ID."
                        },
                        "fullname": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Focal comment fullname."
                        },
                        "parentFullname": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Parent Reddit fullname."
                        },
                        "author": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Focal comment author."
                        },
                        "score": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Focal comment score."
                        },
                        "scoreText": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Focal comment score text."
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "ISO 8601 comment creation timestamp."
                        },
                        "bodyText": {
                          "type": "string",
                          "description": "Plain-text focal comment body."
                        },
                        "bodyHtml": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "HTML focal comment body."
                        },
                        "permalink": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Absolute focal comment permalink."
                        },
                        "depth": {
                          "type": "number",
                          "description": "Comment nesting depth."
                        },
                        "collapsed": {
                          "type": "boolean",
                          "description": "Whether the focal comment is collapsed."
                        },
                        "stickied": {
                          "type": "boolean",
                          "description": "Whether the focal comment is stickied."
                        },
                        "distinguished": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Moderator/admin distinction, or null."
                        },
                        "removed": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "description": "Whether Reddit has taken the comment down: true when it shows the comment as removed or deleted, false when it shows it normally. Reddit leaves out removed comments that have no replies, so only removed comments that still have replies appear."
                        },
                        "removedBy": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Who took it down: moderator_or_filter (the community moderators or an automatic filter, which Reddit shows the same way), reddit (removed by Reddit itself, when Reddit shows the comment that way) or author (deleted by its author). null when the comment is not removed. A comment shown by [deleted] with its text intact belongs to a deleted account and is not removed."
                        },
                        "authorFlair": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "The commenter’s flair in that community, as text (emoji as :code:). null means the commenter wears no flair; it means unknown only when the lookup failed, and notes then says so."
                        },
                        "authorFlairRichtext": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "object",
                            "additionalProperties": true
                          },
                          "description": "The same flair as parts: text parts ({ type, text }) and emoji parts ({ type, code, imageUrl }). null when authorFlair is null."
                        },
                        "authorBadges": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "string"
                          },
                          "description": "Reddit achievement badges shown beside the commenter’s name, for example Top 1% Commenter. Not flair. [] means read and none; null means not read."
                        },
                        "children": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "additionalProperties": true
                          },
                          "description": "Nested child comment objects."
                        }
                      }
                    },
                    "ancestorComments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Ancestor comment ID."
                          },
                          "fullname": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Ancestor comment fullname."
                          },
                          "parentFullname": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Ancestor parent fullname."
                          },
                          "author": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Ancestor comment author."
                          },
                          "score": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Ancestor comment score."
                          },
                          "scoreText": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Ancestor score text."
                          },
                          "createdAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "ISO 8601 ancestor creation timestamp."
                          },
                          "bodyText": {
                            "type": "string",
                            "description": "Plain-text ancestor comment body."
                          },
                          "bodyHtml": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "HTML ancestor comment body."
                          },
                          "permalink": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Absolute ancestor comment permalink."
                          },
                          "depth": {
                            "type": "number",
                            "description": "Ancestor nesting depth."
                          },
                          "collapsed": {
                            "type": "boolean",
                            "description": "Whether the ancestor is collapsed."
                          },
                          "stickied": {
                            "type": "boolean",
                            "description": "Whether the ancestor is stickied."
                          },
                          "distinguished": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Moderator/admin distinction, or null."
                          },
                          "removed": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "Whether Reddit has taken the comment down: true when it shows the comment as removed or deleted, false when it shows it normally. Reddit leaves out removed comments that have no replies, so only removed comments that still have replies appear."
                          },
                          "removedBy": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Who took it down: moderator_or_filter (the community moderators or an automatic filter, which Reddit shows the same way), reddit (removed by Reddit itself, when Reddit shows the comment that way) or author (deleted by its author). null when the comment is not removed. A comment shown by [deleted] with its text intact belongs to a deleted account and is not removed."
                          },
                          "authorFlair": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The commenter’s flair in that community, as text (emoji as :code:). null means the commenter wears no flair; it means unknown only when the lookup failed, and notes then says so."
                          },
                          "authorFlairRichtext": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "object",
                              "additionalProperties": true
                            },
                            "description": "The same flair as parts: text parts ({ type, text }) and emoji parts ({ type, code, imageUrl }). null when authorFlair is null."
                          },
                          "authorBadges": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "string"
                            },
                            "description": "Reddit achievement badges shown beside the commenter’s name, for example Top 1% Commenter. Not flair. [] means read and none; null means not read."
                          }
                        },
                        "additionalProperties": true
                      }
                    },
                    "replyCount": {
                      "type": "number",
                      "description": "Number of descendants under the focal comment."
                    },
                    "commentPagesRequested": {
                      "type": "number",
                      "description": "Number of comment pages requested."
                    },
                    "commentPagesScraped": {
                      "type": "number",
                      "description": "Pages of comments read."
                    },
                    "remainingMoreCommentsCount": {
                      "type": "number",
                      "description": "Unexpanded more-comments placeholders remaining."
                    },
                    "scrapedAt": {
                      "type": "string",
                      "description": "ISO 8601 time the result was produced."
                    },
                    "transport": {
                      "type": "string",
                      "description": "The data source: always the platform id, \"reddit\"."
                    }
                  },
                  "additionalProperties": true
                },
                "examples": {
                  "default": {
                    "value": {
                      "listingType": "comment-permalink",
                      "commentId": "k45nozy",
                      "postId": "173viwj",
                      "postTitle": "[META] The future of r/programming",
                      "focalCommentFound": true,
                      "focalComment": {
                        "id": "k45nozy",
                        "author": "DrunkensteinsMonster",
                        "bodyText": "Biggest issues I see are the blogspam and the ads masquerading as tech blog posts…",
                        "score": 200,
                        "createdAt": "2023-10-09T17:26:25.760Z",
                        "depth": 0,
                        "collapsed": false,
                        "stickied": false,
                        "children": []
                      },
                      "ancestorComments": [],
                      "replyCount": 0,
                      "commentPagesRequested": 1,
                      "commentPagesScraped": 1,
                      "transport": "reddit"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/popular": {
      "post": {
        "operationId": "popular",
        "tags": [
          "Discover"
        ],
        "summary": "r/popular — trending posts across Reddit right now",
        "description": "Get the current r/popular feed. See what's trending across all of Reddit in real time.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "limit": {
                    "type": "integer",
                    "description": "Maximum number of posts 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 where a previous response stopped: pass the after of its nextPageUrl (the last result’s fullname), or POST the nextPageUrl itself."
                  }
                },
                "additionalProperties": false
              },
              "examples": {
                "default": {
                  "value": {
                    "limit": 10
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestedUrl": {
                      "type": "string",
                      "description": "The Reddit URL the request was for."
                    },
                    "finalUrl": {
                      "type": "string",
                      "description": "Final URL after redirects."
                    },
                    "listingType": {
                      "type": "string",
                      "description": "Always popular for a successful response."
                    },
                    "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 absent."
                          },
                          "score": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Post score."
                          },
                          "scoreText": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Score text as displayed by Reddit."
                          },
                          "commentCount": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Comment count."
                          },
                          "commentCountText": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Comment count text as displayed by Reddit."
                          },
                          "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."
                          },
                          "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."
                          }
                        },
                        "additionalProperties": true
                      }
                    },
                    "listingTitle": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Display title of the listing, or null when unavailable."
                    },
                    "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\"."
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Caveats about this result, for example how many posts had a removal status that could not be checked. When author flair could not be looked up for some commenters, it says so: those comments have authorFlair: null (unknown), not no flair."
                    }
                  },
                  "additionalProperties": true
                },
                "examples": {
                  "default": {
                    "value": {
                      "listingType": "popular",
                      "items": [
                        {
                          "id": "xyz",
                          "title": "Trending post",
                          "subreddit": "popular",
                          "author": "user123",
                          "score": 10000,
                          "commentCount": 2000,
                          "permalink": "https://www.reddit.com/r/popular/comments/xyz/",
                          "createdAt": "2026-08-13T03:00:00.000Z",
                          "nsfw": false,
                          "spoiler": false,
                          "locked": false,
                          "stickied": false
                        }
                      ],
                      "itemCount": 1,
                      "pagesRequested": 1,
                      "pagesScraped": 1,
                      "transport": "reddit"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/leaderboard": {
      "post": {
        "operationId": "leaderboard",
        "tags": [
          "Discover"
        ],
        "summary": "Popular communities leaderboard",
        "description": "Get Reddit’s popular-community listing with names, descriptions, URLs, metadata text, and NSFW status.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "limit": {
                    "type": "integer",
                    "description": "Number of communities.",
                    "example": "25"
                  },
                  "pages": {
                    "type": "integer",
                    "description": "How many pages of results to return, at most. Each page is billed as one, so the credits a request costs equal the pages it actually returns (see `pagesScraped` in the response).",
                    "example": "1"
                  },
                  "after": {
                    "type": "string",
                    "description": "Continue where a previous response stopped: pass the after of its nextPageUrl (the last result’s fullname), or POST the nextPageUrl itself."
                  }
                },
                "additionalProperties": false
              },
              "examples": {
                "default": {
                  "value": {
                    "limit": 10
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestedUrl": {
                      "type": "string",
                      "description": "The Reddit URL the request was for."
                    },
                    "finalUrl": {
                      "type": "string",
                      "description": "Final URL after redirects."
                    },
                    "listingType": {
                      "type": "string",
                      "description": "Always leaderboard for a successful response."
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "subreddit": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Subreddit name without the r/ prefix."
                          },
                          "subredditPrefixed": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Subreddit name with the r/ prefix."
                          },
                          "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."
                          },
                          "url": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Absolute subreddit URL."
                          },
                          "metaText": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Metadata text displayed by Reddit."
                          },
                          "nsfw": {
                            "type": "boolean",
                            "description": "Whether the community marks itself as 18+ (NSFW)."
                          }
                        },
                        "additionalProperties": true
                      }
                    },
                    "listingTitle": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Display title of the listing, or null when unavailable."
                    },
                    "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": "leaderboard",
                      "items": [
                        {
                          "subreddit": "programming",
                          "subredditPrefixed": "r/programming",
                          "title": "Programming",
                          "descriptionText": "Computer Programming",
                          "url": "https://www.reddit.com/r/programming/",
                          "metaText": "Popular community",
                          "nsfw": false
                        }
                      ],
                      "itemCount": 1,
                      "pagesRequested": 1,
                      "pagesScraped": 1,
                      "transport": "reddit"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/resolve-url-type": {
      "post": {
        "operationId": "resolve-url-type",
        "tags": [
          "Utility"
        ],
        "summary": "Identify what a Reddit URL points to",
        "description": "Resolve a Reddit URL into the backend target and normalized input needed to call the matching endpoint.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "Full Reddit URL."
                  }
                },
                "additionalProperties": false,
                "required": [
                  "url"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "url": "https://www.reddit.com/r/programming/comments/173viwj/meta_the_future_of_rprogramming/"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "inputUrl": {
                      "type": "string",
                      "description": "URL supplied by the caller."
                    },
                    "normalizedUrl": {
                      "type": "string",
                      "description": "Normalized absolute Reddit URL."
                    },
                    "target": {
                      "type": "string",
                      "description": "Resolved backend target, such as post or comment_permalink."
                    },
                    "targetInput": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Input object to send to the resolved endpoint."
                    },
                    "subreddit": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Resolved subreddit name."
                    },
                    "username": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Resolved username."
                    },
                    "postId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Resolved post ID."
                    },
                    "commentId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Resolved comment ID."
                    },
                    "query": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Resolved search query."
                    },
                    "sort": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Resolved sort value."
                    },
                    "time": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Resolved time filter."
                    }
                  },
                  "additionalProperties": true
                },
                "examples": {
                  "default": {
                    "value": {
                      "inputUrl": "https://www.reddit.com/r/programming/comments/173viwj/meta_the_future_of_rprogramming/",
                      "normalizedUrl": "https://www.reddit.com/r/programming/comments/173viwj/meta_the_future_of_rprogramming/",
                      "target": "post",
                      "targetInput": {
                        "url": "https://www.reddit.com/r/programming/comments/173viwj/meta_the_future_of_rprogramming/"
                      },
                      "subreddit": "programming",
                      "postId": "173viwj",
                      "commentId": null,
                      "username": null,
                      "query": null,
                      "sort": null,
                      "time": null
                    }
                  }
                }
              }
            }
          },
          "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": []
          }
        ]
      }
    },
    "/explore": {
      "post": {
        "operationId": "explore",
        "tags": [
          "Discover"
        ],
        "summary": "Browse communities grouped by topic",
        "description": "Explore subreddits organized by topic/category. Returns a curated list of communities across different interests.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "topic": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Optional Reddit explore topic filter."
                  }
                },
                "additionalProperties": false
              },
              "examples": {
                "default": {
                  "value": {
                    "topic": "technology"
                  }
                }
              }
            }
          }
        },
        "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 explore for a successful response."
                    },
                    "sections": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "heading": {
                            "type": "string",
                            "description": "Explore section heading."
                          },
                          "items": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "subreddit": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "description": "Subreddit name without the r/ prefix."
                                },
                                "subredditPrefixed": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "description": "Subreddit name with the r/ prefix."
                                },
                                "subredditId": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "description": "Reddit subreddit ID."
                                },
                                "title": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "description": "Community title."
                                },
                                "descriptionText": {
                                  "type": "string",
                                  "description": "Plain-text community description."
                                },
                                "iconUrl": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "description": "Community icon URL."
                                },
                                "url": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "description": "Absolute subreddit URL."
                                },
                                "weeklyVisitorsText": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "description": "Weekly visitors text displayed by Reddit."
                                }
                              },
                              "additionalProperties": true
                            }
                          }
                        },
                        "additionalProperties": true
                      }
                    },
                    "allItems": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "subreddit": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Subreddit name without the r/ prefix."
                          },
                          "subredditPrefixed": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Subreddit name with the r/ prefix."
                          },
                          "subredditId": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Reddit subreddit ID."
                          },
                          "title": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Community title."
                          },
                          "descriptionText": {
                            "type": "string",
                            "description": "Plain-text community description."
                          },
                          "iconUrl": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Community icon URL."
                          },
                          "url": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Absolute subreddit URL."
                          },
                          "weeklyVisitorsText": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Weekly visitors text displayed by Reddit."
                          }
                        },
                        "additionalProperties": true
                      }
                    },
                    "totalItemCount": {
                      "type": "number",
                      "description": "Total number of communities in allItems."
                    },
                    "topics": {
                      "type": "array",
                      "description": "Available explore topic filters.",
                      "items": {
                        "type": "string"
                      }
                    },
                    "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": "explore",
                      "sections": [
                        {
                          "heading": "Technology",
                          "items": [
                            {
                              "subreddit": "programming",
                              "subredditPrefixed": "r/programming",
                              "subredditId": "t5_2fwo",
                              "title": "Programming",
                              "descriptionText": "Computer Programming",
                              "url": "https://www.reddit.com/r/programming/"
                            }
                          ]
                        }
                      ],
                      "allItems": [],
                      "totalItemCount": 1,
                      "topics": [
                        "Technology"
                      ],
                      "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": []
          }
        ]
      }
    }
  }
}