YepAPI
Reddit API

Subreddit Rules API

Get a subreddit's rules — title, full description, report reason, and whether each applies to posts or comments. JSON, $0.01 per call.

POST/v1/reddit/subreddit-rules
$0.01/call

Returns the posting rules of a subreddit in display order. Handy before automating posts, or to give an LLM the community guidelines when drafting replies.

Usage

const res = await fetch('https://api.yepapi.com/v1/reddit/subreddit-rules', {
  method: 'POST',
  headers: {
    'x-api-key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"subreddit": "AskReddit"}),
});
const { data } = await res.json();
console.log(data);
curl -X POST https://api.yepapi.com/v1/reddit/subreddit-rules \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"subreddit": "AskReddit"}'
import requests

res = requests.post(
    "https://api.yepapi.com/v1/reddit/subreddit-rules",
    headers={"x-api-key": "YOUR_API_KEY"},
    json={"subreddit": "AskReddit"},
)
print(res.json()["data"])

Request Body

ParameterTypeRequiredDescriptionDefault
subredditstringYesSubreddit name — python, r/python, or a reddit.com/r/python URL (2–21 characters)—

Response

{
  "ok": true,
  "data": {
    "rules": [
      {
        "applies_to": "link",
        "description": "* All questions must be clear, written in English, and conclude with a question mark\n* All context in the title must be ***necessary to understanding the question***; do not give “example answers” in …",
        "priority": 0,
        "title": "Rule 1 - Questions must be clear and direct and may not use the body textbox",
        "violation_reason": "Rule 1 - Questions must be clear and direct and may not use the body textbox"
      },
      {
        "applies_to": "link",
        "description": "* Askreddit is NOT your personal or professional advice platform\n\n* Do not makes posts asking for professional advice - medical, legal, financial, or otherwise\n\n* All posts asking for advice must be g…",
        "priority": 1,
        "title": "Rule 2 - No personal or professional advice requests",
        "violation_reason": "Rule 2 - No personal or professional advice requests"
      }
    ]
  }
}

Response Fields

FieldTypeDescription
okbooleanWhether the request succeeded
data.rulesobject[]Rules in display order
data.rules[].prioritynumberPosition, starting at 0
data.rules[].titlestringShort rule name
data.rules[].descriptionstringFull rule text in Markdown
data.rules[].violation_reasonstringReason shown when reporting a violation
data.rules[].applies_tostringlink (posts), comment, or all

Caching

Responses are cached for 24 hours.

Errors

StatusCodeWhen
400VALIDATION_ERRORsubreddit is missing or not a valid subreddit name
404NOT_FOUNDSubreddit not found, banned, or private
429RATE_LIMITED_UPSTREAMToo many requests in a short burst — retry after a few seconds
502UPSTREAM_ERRORTemporary problem fetching data from Reddit — retry

Failed calls are not charged.

On this page