{"openapi":"3.0.3","info":{"title":"Reddit API (ReefAPI)","version":"0.8.0","description":"Reddit API — subreddit posts, comments, search, user profiles, trending & community data from reddit.com (no account required) Call POST /reddit/v1/{action} with an x-api-key header; every response is the { ok, data, meta, error } envelope.","contact":{"name":"ReefAPI","url":"https://reefapi.com/reddit-api","email":"support@reefapi.com"},"license":{"name":"ReefAPI Terms","url":"https://reefapi.com/terms"},"termsOfService":"https://reefapi.com/terms"},"externalDocs":{"description":"Reddit API documentation","url":"https://reefapi.com/docs/reddit"},"servers":[{"url":"https://api.reefapi.com"}],"security":[{"ApiKeyAuth":[]}],"tags":[{"name":"reddit","description":"Reddit API — subreddit posts, comments, search, user profiles, trending & community data from reddit.com (no account required)"}],"paths":{"/reddit/v1/subreddit_posts":{"post":{"operationId":"reddit_subreddit_posts","summary":"Posts in a subreddit, ranked by `sort`","description":"Posts in a subreddit, ranked by `sort`. Returns title/author/score/comment-count. Supports deep paging (`page`) and `flair` filtering.","tags":["reddit"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"subreddit":{"type":"string","example":"python","description":"Subreddit name (without 'r/')."},"sort":{"type":"string","enum":["hot","new","top","rising","controversial"],"default":"hot","description":"How posts are ranked."},"time":{"type":"string","enum":["hour","day","week","month","year","all"],"default":"day","description":"Time window — applies ONLY when sort = top or controversial."},"limit":{"type":"integer","minimum":1,"maximum":100,"default":10,"description":"How many posts to return (1–100)."},"flair":{"type":"string","example":"Discussion","description":"Filter to one post flair, e.g. 'Discussion' (case-insensitive, live source only). Matches flairs that CONTAIN the text ('Hiring' also keeps 'Hiring - Open'); set flair_exact=true for the whole flair only."},"flair_exact":{"type":"boolean","default":false,"description":"With `flair`: keep only posts whose flair is exactly that text (case-insensitive), not flairs that merely contain it."},"source":{"type":"string","enum":["auto","live","arctic","pullpush"],"default":"auto","description":"Which Reddit data source to use — 'auto' picks the best source automatically."},"page":{"type":"integer","minimum":1,"maximum":20,"default":1,"description":"Deep paging: page 2 returns the NEXT batch after page 1 (server chains cursors for you, 1–20). Live source only — archive sources page via after_utc/before_utc."},"cursor":{"type":"string","description":"Next page: pass the previous response's meta.pagination.next_cursor (the 'Next' button does this automatically)."}},"required":["subreddit"]},"example":{"subreddit":"python","limit":10}}}},"responses":{"200":{"description":"Result envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"description":"Missing or invalid x-api-key"},"429":{"description":"Rate limited or quota exhausted"}},"x-reefapi-credits":1}},"/reddit/v1/multi_subreddit_posts":{"post":{"operationId":"reddit_multi_subreddit_posts","summary":"ONE merged newest-first feed across a whole watchlist of subreddits — pass up to 5000 names in a single call instead of polling each one","description":"ONE merged newest-first feed across a whole watchlist of subreddits — pass up to 5000 names in a single call instead of polling each one. Built for near-real-time monitoring: posts show up seconds after they go live, `since_utc` returns only what is new since your last poll.","tags":["reddit"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"subreddits":{"type":"string","example":"python,rust,golang","description":"Subreddit names to merge, comma-separated (no 'r/'). Up to 5000 — long lists are split across parallel fetches for you and returned as one feed."},"sort":{"type":"string","enum":["new","hot","rising","top","controversial"],"default":"new","description":"How posts are ranked."},"time":{"type":"string","enum":["hour","day","week","month","year","all"],"default":"day","description":"Time window — applies ONLY when sort = top or controversial."},"limit":{"type":"integer","minimum":1,"maximum":500,"default":100,"description":"How many posts to return after merging (1–500)."},"since_utc":{"type":"integer","description":"Polling mode: return ONLY posts created after this unix time. Pass the previous response's newest_utc to get just the new ones."},"max_pages":{"type":"integer","minimum":1,"maximum":5,"default":1,"description":"Fetch this many pages per group (1–5) — raise it when a poll interval is long enough that 100 posts may not cover it."},"cursor":{"type":"string","description":"Next page: pass the previous response's meta.pagination.next_cursor (the 'Next' button does this automatically)."}},"required":["subreddits"]},"example":{"subreddits":"python,rust,golang","limit":25}}}},"responses":{"200":{"description":"Result envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"description":"Missing or invalid x-api-key"},"429":{"description":"Rate limited or quota exhausted"}},"x-reefapi-credits":5}},"/reddit/v1/post_comments":{"post":{"operationId":"reddit_post_comments","summary":"Threaded comments for a post","description":"Threaded comments for a post. Returns author/body/score per comment.","tags":["reddit"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"post_id":{"type":"string","example":"f08dxb","description":"Post ID or full Reddit URL."},"sort":{"type":"string","enum":["best","top","new","controversial","old","qa"],"default":"best","description":"Comment ordering."},"limit":{"type":"integer","minimum":1,"maximum":500,"default":50,"description":"How many comments (1–500). Up to ~500 per call; the rest of a big thread comes back as more_ids."},"depth":{"type":"integer","minimum":1,"maximum":50,"default":10,"description":"Comment-tree depth (1–50)."},"source":{"type":"string","enum":["auto","live","arctic","pullpush"],"default":"auto","description":"Which Reddit data source to use — 'auto' picks the best source automatically."}},"required":["post_id"]},"example":{"post_id":"f08dxb"}}}},"responses":{"200":{"description":"Result envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"description":"Missing or invalid x-api-key"},"429":{"description":"Rate limited or quota exhausted"}},"x-reefapi-credits":1}},"/reddit/v1/search":{"post":{"operationId":"reddit_search","summary":"Search posts, comments, or users by `q` and/or `subreddit`/`author`","description":"Search posts, comments, or users by `q` and/or `subreddit`/`author`. Returns results[]. Comment search reads Reddit's own live comment index. Cursor pagination + `flair` filter apply on the live source. An empty result is confirmed before it is returned (meta.empty_retries). The post-search cursor is an opaque offset token (e.g. `OTk=`), not a `t3_` fullname: pass meta.pagination.next_cursor back unchanged, and de-duplicate by `id` when paging a fast-moving `sort=new` query (new posts shift the offsets).","tags":["reddit"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"q":{"type":"string","example":"async","description":"Search text. Provide `q` and/or `subreddit`/`author`."},"subreddit":{"type":"string","example":"python","description":"Limit the search to one subreddit (optional)."},"author":{"type":"string","example":"spez","description":"Limit to one author's content (optional)."},"type":{"type":"string","enum":["post","comment","user"],"default":"post","description":"What to search for."},"sort":{"type":"string","enum":["relevance","hot","new","top","comments"],"default":"new","description":"Result ordering. Omitted = newest first (`new`), whether or not `q` is given; pass `relevance` for Reddit's relevance ranking. For type=comment, `relevance` uses Reddit's default comment ranking, and `hot` / `comments` are not applied (Reddit's comment search ranks those by relevance); ignored for type=user."},"time":{"type":"string","enum":["hour","day","week","month","year","all"],"default":"all","description":"Time window: only results from the past hour, day, week, month or year. Works with every sort. Omitted = all time. For type=comment Reddit's comment search has no window of its own, so it is applied to each comment's date (with sort=new the result is complete; with top/relevance it keeps the in-window part of Reddit's all-time ranking). Not applied to type=user."},"limit":{"type":"integer","minimum":1,"maximum":100,"default":10,"description":"How many results (1–100)."},"after_utc":{"type":"integer","description":"Only results created AFTER this unix time (optional). For a rolling window prefer `time`; this bound is applied on top of it, so a page can hold fewer than `limit` results."},"before_utc":{"type":"integer","description":"Only results created BEFORE this unix time (optional; same note as after_utc)."},"include_nsfw":{"type":"boolean","default":false,"description":"Include over-18 results. Off by default, as on Reddit: without it Reddit leaves every NSFW result out."},"flair":{"type":"string","example":"Discussion","description":"Filter to one post flair, e.g. 'Discussion' (case-insensitive, live source only). Matches flairs that CONTAIN the text ('Hiring' also keeps 'Hiring - Open'); set flair_exact=true for the whole flair only."},"source":{"type":"string","enum":["auto","live","arctic","pullpush"],"default":"auto","description":"Which Reddit data source to use — 'auto' picks the best source automatically."},"page":{"type":"integer","minimum":1,"maximum":20,"default":1,"description":"Deep paging: page 2 returns the NEXT batch after page 1 (server chains cursors for you, 1–20). Live source only — archive sources page via after_utc/before_utc."},"cursor":{"type":"string","description":"Next page: pass the previous response's meta.pagination.next_cursor (the 'Next' button does this automatically)."}}},"example":{"subreddit":"python","limit":10}}}},"responses":{"200":{"description":"Result envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"description":"Missing or invalid x-api-key"},"429":{"description":"Rate limited or quota exhausted"}},"x-reefapi-credits":1}},"/reddit/v1/user":{"post":{"operationId":"reddit_user","summary":"User profile or content","description":"User profile or content. kind=about returns karma and the profile (display name, bio, banner, NSFW flag); submitted/comments list items (with deep paging), and each comment carries the title and link of the post it was left on. Reddit keeps about the last 1,000 items of a user's listing and leaves removed ones out, so a listing can end before that. When an account has hidden its posts or comments from its profile, the list is empty and meta.profile_content_hidden=true with meta.profile_total (Reddit's own count); Reddit's own search hides them too, but search with type=comment, author=<name> and source=auto answers them from the Reddit archive (meta.source_used=arctic).","tags":["reddit"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string","example":"spez","description":"Reddit username (without 'u/')."},"kind":{"type":"string","enum":["about","submitted","comments"],"default":"about","description":"What to return."},"limit":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"How many items (for submitted/comments, 1–100)."},"sort":{"type":"string","enum":["new","top","hot","controversial"],"default":"new","description":"Ordering (for submitted/comments)."},"time":{"type":"string","enum":["hour","day","week","month","year","all"],"default":"all","description":"Time window — applies ONLY when sort = top or controversial."},"source":{"type":"string","enum":["auto","live","arctic","pullpush"],"default":"auto","description":"Which Reddit data source to use — 'auto' picks the best source automatically."},"page":{"type":"integer","minimum":1,"maximum":20,"default":1,"description":"Deep paging: page 2 returns the NEXT batch after page 1 (server chains cursors for you, 1–20). Live source only — archive sources page via after_utc/before_utc."},"cursor":{"type":"string","description":"Next page: pass the previous response's meta.pagination.next_cursor (the 'Next' button does this automatically)."}},"required":["username"]},"example":{"username":"spez","kind":"about"}}}},"responses":{"200":{"description":"Result envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"description":"Missing or invalid x-api-key"},"429":{"description":"Rate limited or quota exhausted"}},"x-reefapi-credits":1}},"/reddit/v1/subreddit_about":{"post":{"operationId":"reddit_subreddit_about","summary":"Subreddit metadata: subscribers, description, created date, banner, status, etc","description":"Subreddit metadata: subscribers, description, created date, banner, status, etc. A private, quarantined or banned subreddit is refused by Reddit: the answer is NOT_FOUND with error.detail.status = private | quarantined | banned (a name that never existed has no status).","tags":["reddit"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"subreddit":{"type":"string","example":"python","description":"Subreddit name (without 'r/')."},"source":{"type":"string","enum":["auto","live","arctic","pullpush"],"default":"auto","description":"Which Reddit data source to use — 'auto' picks the best source automatically."}},"required":["subreddit"]},"example":{"subreddit":"python"}}}},"responses":{"200":{"description":"Result envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"description":"Missing or invalid x-api-key"},"429":{"description":"Rate limited or quota exhausted"}},"x-reefapi-credits":1}},"/reddit/v1/communities":{"post":{"operationId":"reddit_communities","summary":"Search subreddits by name/keyword — find communities matching a term, with each one's subscribers, title, description and over-18 flag.","description":"Search subreddits by name/keyword — find communities matching a term, with each one's subscribers, title, description and over-18 flag.","tags":["reddit"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"q":{"type":"string","example":"python","description":"Name or keyword to search subreddits for."},"limit":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Max communities to return (1–100)."},"include_nsfw":{"type":"boolean","default":false,"description":"Include over-18 results. Off by default, as on Reddit: without it Reddit leaves every NSFW result out."}},"required":["q"]},"example":{"q":"\"python\""}}}},"responses":{"200":{"description":"Result envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"description":"Missing or invalid x-api-key"},"429":{"description":"Rate limited or quota exhausted"}},"x-reefapi-credits":1}},"/reddit/v1/trending":{"post":{"operationId":"reddit_trending","summary":"Site-wide discovery — hot/popular posts from r/popular or r/all (what's trending across Reddit right now), or the most-popular communities","description":"Site-wide discovery — hot/popular posts from r/popular or r/all (what's trending across Reddit right now), or the most-popular communities. No subreddit needed.","tags":["reddit"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"scope":{"type":"string","enum":["popular","all"],"default":"popular","description":"Which site-wide feed."},"kind":{"type":"string","enum":["posts","communities"],"default":"posts","description":"Return trending posts or the most-popular communities."},"sort":{"type":"string","enum":["hot","new","top","rising","controversial"],"default":"hot","description":"How posts are ranked."},"time":{"type":"string","enum":["hour","day","week","month","year","all"],"default":"day","description":"Time window — applies ONLY when sort = top or controversial."},"limit":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"How many to return (1–100)."},"geo":{"type":"string","example":"US","description":"r/popular for one country, as on reddit.com: a 2-letter code (US, GB, DE, CA, IN…) or GLOBAL for Reddit's 'Everywhere' feed. Reddit's r/popular is per country; omit it and the feed follows the country of the connection. scope=popular only."},"flair":{"type":"string","example":"Discussion","description":"Filter to one post flair, e.g. 'Discussion' (case-insensitive, live source only). Matches flairs that CONTAIN the text ('Hiring' also keeps 'Hiring - Open'); set flair_exact=true for the whole flair only."},"flair_exact":{"type":"boolean","default":false,"description":"With `flair`: keep only posts whose flair is exactly that text (case-insensitive), not flairs that merely contain it."},"page":{"type":"integer","minimum":1,"maximum":20,"default":1,"description":"Deep paging: page 2 returns the NEXT batch after page 1 (server chains cursors for you, 1–20). Live source only — archive sources page via after_utc/before_utc."},"cursor":{"type":"string","description":"Next page: pass the previous response's meta.pagination.next_cursor (the 'Next' button does this automatically)."},"source":{"type":"string","enum":["auto","live","arctic","pullpush"],"default":"auto","description":"Which Reddit data source to use — 'auto' picks the best source automatically."}}},"example":{"scope":"popular","limit":10}}}},"responses":{"200":{"description":"Result envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"description":"Missing or invalid x-api-key"},"429":{"description":"Rate limited or quota exhausted"}},"x-reefapi-credits":2}},"/reddit/v1/user_search":{"post":{"operationId":"reddit_user_search","summary":"Find Reddit users by name/keyword — people search","description":"Find Reddit users by name/keyword — people search. Returns matching profiles with karma (post / comment split), created date, display name, bio, banner and NSFW flag; is_employee and the gold / mod / verified flags are not published in search rows (null). Reddit's people search is fuzzy: it returns the closest names it has. (Same as search with type=user.)","tags":["reddit"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"q":{"type":"string","example":"python","description":"Name or keyword to search users for."},"limit":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"How many users to return (1–100)."},"cursor":{"type":"string","description":"Next page: pass the previous response's meta.pagination.next_cursor (the 'Next' button does this automatically)."},"source":{"type":"string","enum":["auto","live","arctic","pullpush"],"default":"auto","description":"Which Reddit data source to use — 'auto' picks the best source automatically."}},"required":["q"]},"example":{"q":"python","limit":10}}}},"responses":{"200":{"description":"Result envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"description":"Missing or invalid x-api-key"},"429":{"description":"Rate limited or quota exhausted"}},"x-reefapi-credits":2}},"/reddit/v1/load_more_comments":{"post":{"operationId":"reddit_load_more_comments","summary":"Expand the collapsed 'more comments' nodes from a post_comments call — pass that response's more_ids to reveal the rest of the thread (build the FULL comment tree).","description":"Expand the collapsed 'more comments' nodes from a post_comments call — pass that response's more_ids to reveal the rest of the thread (build the FULL comment tree).","tags":["reddit"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"post_id":{"type":"string","example":"f08dxb","description":"The post these comments belong to (ID or Reddit URL)."},"more_ids":{"type":"string","example":"fh0xhez,fgsriwh,fj9b0aj,fgyfmaj,fgss3kw","description":"Comma-separated more_ids from a post_comments response (its top-level more_ids, or a comment's comments[].more_ids). Each call expands the first few and returns the rest, plus any newly collapsed branches, in more_ids. Plain comment IDs also work: each returns that comment with its replies."},"limit":{"type":"integer","minimum":1,"maximum":100,"default":100,"description":"Max more_ids to accept per call (1–100)."},"sort":{"type":"string","enum":["best","top","new","controversial","old","qa"],"default":"best","description":"Comment ordering."},"source":{"type":"string","enum":["auto","live","arctic","pullpush"],"default":"auto","description":"Which Reddit data source to use — 'auto' picks the best source automatically."}},"required":["post_id","more_ids"]},"example":{"post_id":"f08dxb","more_ids":"fh0xhez,fgsriwh,fj9b0aj,fgyfmaj,fgss3kw"}}}},"responses":{"200":{"description":"Result envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"description":"Missing or invalid x-api-key"},"429":{"description":"Rate limited or quota exhausted"}},"x-reefapi-credits":3}},"/reddit/v1/subreddit_extras":{"post":{"operationId":"reddit_subreddit_extras","summary":"Public subreddit extras: the community's rules and its wiki page index/content","description":"Public subreddit extras: the community's rules and its wiki page index/content. (Moderator list is mod-only on Reddit and is not available logged-out.)","tags":["reddit"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"subreddit":{"type":"string","example":"python","description":"Subreddit name (without 'r/')."},"include":{"type":"string","default":"rules,wiki","example":"rules,wiki","description":"Which extras to return: 'rules', 'wiki', or both (comma-separated)."},"wiki_page":{"type":"string","example":"index","description":"Fetch ONE wiki page's full content (e.g. 'index', 'faq'). Omit to list available page names."},"source":{"type":"string","enum":["auto","live","arctic","pullpush"],"default":"auto","description":"Which Reddit data source to use — 'auto' picks the best source automatically."}},"required":["subreddit"]},"example":{"subreddit":"python"}}}},"responses":{"200":{"description":"Result envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"description":"Missing or invalid x-api-key"},"429":{"description":"Rate limited or quota exhausted"}},"x-reefapi-credits":3}}},"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key"}},"schemas":{"Envelope":{"type":"object","required":["ok"],"properties":{"ok":{"type":"boolean"},"data":{"description":"Action result (shape varies per action)"},"meta":{"type":"object","description":"api, endpoint, mode, latency_ms, record_count, completeness_pct"},"error":{"type":"object","nullable":true,"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"}}}}}}}}