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
$0.01/call/v1/reddit/subreddit-rulesReturns 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
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
subreddit | string | Yes | Subreddit 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
| Field | Type | Description |
|---|---|---|
ok | boolean | Whether the request succeeded |
data.rules | object[] | Rules in display order |
data.rules[].priority | number | Position, starting at 0 |
data.rules[].title | string | Short rule name |
data.rules[].description | string | Full rule text in Markdown |
data.rules[].violation_reason | string | Reason shown when reporting a violation |
data.rules[].applies_to | string | link (posts), comment, or all |
Caching
Responses are cached for 24 hours.
Errors
| Status | Code | When |
|---|---|---|
400 | VALIDATION_ERROR | subreddit is missing or not a valid subreddit name |
404 | NOT_FOUND | Subreddit not found, banned, or private |
429 | RATE_LIMITED_UPSTREAM | Too many requests in a short burst — retry after a few seconds |
502 | UPSTREAM_ERROR | Temporary problem fetching data from Reddit — retry |
Failed calls are not charged.
Related Endpoints
- Subreddit Info — description, sidebar, and posting settings
- Subreddit Posts API — the subreddit's posts