{
  "openapi": "3.1.0",
  "info": {
    "title": "FetchLayer Reddit API — User",
    "version": "1.0.0",
    "description": "User profiles, posts, and comment history."
  },
  "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": {
    "/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": []
          }
        ]
      }
    }
  }
}