Loading…
100 free credits. No credit card required. Get a key
One post and its comment tree in one call. Collapsed branches come back as more items with their comment ids, exactly as Reddit returns them.
GET /v1/reddit/posts/{id}1 credit per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/reddit/posts/1y3k9qa?sort=top&limit=200",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json(){ "post": { "kind": "t3", "data": { "id": "1y3k9qa", "name": "t3_1y3k9qa", "title": "I replaced six SaaS subscriptions with one $6 VPS. Here is the stack after a year.", "author": "quiet_ops", "author_fullname": null, "subreddit": "selfhosted", "subreddit_name_prefixed": "r/selfhosted", "subreddit_id": null, "permalink": "/r/selfhosted/comments/1y3k9qa/i_replaced_six_saas_subscriptions_with_one_6_vps/", "url": "https://www.reddit.com/r/selfhosted/comments/1y3k9qa/i_replaced_six_saas_subscriptions_with_one_6_vps/", "domain": "self.selfhosted", "created_utc": 1795447243, "score": 2841, "upvote_ratio": 0.97, "ups": null, "downs": null, "num_comments": 412, "selftext": "Notes, photos, passwords, RSS, uptime checks and a small wiki, all on one 2 vCPU box behind a reverse proxy. Backups are the part I got wrong twice, so most of this post is about those.", "selftext_html": null, "is_self": true, "over_18": false, "spoiler": false, "stickied": false, "locked": false, "archived": null, "link_flair_text": "Guide", "link_flair_template_id": null, "post_hint": null, "thumbnail": null, "edited": null, "removed_by_category": null, "gilded": null, "num_crossposts": null } }, "comments": { "kind": "Listing", "data": { "after": null, "before": null, "dist": null, "modhash": null, "geo_filter": "", "children": [ { "kind": "t1", "data": { "id": "m8x1a2b", "name": "t1_m8x1a2b", "author": "tarball_tess", "author_fullname": null, "body": "The restore drill is the real lesson here. A backup you have never restored is a hope, not a backup.", "body_html": null, "parent_id": "t3_1y3k9qa", "link_id": "t3_1y3k9qa", "subreddit": "selfhosted", "subreddit_id": null, "permalink": "/r/selfhosted/comments/1y3k9qa/i_replaced_six_saas_subscriptions_with_one_6_vps/m8x1a2b/", "created_utc": 1795448083, "score": 611, "depth": 0, "is_submitter": false, "stickied": false, "edited": null, "replies": { "kind": "Listing", "data": { "after": null, "before": null, "dist": null, "modhash": null, "geo_filter": "", "children": [ { "kind": "t1", "data": { "id": "m8x3c4d", "name": "t1_m8x3c4d", "author": "quiet_ops", "author_fullname": null, "body": "Learned that one at 2 a.m. Now there is a monthly calendar reminder that restores to a scratch VM.", "body_html": null, "parent_id": "t1_m8x1a2b", "link_id": "t3_1y3k9qa", "subreddit": "selfhosted", "subreddit_id": null, "permalink": "/r/selfhosted/comments/1y3k9qa/i_replaced_six_saas_subscriptions_with_one_6_vps/m8x3c4d/", "created_utc": 1795448563, "score": 288, "depth": 1, "is_submitter": true, "stickied": false, "edited": null, "replies": "" } } ] } } } }, { "kind": "t1", "data": { "id": "m8x5e6f", "name": "t1_m8x5e6f", "author": "nginx_and_tonic", "author_fullname": null, "body": "What are you using for uptime checks that is not itself on the same box?", "body_html": null, "parent_id": "t3_1y3k9qa", "link_id": "t3_1y3k9qa", "subreddit": "selfhosted", "subreddit_id": null, "permalink": "/r/selfhosted/comments/1y3k9qa/i_replaced_six_saas_subscriptions_with_one_6_vps/m8x5e6f/", "created_utc": 1795449223, "score": 174, "depth": 0, "is_submitter": false, "stickied": false, "edited": null, "replies": "" } }, { "kind": "t1", "data": { "id": "m8x7g8h", "name": "t1_m8x7g8h", "author": "homelab_hanna", "author_fullname": null, "body": "Saving this. The cost table at the end is the most useful part.", "body_html": null, "parent_id": "t3_1y3k9qa", "link_id": "t3_1y3k9qa", "subreddit": "selfhosted", "subreddit_id": null, "permalink": "/r/selfhosted/comments/1y3k9qa/i_replaced_six_saas_subscriptions_with_one_6_vps/m8x7g8h/", "created_utc": 1795450003, "score": 92, "depth": 0, "is_submitter": false, "stickied": false, "edited": null, "replies": "" } } ] } }}| Name | Type | Description |
|---|---|---|
idpath · required | string | A post id (1y1u285), fullname (t3_1y1u285) or post URL. Example: 1y1u285. |
sortquery | "confidence" | "top" | "new" | "controversial" | "old" | "qa" | Comment order. Default confidence ("best"). One of confidence, top, new, controversial, old, qa. |
limitquery | integer | Top-level comments, 1 to 500. |
200 with a PostWithComments, in Reddit’s own shape.
| Field | Type | Description |
|---|---|---|
post | Link | |
comments | CommentTree |
| Status | Meaning |
|---|---|
200 | The post and its comment tree. |
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
About this endpoint. Reddit is a trademark of Reddit, Inc. We are not affiliated with or endorsed by Reddit.
Yes. The id can be 1y3k9qa, t3_1y3k9qa or the thread’s URL.
You get what Reddit shows publicly: [deleted] authors and [removed] bodies stay that way. We never restore removed content.