- Cost
- 1 credit
- Cached repeats
- 0 creditssend max_age_days, results kept 30 days
- Failed requests
- 0 credits
The cursor is Reddit's after token.
You send subreddit.
Part of the Reddit Scraper API: 7 Reddit endpoints on one key.
Request
Send your key in the x-api-key header.
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 timeout=60,12)13body = res.json()1415if body["ok"]:16 print(body["data"])17else:18 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}Parameters
| Name | Type | Required | Description |
|---|---|---|---|
subreddit | string | yes | Subreddit name without r/. Also accepted as sub. |
sort | string | Order of results. Changing it restarts the cursor chain. Also accepted as sort_by, sortBy, order. | |
timeframe | string | Window for top/controversial sorts. Also accepted as t, time. | |
cursor | string | Opaque cursor from the previous page; pass it back unchanged. Also accepted as continuationToken, continuation_token, next_max_id, max_id, max_cursor, min_time, after, page_token, pageToken, paginationToken, next_page_id, page. |
Every request also accepts trim, raw and max_age_days.
Response
Sample from a recorded response, shortened. Values are examples, not your data.
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=4cd002de4de73dc3395...",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 abo...",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 }60 },61 {62 "object": "post",63 "platform": "reddit",64 "id": "1xoh5m4",65 "url": "https://www.reddit.com/r/Python/comments/1xoh5m4/qsfilter_on_its_own_line_does_nothing_patterns/",66 "type": "text",67 "author": {68 "id": "t2_22q19z3qrr",69 "handle": "jeonghun917",70 "name": "jeonghun917",71 "url": "https://www.reddit.com/user/jeonghun917/",72 "avatar_url": "https://www.redditstatic.com/avatars/defaults/v2/avatar_default_7.png",73 "verified": null74 },75 "title": "qs.filter(...) on its own line does nothing. Patterns like this across 44 open-source repos: 62 app",76 "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 ch...",77 "published_at": "2026-11-05T12:15:18.639000Z",78 "duration_seconds": null,79 "language": "en",80 "hashtags": null,81 "mentions": null,82 "stats": {83 "views": null,84 "likes": 0,85 "comments": 1,86 "shares": null,87 "saves": null,88 "dislikes": null89 },90 "media": {91 "thumbnail_url": null,92 "video_url": null,93 "audio_url": null,94 "image_urls": null,95 "width": null,96 "height": null97 },98 "song": null,99 "location": null,100 "is_pinned": null,101 "is_sponsored": null,102 "extra": {103 "award_count": 0,104 "domain": "self.Python",105 "flair": "Discussion",106 "post_type": "text",107 "score": 0,108 "subreddit": "Python"109 }110 }111 ],112 "cursor": "dDNfMXhobnZzMA==",113 "has_more": true,114 "parent": {115 "object": "community",116 "platform": "reddit",117 "id": "t5_2qh0y",118 "url": "https://www.reddit.com/r/Python/",119 "kind": "subreddit",120 "name": "Python",121 "title": null,122 "description": null,123 "avatar_url": null,124 "banner_url": null,125 "member_count": null,126 "online_count": null,127 "is_nsfw": null,128 "is_private": null,129 "verified": null,130 "created_at": null,131 "extra": null132 }133 },134 "cursor": "dDNfMXhobnZzMA==",135 "has_more": true136}Fields
A page of results. Each entry in items is a Post. cursor and has_more page through the rest.
A field the platform does not give is null, never made up. Extra platform details are in extra.
| Field | Type | Always | Notes |
|---|---|---|---|
object | "post" | ||
platform | Platform | yes | |
id | string | yes | |
url | string or null | ||
type | "video" or "short" or "reel" or "image" or "carousel" or "story" or "live" or "clip" or "text" or "link" or "tweet" or "pin" or "community_post" or "episode" or "unknown" | ||
author | Author or null | ||
title | string or null | ||
text | string or null | ||
published_at | string (ISO 8601 date-time) or null | ||
duration_seconds | number or null | ||
language | string or null | ||
hashtags | string[] or null | ||
mentions | string[] or null | ||
stats | Stats |
Show the other 6 fields
Full field list in the reference for this endpoint and the data models. Errors are listed under Errors.
Questions
Which errors can it return?
invalid_params (do not retry), not_found (do not retry). Account and platform errors from the errors list can also happen. A failure always costs 0 credits.
How do I get more than one page?
Send the same request with cursor set to the cursor you received, until has_more is false. Each page costs its own price. See pagination.
Is there an SDK call for it?
The Python client has client.reddit.subreddit_posts(...) and the TypeScript client client.reddit.subredditPosts(). Both return the same envelope as the HTTP API. Install them from PyPI (socialscrape-sdk) or npm (socialscrape); plain HTTP works in any language.
Can an AI agent call it?
Yes. The MCP server, which you run on your own machine, reaches every built endpoint, with the same prices.