Reddit batch subreddit lookup API
Up to 25 communities by name in one call, each as the t5 Thing the single lookup returns; names Reddit does not return are listed in missing.
POST /v1/reddit/subreddits/batch5 credits per callRefunded on failureimport os, requests
res = requests.post(
"https://api.groundsocial.dev/v1/reddit/subreddits/batch",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
json={"names":["python","typescript","rust"]},
)
res.raise_for_status()
data = res.json()Response
200 · 5 credits{ "subreddits": [ { "kind": "t5", "data": { "id": null, "name": null, "display_name": "typescript", "display_name_prefixed": "r/typescript", "title": "typescript", "public_description": "About r/typescript", "description": null, "subscribers": 180000, "active_user_count": null, "created_utc": null, "over18": false, "subreddit_type": "public", "url": "/r/typescript/", "icon_img": null, "banner_img": null } } ], "requested": 3, "returned": 1, "missing": [ "python", "rust" ]}Response fields
200 with a SubredditBatch, in Reddit’s own Things and Listings.
| Field | Type | Description |
|---|---|---|
subreddits | Subreddit[] | |
requested | number | |
returned | number | |
missing | string[] |
Status codes
| Status | Meaning |
|---|---|
200 | The subreddits found and the names that were not. |
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
Reddit is a trademark of Reddit, Inc. We are not affiliated with or endorsed by Reddit.