Subreddit posts API
  1. Docs
  2. Reddit
  3. Subreddit posts API

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_days to reuse them for free.
  • Timeout: A request still running after about 25 seconds answers 202 with a job to poll (Batch and jobs).

Parameters#

NameTypeRequiredDescription
subredditstringyesSubreddit name without r/. Also accepted as sub.
sortstringnoOrder 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.
timeframestringnoWindow 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: true for a smaller response without null fields and extra.
  • raw: true to also get the platform's original object as raw.
  • 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"

Example response#

This is a sample from a recorded response, lists and long text are shortened. Status 200.

200 OKSample response
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.

CodeHTTPRetryMeaning
invalid_params400noA parameter is missing, unknown or has the wrong type.
not_found404noThe 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.