Reddit Subreddit Scraper avatar

Reddit Subreddit Scraper

Try for free

1 day trial then $39.00/month - No credit card required now

Go to Store
Reddit Subreddit Scraper

Reddit Subreddit Scraper

stefanie-rink/reddit-subreddit-scraper
Try for free

1 day trial then $39.00/month - No credit card required now

Get Posts and comments from any subreddit - with sorting options for both posts and comments.

You can access the Reddit Subreddit Scraper programmatically from your own applications by using the Apify API. You can choose the language preference from below. To use the Apify API, you’ll need an Apify account and your API token, found in Integrations settings in Apify Console.

1{
2  "openapi": "3.0.1",
3  "info": {
4    "version": "0.0",
5    "x-build-id": "r6fxMXSvRGifcJcNO"
6  },
7  "servers": [
8    {
9      "url": "https://api.apify.com/v2"
10    }
11  ],
12  "paths": {
13    "/acts/stefanie-rink~reddit-subreddit-scraper/run-sync-get-dataset-items": {
14      "post": {
15        "operationId": "run-sync-get-dataset-items-stefanie-rink-reddit-subreddit-scraper",
16        "x-openai-isConsequential": false,
17        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
18        "tags": [
19          "Run Actor"
20        ],
21        "requestBody": {
22          "required": true,
23          "content": {
24            "application/json": {
25              "schema": {
26                "$ref": "#/components/schemas/inputSchema"
27              }
28            }
29          }
30        },
31        "parameters": [
32          {
33            "name": "token",
34            "in": "query",
35            "required": true,
36            "schema": {
37              "type": "string"
38            },
39            "description": "Enter your Apify token here"
40          }
41        ],
42        "responses": {
43          "200": {
44            "description": "OK"
45          }
46        }
47      }
48    },
49    "/acts/stefanie-rink~reddit-subreddit-scraper/runs": {
50      "post": {
51        "operationId": "runs-sync-stefanie-rink-reddit-subreddit-scraper",
52        "x-openai-isConsequential": false,
53        "summary": "Executes an Actor and returns information about the initiated run in response.",
54        "tags": [
55          "Run Actor"
56        ],
57        "requestBody": {
58          "required": true,
59          "content": {
60            "application/json": {
61              "schema": {
62                "$ref": "#/components/schemas/inputSchema"
63              }
64            }
65          }
66        },
67        "parameters": [
68          {
69            "name": "token",
70            "in": "query",
71            "required": true,
72            "schema": {
73              "type": "string"
74            },
75            "description": "Enter your Apify token here"
76          }
77        ],
78        "responses": {
79          "200": {
80            "description": "OK",
81            "content": {
82              "application/json": {
83                "schema": {
84                  "$ref": "#/components/schemas/runsResponseSchema"
85                }
86              }
87            }
88          }
89        }
90      }
91    },
92    "/acts/stefanie-rink~reddit-subreddit-scraper/run-sync": {
93      "post": {
94        "operationId": "run-sync-stefanie-rink-reddit-subreddit-scraper",
95        "x-openai-isConsequential": false,
96        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
97        "tags": [
98          "Run Actor"
99        ],
100        "requestBody": {
101          "required": true,
102          "content": {
103            "application/json": {
104              "schema": {
105                "$ref": "#/components/schemas/inputSchema"
106              }
107            }
108          }
109        },
110        "parameters": [
111          {
112            "name": "token",
113            "in": "query",
114            "required": true,
115            "schema": {
116              "type": "string"
117            },
118            "description": "Enter your Apify token here"
119          }
120        ],
121        "responses": {
122          "200": {
123            "description": "OK"
124          }
125        }
126      }
127    }
128  },
129  "components": {
130    "schemas": {
131      "inputSchema": {
132        "type": "object",
133        "required": [
134          "queries"
135        ],
136        "properties": {
137          "queries": {
138            "title": "Start URLs or subreddits",
139            "type": "array",
140            "description": "Subreddits to scrape in the format of https://reddit.com/r/<subreddit>",
141            "default": [
142              "https://reddit.com/r/AskReddit"
143            ],
144            "items": {
145              "type": "string"
146            }
147          },
148          "postSort": {
149            "title": "Sorting",
150            "enum": [
151              "hot",
152              "new",
153              "top",
154              "rising"
155            ],
156            "type": "string",
157            "description": "Sorting of posts in the subreddit - (top, new, rising, hot) - If already given a sorted subreddit link (e.g.: https://reddit.com/r/eli5/top/?t=day) the sorting will be ignored",
158            "default": "hot"
159          },
160          "topPeriod": {
161            "title": "Top posts period",
162            "enum": [
163              "hour",
164              "day",
165              "week",
166              "month",
167              "year",
168              "all"
169            ],
170            "type": "string",
171            "description": "Top posts period - (only works when sorting is top)",
172            "default": "day"
173          },
174          "limit": {
175            "title": "Max Posts",
176            "type": "integer",
177            "description": "Maximum number of posts to scrape per URL (default: 10)",
178            "default": 10
179          },
180          "commentSort": {
181            "title": "Comment sorting",
182            "enum": [
183              "best",
184              "top",
185              "new",
186              "controversial",
187              "old",
188              "qa"
189            ],
190            "type": "string",
191            "description": "Sorting of comments in the post - (best, top, new, controversial, old, qa)",
192            "default": "top"
193          },
194          "numComments": {
195            "title": "Number of comments to scrape",
196            "type": "integer",
197            "description": "A few replies to comments is also returned",
198            "default": 0
199          }
200        }
201      },
202      "runsResponseSchema": {
203        "type": "object",
204        "properties": {
205          "data": {
206            "type": "object",
207            "properties": {
208              "id": {
209                "type": "string"
210              },
211              "actId": {
212                "type": "string"
213              },
214              "userId": {
215                "type": "string"
216              },
217              "startedAt": {
218                "type": "string",
219                "format": "date-time",
220                "example": "2025-01-08T00:00:00.000Z"
221              },
222              "finishedAt": {
223                "type": "string",
224                "format": "date-time",
225                "example": "2025-01-08T00:00:00.000Z"
226              },
227              "status": {
228                "type": "string",
229                "example": "READY"
230              },
231              "meta": {
232                "type": "object",
233                "properties": {
234                  "origin": {
235                    "type": "string",
236                    "example": "API"
237                  },
238                  "userAgent": {
239                    "type": "string"
240                  }
241                }
242              },
243              "stats": {
244                "type": "object",
245                "properties": {
246                  "inputBodyLen": {
247                    "type": "integer",
248                    "example": 2000
249                  },
250                  "rebootCount": {
251                    "type": "integer",
252                    "example": 0
253                  },
254                  "restartCount": {
255                    "type": "integer",
256                    "example": 0
257                  },
258                  "resurrectCount": {
259                    "type": "integer",
260                    "example": 0
261                  },
262                  "computeUnits": {
263                    "type": "integer",
264                    "example": 0
265                  }
266                }
267              },
268              "options": {
269                "type": "object",
270                "properties": {
271                  "build": {
272                    "type": "string",
273                    "example": "latest"
274                  },
275                  "timeoutSecs": {
276                    "type": "integer",
277                    "example": 300
278                  },
279                  "memoryMbytes": {
280                    "type": "integer",
281                    "example": 1024
282                  },
283                  "diskMbytes": {
284                    "type": "integer",
285                    "example": 2048
286                  }
287                }
288              },
289              "buildId": {
290                "type": "string"
291              },
292              "defaultKeyValueStoreId": {
293                "type": "string"
294              },
295              "defaultDatasetId": {
296                "type": "string"
297              },
298              "defaultRequestQueueId": {
299                "type": "string"
300              },
301              "buildNumber": {
302                "type": "string",
303                "example": "1.0.0"
304              },
305              "containerUrl": {
306                "type": "string"
307              },
308              "usage": {
309                "type": "object",
310                "properties": {
311                  "ACTOR_COMPUTE_UNITS": {
312                    "type": "integer",
313                    "example": 0
314                  },
315                  "DATASET_READS": {
316                    "type": "integer",
317                    "example": 0
318                  },
319                  "DATASET_WRITES": {
320                    "type": "integer",
321                    "example": 0
322                  },
323                  "KEY_VALUE_STORE_READS": {
324                    "type": "integer",
325                    "example": 0
326                  },
327                  "KEY_VALUE_STORE_WRITES": {
328                    "type": "integer",
329                    "example": 1
330                  },
331                  "KEY_VALUE_STORE_LISTS": {
332                    "type": "integer",
333                    "example": 0
334                  },
335                  "REQUEST_QUEUE_READS": {
336                    "type": "integer",
337                    "example": 0
338                  },
339                  "REQUEST_QUEUE_WRITES": {
340                    "type": "integer",
341                    "example": 0
342                  },
343                  "DATA_TRANSFER_INTERNAL_GBYTES": {
344                    "type": "integer",
345                    "example": 0
346                  },
347                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
348                    "type": "integer",
349                    "example": 0
350                  },
351                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
352                    "type": "integer",
353                    "example": 0
354                  },
355                  "PROXY_SERPS": {
356                    "type": "integer",
357                    "example": 0
358                  }
359                }
360              },
361              "usageTotalUsd": {
362                "type": "number",
363                "example": 0.00005
364              },
365              "usageUsd": {
366                "type": "object",
367                "properties": {
368                  "ACTOR_COMPUTE_UNITS": {
369                    "type": "integer",
370                    "example": 0
371                  },
372                  "DATASET_READS": {
373                    "type": "integer",
374                    "example": 0
375                  },
376                  "DATASET_WRITES": {
377                    "type": "integer",
378                    "example": 0
379                  },
380                  "KEY_VALUE_STORE_READS": {
381                    "type": "integer",
382                    "example": 0
383                  },
384                  "KEY_VALUE_STORE_WRITES": {
385                    "type": "number",
386                    "example": 0.00005
387                  },
388                  "KEY_VALUE_STORE_LISTS": {
389                    "type": "integer",
390                    "example": 0
391                  },
392                  "REQUEST_QUEUE_READS": {
393                    "type": "integer",
394                    "example": 0
395                  },
396                  "REQUEST_QUEUE_WRITES": {
397                    "type": "integer",
398                    "example": 0
399                  },
400                  "DATA_TRANSFER_INTERNAL_GBYTES": {
401                    "type": "integer",
402                    "example": 0
403                  },
404                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
405                    "type": "integer",
406                    "example": 0
407                  },
408                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
409                    "type": "integer",
410                    "example": 0
411                  },
412                  "PROXY_SERPS": {
413                    "type": "integer",
414                    "example": 0
415                  }
416                }
417              }
418            }
419          }
420        }
421      }
422    }
423  }
424}

Reddit Subreddit Scraper OpenAPI definition

OpenAPI is a standard for designing and describing RESTful APIs, allowing developers to define API structure, endpoints, and data formats in a machine-readable way. It simplifies API development, integration, and documentation.

OpenAPI is effective when used with AI agents and GPTs by standardizing how these systems interact with various APIs, for reliable integrations and efficient communication.

By defining machine-readable API specifications, OpenAPI allows AI models like GPTs to understand and use varied data sources, improving accuracy. This accelerates development, reduces errors, and provides context-aware responses, making OpenAPI a core component for AI applications.

You can download the OpenAPI definitions for Reddit Subreddit Scraper from the options below:

If you’d like to learn more about how OpenAPI powers GPTs, read our blog post.

You can also check out our other API clients:

Developer
Maintained by Community

Actor Metrics

  • 2 monthly users

  • 1 bookmark

  • 92% runs succeeded

  • Created in Oct 2024

  • Modified 9 days ago