GET /subreddit/wiki

Subreddit Wiki

A subreddit wiki page (HTML, markdown, latest revision). Reddit Scraper API endpoint /subreddit/wiki: parameters, JSON response fields and code examples.

One page of a community’s wiki (wiki_page, default index): rendered HTML, markdown source when Reddit serves it, title and latest revision; page_status tells readable, restricted, missing and disabled pages apart. List the pages with /subreddit/wiki-pages. Billed 1 request per call.

HTTP Request

GET /subreddit/wiki

Cost (in requests): 1. Every successful answer reports its cost in data.billed_requests.

Parameters

ParameterTypeRequiredDefaultDescription
subredditstringYes-Subreddit name (case-insensitive, with or without r/) or its t5_ id.
wiki_pagestringNoindexWiki page path (default index; e.g. config/sidebar, faq).

Response

Real response to GET /subreddit/wiki?subreddit=python (arrays trimmed to 2 items, long texts cut with …).

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
{
  "status": true,
  "request_id": "9fe6d2be-3e21-dafd-956e-0089f0b9",
  "data": {
    "subreddit": "Python",
    "wiki_page": "index",
    "page_status": "valid",
    "revision": {
      "revision_id": "WikiRevision_0eb54803-14af-11eb-8903-0e3e3e317287",
      "author": "IAmKindOfCreative",
      "revised_at": "2020-10-22T21:39:26.000000+00:00",
      "reason": "Added link to flair description and flair filtering tutorial"
    },
    "content_html": "<!-- SC_OFF --><div class=\"md wiki\"><div class=\"toc\"><ul><li class=\"wiki_welcome_to_r.2Fpython\"><a href=\"#wiki_welcome_to_r.2Fpython\">Welcome to r/Python</a></li><li class=\"toc_child\"><ul><li class=\"wiki_questions_about_the_flair.3F\"><a hre…",
    "content_markdown": "# Welcome to r/Python  \r\nSubreddit dedicated to news about the dynamic, interpreted, interactive, \r\nobject-oriented, extensible programming language [Python](https://www.python.org/).  \r\nIf you are about to ask a question, please consider […",
    "billed_requests": 1
  },
  "request_params": {
    "subreddit": "python"
  }
}

Response Fields

FieldTypeDescription
statusbooleantrue when the request succeeded
request_idstringUnique request identifier
dataobjectWiki page; page_status tells restricted pages apart from missing ones; null with error.code = not_found (subreddit).
data.subredditstringSubreddit name.
data.wiki_pagestringWiki page path.
data.page_statusstringvalid, restricted (page readable by members or moderators only), page_not_found, wiki_disabled.
data.revisionobjectLatest revision.
data.revision.revision_idstringRevision id. For reference; not an input of this API.
data.revision.authorstringEditor username.
data.revision.revised_atstringISO-8601 UTC revision time.
data.revision.reasonstringEdit reason given by the editor.
data.content_htmlstringPage rendered as HTML.
data.content_markdownstringPage as Markdown: Reddit’s source when it serves it, else converted from content_html; null when there is no content.
data.billed_requestsintegerRequests billed for this call (also sent as Requests in the X-RapidAPI-Billing header when it is not RapidAPI’s default of 1).
request_paramsobjectEcho of the parameters you sent

Error Responses

Invalid input returns HTTP 400, not billed. error is a plain string that names the parameter:

1
{ "status": false, "request_id": "99a1e6cd-2e57-9e8f-4e44-2dea7f6d", "error": "Invalid parameter 'post_id': must be a post id such as z1c9z or t3_z1c9z", "request_params": { "post_id": "!!" } }
Status CodeCauseDescription
400Invalid or missing parameterPlain-English message per field. Not billed
200 with status: falseItem not availableerror.code is not_found, banned, private, quarantined. data is null. Billed 1 request
503Reddit temporarily unreachable"error": "Service temporarily unavailable". Not billed, retry later

Code Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
import requests

url = "https://reddit-scraper-api-extractor-ai-the-most-complete.p.rapidapi.com/subreddit/wiki"

params = {
    "subreddit": "python",
}

headers = {
    "X-RapidAPI-Key": "YOUR_API_KEY",
    "X-RapidAPI-Host": "reddit-scraper-api-extractor-ai-the-most-complete.p.rapidapi.com"
}

response = requests.get(url, headers=headers, params=params)
data = response.json()["data"]

print(data["subreddit"])
print(data["wiki_page"])
print("Billed requests:", data["billed_requests"])
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
const url = "https://reddit-scraper-api-extractor-ai-the-most-complete.p.rapidapi.com/subreddit/wiki";

const params = new URLSearchParams({
  subreddit: "python",
});

const response = await fetch(`${url}?${params}`, {
  headers: {
    "X-RapidAPI-Key": "YOUR_API_KEY",
    "X-RapidAPI-Host": "reddit-scraper-api-extractor-ai-the-most-complete.p.rapidapi.com"
  }
});

const { data } = await response.json();
console.log(data.subreddit, data.wiki_page);
1
2
3
4
curl -G "https://reddit-scraper-api-extractor-ai-the-most-complete.p.rapidapi.com/subreddit/wiki" \
  --data-urlencode "subreddit=python" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: reddit-scraper-api-extractor-ai-the-most-complete.p.rapidapi.com"
Start building today

Get your API key and make your first request in under a minute.

Get Your API Key on RapidAPI