RedditapisRedditapis
Listings & Search

Get a Subreddit's Wiki Page (Markdown, HTML)

Fetch a subreddit's wiki page by name and page, the page's markdown and HTML content, a may-revise flag, and the last revision. Returns a single object.

GET/api/reddit/sub/:name/wiki/:page$0.002 / call

A subreddit's wiki page (Reddit's /r/<name>/wiki/<page> data): the page's markdown and HTML content, a may-revise flag, and the last revision's metadata. Returns a single object, not a list. The page may be multi-segment, for example index, rules, or config/sidebar.

When to use this

Use it to read a community's wiki programmatically: its rules page, its FAQ, or a config page like config/sidebar. You get both the raw markdown (content_md) and the rendered HTML (content_html), plus who last revised the page and when. One read.

Path Parameters

ParameterTypeRequiredDescription
namestringYesSubreddit name (no r/ prefix)
pagestringYesWiki page name (e.g. index, rules). May be multi-segment like config/sidebar

A subreddit or wiki page that does not exist returns 404.

Example

curl -H "Authorization: Bearer $TOKEN" \
  "https://api.redditapis.com/api/reddit/sub/python/wiki/index"
const response = await fetch(
  "https://api.redditapis.com/api/reddit/sub/python/wiki/index",
  { headers: { Authorization: "Bearer TOKEN" } }
);
const data = await response.json();
import requests

response = requests.get(
    "https://api.redditapis.com/api/reddit/sub/python/wiki/index",
    headers={"Authorization": "Bearer TOKEN"},
)

Response Shape

{
  "page": "index",
  "content_md": "# Welcome to r/python\n\nRead the rules before posting.",
  "content_html": "<div class=\"md\"><h1>Welcome to r/python</h1></div>",
  "may_revise": true,
  "revision_id": "a1b2c3d4-0000-1111-2222-333344445555",
  "revision_date_utc": 1682000000,
  "revision_date": "2023-04-20T14:13:20.000Z",
  "revised_by": "some_moderator",
  "reason": "Updated the posting rules"
}

Response Fields

FieldTypeNotes
pagestringThe wiki page that was requested (echoed back)
content_mdstring | nullThe page's raw markdown (may be null on an empty page)
content_htmlstring | nullThe page's rendered HTML (may be null on an empty page)
may_reviseboolean | nullWhether the calling account may revise the page (may be null)
revision_idstring | nullId of the last revision (may be null)
revision_date_utcnumber | nullUnix epoch seconds of the last revision (may be null)
revision_datestring | nullISO-8601 form of revision_date_utc (may be null)
revised_bystring | nullUsername of the last reviser (may be null)
reasonstring | nullThe revision reason, if the reviser gave one (may be null)

Independent third-party API for developers and researchers. Not affiliated with, endorsed by, or sponsored by Reddit, Inc.

On this page