Subreddit Posts
GET/v1/reddit/subreddit1 credit
Returns a page of posts from a subreddit in the chosen sort order, each with its title, author, text, score, comment count, flair and links.
01Query parameters
| Name | Type | Description |
|---|---|---|
| subredditrequired | string | The subreddit's name, e.g. `golang`, or its URL. |
| sortoptional | string | Sort order. Reddit's default when omitted.Accepted values:besthotnewtoprising |
| timeframeoptional | string | Time window, used with `sort=top`.Accepted values:alldayweekmonthyear |
| afteroptional | string | The `after` of the previous answer (a post id like `t3_1x0m2e6`), to fetch the next page. |
| trimoptional | boolean | `true` drops some fields from each post (`created_at_iso`, `permalink`, `post_hint`, `domain`, `subreddit_id`, `over_18`, `spoiler`).Default: false |
| cache_max_ageoptional | string | Accepted for compatibility; every call is fetched fresh and costs the normal price. Any other value is a free 400.Accepted values:1d3d7d14d30d |
02Request
curl "https://api.scrapesocial.ai/v1/reddit/subreddit?subreddit=golang&sort=new" \ -H "x-api-key: $SCRAPESOCIAL_KEY"
03Responses
Real answers from the API. Lists are shortened to 2 items.
GET /v1/reddit/subreddit?subreddit=golang&sort=new
{
"success": true,
"credits_remaining": 4980,
"credits_charged": 1,
"posts": [
{
"id": "1xf72kd",
"author": "der_gopher",
"author_fullname": "t2_149tyuiyao",
"subreddit": "golang",
"title": "Golang optimizations for high‑volume services",
"link_flair_text": "show & tell",
"selftext": null,
"selftext_html": null,
"downs": 0,
"name": "t3_1xf72kd",
"upvote_ratio": 0.7,
"ups": 4,
"total_awards_received": 0,
"score": 4,
"created": 1792946317,
"created_utc": 1792946317,
"created_at_iso": "2026-10-25T16:38:37.000Z",
"num_comments": 0,
"url": "https://packagemain.tech/p/golang-optimizations-for-highvolume",
"permalink": "/r/golang/comments/1xf72kd/golang_optimizations_for_highvolume_services/",
"subreddit_subscribers": null,
"is_video": false,
"over_18": false,
"spoiler": false,
"domain": "packagemain.tech",
"subreddit_id": "t5_2rc7j",
"post_hint": "link"
},
{
"id": "1xf4qiw",
"author": "HospitalImaginary483",
"author_fullname": "t2_jwvrvihjg",
"subreddit": "golang",
"title": "A comprehensive SMTP toolkit and library for Go",
"link_flair_text": null,
"selftext": null,
"selftext_html": null,
"downs": 0,
"name": "t3_1xf4qiw",
"upvote_ratio": 0.6,
"ups": 1,
"total_awards_received": 0,
"score": 1,
"created": 1792940793,
"created_utc": 1792940793,
"created_at_iso": "2026-10-25T15:06:33.000Z",
"num_comments": 0,
"url": "https://github.com/synqronlabs/raven",
"permalink": "/r/golang/comments/1xf4qiw/a_comprehensive_smtp_toolkit_and_library_for_go/",
"subreddit_subscribers": null,
"is_video": false,
"over_18": false,
"spoiler": false,
"domain": "github.com",
"subreddit_id": "t5_2rc7j",
"post_hint": "link"
}
],
"after": "t3_1x9sf97"
}Common to every endpoint
Any route can answer these: a missing or wrong key, no credits left, the platform not answering, or a failure on our side. None of them costs credits.
GET /v1/cosmos/profile?handle=design
{
"success": false,
"message": "Invalid API key"
}04Notes
About 24 posts per page in `posts`. Pass the answer's `after` back as `after` for the next page; it is null on the last page. An empty page returns `posts: []` for 0 credits. An unknown subreddit is a free 404; an unknown `sort` or `timeframe`, or an `after` that is not a post id, is a free 400.
05Errors & credits
Every error has success: false, a real HTTP status and costs no credits.
400missing_parameter
A required parameter is missing or invalid.
403private_account
The account is private or age-restricted.
404not_found
No such account.
503upstream_error
The platform did not answer; retry shortly.