Reddit subreddit wiki API
One page of a community wiki: rendered HTML, markdown (the source as written with source=true), and who revised it last and when.
GET /v1/reddit/subreddits/{name}/wiki1 credit per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/reddit/subreddits/Python/wiki?page=index&source=true",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()Response
200 · 1 credit{ "kind": "wikipage", "data": { "page": "index", "content_md": "# Welcome to r/Python \nSubreddit dedicated to news about the dynamic, interpreted, interactive, \nobject-oriented, exten…", "content_html": "<div class=\"md\"><div class=\"md wiki\"><h1 id=\"wiki_welcome_to_r.2Fpython\">Welcome to <a href=\"/r/Python\" rel=\"nofollow\">r…", "may_revise": false, "revision_date": 1603402766, "revision_by": { "kind": "t2", "data": { "name": "IAmKindOfCreative" } }, "revision_id": null, "reason": null }}Parameters
| Name | Type | Description |
|---|---|---|
namepath · required | string | Subreddit name, with or without "r/". "all" and "popular" also work for posts. Example: typescript. |
pagequery | string | Wiki page name. Default index. Example: index. |
sourcequery | "true" | "false" | true: the markdown source as written. Default false. One of true, false. |
Response fields
200 with a WikiPage, in Reddit’s own Things and Listings.
| Field | Type | Description |
|---|---|---|
kind | "wikipage" | |
data | object |
Status codes
| Status | Meaning |
|---|---|
200 | The wiki page. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | The subreddit, post or user does not exist. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | Reddit is temporarily unavailable. Retryable; nothing was charged. |
Every error has code, message, hint and retryable. All error codes
Reddit is a trademark of Reddit, Inc. We are not affiliated with or endorsed by Reddit.