RedditapisRedditapis
Listings & Search

Get a Subreddit's Posting Rules

Fetch a subreddit's posting rules by name: each rule's name, description, what it applies to, violation reason and priority, plus Reddit's site rules.

GET/api/reddit/sub/:name/rules$0.0015 / call

A subreddit's posting rules (Reddit's /r/<name>/about/rules data): each rule's name, description, what it applies to, violation reason, priority, and creation date, plus Reddit's site-wide rules. Returns a rules list and a site_rules string list.

When to use this

Reach for this to check a community's rules before posting or commenting, what a subreddit forbids, whether a rule applies to posts, comments, or both, and the reason a moderator will cite for a removal. One read.

Path Parameters

ParameterTypeRequiredDescription
namestringYesSubreddit name (no r/ prefix)

A subreddit that does not exist returns 404.

When Reddit refuses the rules read

Reddit's rules data can be refused. The rules are then read from the rules section of the subreddit's sidebar text, and the response carries X-Read-Source: sidebar_text. That text is what the moderators wrote, so each rule has a name and, when the text gives one, a description. violation_reason, priority, created_utc and created are null, site_rules is empty because the sidebar does not list them (Reddit's site-wide rules still apply), and applies_to is posts or comments only when the section's heading says so, otherwise null.

A subreddit whose sidebar has no rules section, for example one that only links to its rules, answers the unbilled 503 instead of an empty list. An empty rules list always comes from Reddit's rules data.

Example

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

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

Response Shape

{
  "rules": [
    {
      "name": "Rule 1: Questions must be clear",
      "description": "Posts must be phrased as a genuine, answerable question.",
      "applies_to": "posts",
      "violation_reason": "Unclear or rhetorical question",
      "priority": 0,
      "created_utc": 1201261935,
      "created": "2008-01-25T12:32:15.000Z"
    }
  ],
  "site_rules": [
    "Spam",
    "Personal and confidential information",
    "Threatening, harassing, or inciting violence"
  ]
}

Response Fields

FieldTypeNotes
namestringThe rule's short name / title
descriptionstring | nullThe rule's full description (may be empty / null)
applies_tostring | nullposts | comments | all; null only on a rules read from the sidebar text whose heading does not say
violation_reasonstring | nullThe reason shown when the rule is enforced (may be null)
prioritynumber | nullDisplay order Reddit assigns the rule (may be null)
created_utcnumber | nullUnix epoch seconds the rule was created (may be null)
createdstring | nullISO-8601 form of created_utc (may be null)
site_rulesstring[]Reddit's site-wide rules (a list of strings)

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

On this page