Reddit subreddit API
A community’s description, member count, type (public, restricted, private) and flags, as the t5 Thing Reddit itself returns.
GET /v1/reddit/subreddits/{name}1 credit per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/reddit/subreddits/selfhosted",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()Response
200 · 1 creditNo bundled sample for this call. The response is a Subreddit; its fields are listed below.
Parameters
| Name | Type | Description |
|---|---|---|
namepath · required | string | Subreddit name, with or without "r/". "all" and "popular" also work for posts. Example: typescript. |
Response
200 with a Subreddit, in Reddit’s own shape.
| Field | Type | Description |
|---|---|---|
kind | "t5" | |
data | object |
Status codes
| Status | Meaning |
|---|---|
200 | The subreddit. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | The subreddit, post or user does not exist. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | Reddit is temporarily unavailable. Retryable; nothing was charged. |
Every error has code, message, hint and retryable. All error codes
Questions
About this endpoint. Reddit is a trademark of Reddit, Inc. We are not affiliated with or endorsed by Reddit.
Does it work for private communities?
No. A private or banned community answers 403 target_private and the call is refunded.