# Reddit Subreddit rules API (reddit.subreddit_rules)

- Canonical page: [https://everyinfra.com/en/reddit-api/subreddit_rules](https://everyinfra.com/en/reddit-api/subreddit_rules?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "reddit", "action": "subreddit_rules", "params": {...}}
- Price: $0.000792 per call ($0.79 per 1,000 requests); failed calls and empty results are not charged
- Returns: single object
- Mode: sync; add "mode": "async" for slow tasks

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=reddit&action=subreddit_rules

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| subreddit | not declared | yes | not declared | The community whose rules you want: a name (`python` or `r/python`) or a community link. One community per call. |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| community | platform-native meaning |
| community_id | Reddit's ID for the community, starting with t5_ (`subreddit_info`, `subreddit_rules`, `search_suggest`, `user_subreddits`, `explore`, `topic_subreddits`). |
| url | Link to the record on the platform. |
| rules | The community's rules (`subreddit_rules`): an array in which each item has `name` and `description`. |
| menu_links | The links in the community's top menu (`subreddit_rules`): an array in which each item has `text` and `url`. |
| apps | Names of the Reddit apps the community has installed (`subreddit_rules`): an array. |
| icon_url | Image URL of the icon: the community icon (`subreddit_info`, `subreddit_rules`, `search_suggest`, `user_subreddits`, `explore`, `topic_subreddits`) or the achievement icon (`user_trophies`). |
| banner_url | Image URL of the banner on the community page (`subreddit_info`, `subreddit_rules`) or on the user's profile (`profile`). |
| platform | Source platform identifier, the same as platform in the request (for example xiaohongshu, tiktok). |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "reddit",
  "action": "subreddit_rules",
  "params": {
    "subreddit": "python"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "reddit",
        "action": "subreddit_rules",
        "params": {
            "subreddit": "python",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

No real sample for these example parameters yet: structure only, every value is a placeholder (…).

```text
{
  "id": "req_…",
  "platform": "reddit",
  "action": "subreddit_rules",
  "results": {
    "community": …,
    "community_id": …,
    "url": …,
    "rules": …,
    "menu_links": …,
    "apps": …,
    "icon_url": …,
    "banner_url": …,
    "platform": …
  },
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=reddit
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
