Subreddit posts API
Posts in a subreddit; `parent` is the subreddit.
GET /v1/reddit/subreddit/posts
GET /v1/reddit/subreddit/posts
Posts in a subreddit; parent is the subreddit. The cursor is Reddit's after token.
- Cost: 1 credit
- Cache: Results are kept up to 30 days; send
max_age_daysto reuse them for free. - Timeout: A request still running after about 25 seconds answers
202with a job to poll (Batch and jobs).
Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
subreddit | string | yes | Subreddit name without r/. Also accepted as sub. |
sort | string | no | Order of results. Changing it restarts the cursor chain. One of hot, new, top, rising, controversial, best. Default hot. Also accepted as sort_by, sortBy, order. |
timeframe | string | no | Window for top/controversial sorts. One of hour, day, week, month, year, all. Also accepted as t, time. |
Every request also accepts:
cursor: the cursor from the previous page (Pagination).trim:truefor a smaller response withoutnullfields andextra.raw:trueto also get the platform's original object asraw.max_age_days: accept a cached result up to this many days old, for 0 credits (Caching).
Example request#
Set your key in the environment first (see Authentication).
1curl -G "https://api.socialscrape.dev/v1/reddit/subreddit/posts" \2 -H "x-api-key: $SOCIALSCRAPE_API_KEY" \3 --data-urlencode "subreddit=python"1import os2import requests34params = {5 "subreddit": "python",6}7res = requests.get(8 "https://api.socialscrape.dev/v1/reddit/subreddit/posts",9 headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},10 params=params,11)12body = res.json()1314if body["ok"]:15 print(body["data"])16else:17 print(body["error"]["code"], body["error"]["message"])1const url = new URL("https://api.socialscrape.dev/v1/reddit/subreddit/posts");2url.search = new URLSearchParams({3 "subreddit": "python"4}).toString();5const res = await fetch(url, {6 headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },7});8const body = await res.json();910if (body.ok) {11 console.log(body.data);12} else {13 console.error(body.error.code, body.error.message);14}1{2 "nodes": [3 {4 "name": "SocialScrape Subreddit posts",5 "type": "n8n-nodes-base.httpRequest",6 "typeVersion": 4.2,7 "position": [8 0,9 010 ],11 "parameters": {12 "method": "GET",13 "url": "https://api.socialscrape.dev/v1/reddit/subreddit/posts",14 "sendQuery": true,15 "queryParameters": {16 "parameters": [17 {18 "name": "subreddit",19 "value": "python"20 }21 ]22 },23 "sendHeaders": true,24 "headerParameters": {25 "parameters": [26 {27 "name": "x-api-key",28 "value": "={{ $env.SOCIALSCRAPE_API_KEY }}"29 }30 ]31 }32 }33 }34 ],35 "connections": {}36}Example response#
This is a sample from a recorded response, lists and long text are shortened. Status 200.
1{2 "ok": true,3 "credits_charged": 1,4 "credits_remaining": 4999,5 "cached": false,6 "cached_at": null,7 "request_id": "req_9483b6b038aed124d7255bfd",8 "data": {9 "object": "list",10 "items": [11 {12 "object": "post",13 "platform": "reddit",14 "id": "1xo41r2",15 "url": "https://www.reddit.com/r/Python/comments/1xo41r2/thursday_daily_thread_python_careers_courses_and/",16 "type": "text",17 "author": {18 "id": "t2_6l4z3",19 "handle": "AutoModerator",20 "name": "AutoModerator",21 "url": "https://www.reddit.com/user/AutoModerator/",22 "avatar_url": "https://styles.redditmedia.com/t5_1yz875/styles/profileIcon_klqlly9fc4l41.png?width=64&height=64&frame=1&auto=webp&crop=64%3A64%2Csmart&s=4cd002de4de73dc33950158eb385a54026d627e1",23 "verified": null24 },25 "title": "Thursday Daily Thread: Python Careers, Courses, and Furthering Education!",26 "text": "Weekly Thread: Professional Use, Jobs, and Education 🏢\n\nWelcome to this week's discussion on Python in the professional world! This is your spot to talk about job hunting, career growth, and educational resources in Python. Please note, thi...",27 "published_at": "2026-11-05T00:00:08.754000Z",28 "duration_seconds": null,29 "language": "en",30 "hashtags": null,31 "mentions": null,32 "stats": {33 "views": null,34 "likes": 13,35 "comments": 2,36 "shares": null,37 "saves": null,38 "dislikes": null39 },40 "media": {41 "thumbnail_url": null,42 "video_url": null,43 "audio_url": null,44 "image_urls": null,45 "width": null,46 "height": null47 },48 "song": null,49 "location": null,50 "is_pinned": true,51 "is_sponsored": null,52 "extra": {53 "award_count": 0,54 "domain": "self.Python",55 "flair": "Daily Thread",56 "post_type": "text",57 "score": 13,58 "subreddit": "Python",59 "subreddit_id": "t5_2qh0y",60 "upvote_ratio": 0.933333333333333361 }62 },63 {64 "object": "post",65 "platform": "reddit",66 "id": "1xoh5m4",67 "url": "https://www.reddit.com/r/Python/comments/1xoh5m4/qsfilter_on_its_own_line_does_nothing_patterns/",68 "type": "text",69 "author": {70 "id": "t2_22q19z3qrr",71 "handle": "jeonghun917",72 "name": "jeonghun917",73 "url": "https://www.reddit.com/user/jeonghun917/",74 "avatar_url": "https://www.redditstatic.com/avatars/defaults/v2/avatar_default_7.png",75 "verified": null76 },77 "title": "qs.filter(...) on its own line does nothing. Patterns like this across 44 open-source repos: 62 app",78 "text": "Most bugs that survive into production in mature codebases are not syntax errors. They are clean, idiomatic lines that quietly drop their result or skip a check.\n\nqs = Order.objects.filter(shop=shop)\nif not user.is_staff:\nqs.filter(owner=us...",79 "published_at": "2026-11-05T12:15:18.639000Z",80 "duration_seconds": null,81 "language": "en",82 "hashtags": null,83 "mentions": null,84 "stats": {85 "views": null,86 "likes": 0,87 "comments": 1,88 "shares": null,89 "saves": null,90 "dislikes": null91 },92 "media": {93 "thumbnail_url": null,94 "video_url": null,95 "audio_url": null,96 "image_urls": null,97 "width": null,98 "height": null99 },100 "song": null,101 "location": null,102 "is_pinned": null,103 "is_sponsored": null,104 "extra": {105 "award_count": 0,106 "domain": "self.Python",107 "flair": "Discussion",108 "post_type": "text",109 "score": 0,110 "subreddit": "Python",111 "subreddit_id": "t5_2qh0y",112 "upvote_ratio": 0.5113 }114 }115 ],116 "cursor": "dDNfMXhobnZzMA==",117 "has_more": true,118 "parent": {119 "object": "community",120 "platform": "reddit",121 "id": "t5_2qh0y",122 "url": "https://www.reddit.com/r/Python/",123 "kind": "subreddit",124 "name": "Python",125 "title": null,126 "description": null,127 "avatar_url": null,128 "banner_url": null,129 "member_count": null,130 "online_count": null,131 "is_nsfw": null,132 "is_private": null,133 "verified": null,134 "created_at": null,135 "extra": null136 }137 },138 "cursor": "dDNfMXhobnZzMA==",139 "has_more": true140}Response#
A list of Post objects in data.items, with data.cursor and data.has_more.
See Data models for every field. The envelope around data is described in Responses.
Errors#
Failures are free: credits_charged is 0. Branch on error.code, never on the message.
| Code | HTTP | Retry | Meaning |
|---|---|---|---|
invalid_params | 400 | no | A parameter is missing, unknown or has the wrong type. |
not_found | 404 | no | The platform says this profile, post or item does not exist. |
Every request can also fail with the account and platform errors listed on the Errors page.
Example error:
1{2 "ok": false,3 "error": {4 "code": "not_found",5 "message": "The platform says this profile, post or item does not exist.",6 "retryable": false7 },8 "credits_charged": 0,9 "request_id": "req_5ab35d0c7414b9fe1dc97847"10}Also served at#
These paths answer the same request, so code written for other APIs keeps working: /v1/reddit/subreddit. See Switching from ScrapeCreators.
Related endpoints#
- Subreddit details (
GET /v1/reddit/subreddit/details) - Search within a subreddit (
GET /v1/reddit/subreddit/search) - Reddit post (
GET /v1/reddit/post) - Reddit post comments (
GET /v1/reddit/post/comments) - Reddit post comments (POST body) (
POST /v1/reddit/post/comments) - Reddit video post transcript (
GET /v1/reddit/post/transcript) - Reddit search (
GET /v1/reddit/search)