-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathopenapi.json
More file actions
368 lines (368 loc) · 11 KB
/
Copy pathopenapi.json
File metadata and controls
368 lines (368 loc) · 11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
{
"openapi": "3.0.0",
"info": {
"title": "Reddit RSS API",
"description": "A Deno-powered HTTP service that turns Reddit subreddit RSS feeds into structured JSON, complete with filtering, sorting, merging, and random selection utilities.\n\n### Key Features\n- **Multi-Subreddit Merging**: Consolidate multiple subreddits into a single feed.\n- **Media Filtering**: Filter by images or videos via query parameters.\n- **Flexible Sorting**: Sort items by date (`asc`, `desc`) or shuffle them (`mixed`).\n- **Zero Dependencies**: Built with Deno and TypeScript for high performance.\n\n### Quick Usage\n```bash\ncurl \"https://reddit-rss-api.sametcn99.deno.net/r/deno+typescript?merge=true&filter=image\"\n```\n\n### Resources\n- **GitHub Repository**: [sametcn99/reddit-rss-api](https://github.com/sametcn99/reddit-rss-api)\n- **Live API**: [https://reddit-rss-api.sametcn99.deno.net](https://reddit-rss-api.sametcn99.deno.net)",
"version": "1.0.0",
"contact": {
"name": "sametcn99",
"url": "https://github.com/sametcn99/reddit-rss-api"
}
},
"servers": [
{
"url": "https://reddit-rss-api.sametcn99.deno.net",
"description": "Production server"
},
{
"url": "http://localhost:8000",
"description": "Local development server"
}
],
"paths": {
"/r/{subreddits}": {
"get": {
"summary": "Fetch RSS-derived JSON for subreddits",
"description": "Fetches and processes Reddit RSS feeds for one or more subreddits. Supports filtering by media type, sorting, merging multiple subreddit feeds, and fetching random posts.",
"operationId": "getSubreddits",
"parameters": [
{
"name": "subreddits",
"in": "path",
"required": true,
"description": "One or more subreddit names. separate multiple subreddits with '+' (e.g. 'deno+typescript').",
"schema": {
"type": "string",
"example": "deno+typescript"
}
},
{
"name": "option",
"in": "query",
"required": false,
"description": "Operational mode. Use `random` to get a single random item from the feed.",
"schema": {
"type": "string",
"enum": [
"random"
]
}
},
{
"name": "sort",
"in": "query",
"required": false,
"description": "Sorting order for the feed items. `mixed` shuffles the items.",
"schema": {
"type": "string",
"enum": [
"asc",
"desc",
"mixed"
],
"default": "asc"
}
},
{
"name": "filter",
"in": "query",
"required": false,
"description": "Filter items by media type. Combine options with space (encoded as '+').",
"schema": {
"type": "string",
"enum": [
"image",
"video",
"image video"
],
"example": "image"
}
},
{
"name": "merge",
"in": "query",
"required": false,
"description": "If `true`, fetches each subreddit individually and merges the results. Useful for combining feeds.",
"schema": {
"type": "boolean",
"default": false
}
},
{
"name": "count",
"in": "query",
"required": false,
"description": "Limit the number of items in the response.",
"schema": {
"type": "integer",
"minimum": 1
}
},
{
"name": "old_reddit",
"in": "query",
"required": false,
"description": "If `true`, rewrites all Reddit links to use `old.reddit.com`.",
"schema": {
"type": "boolean",
"default": false
}
}
],
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/ResponseData"
},
{
"$ref": "#/components/schemas/ExtractedItem"
}
]
},
"examples": {
"feed": {
"summary": "Full: /r/deno?count=1",
"value": {
"title": "Deno - A secure TypeScript runtime on V8",
"lastBuildDate": "2026-02-05T15:36:46+00:00",
"link": "https://www.reddit.com/r/deno/",
"feedUrl": "https://www.reddit.com/r/deno/.rss",
"itemsLength": 1,
"items": [
{
"title": "Idiomatic conversion of js imports",
"link": "https://www.reddit.com/r/Deno/comments/1qwmxz7/idiomatic_conversion_of_js_imports/",
"author": "/u/turbofish_pk",
"isoDate": "2026-02-05T14:37:37.000Z",
"id": "t3_1qwmxz7",
"feedURL": "https://www.reddit.com/r/deno/.rss",
"message": "What is the most idiomatic way to convert require('./util') in js repo to TypeScript for Deno? ..."
}
]
}
},
"random": {
"summary": "Random: /r/deno?option=random",
"value": {
"title": "Visual Tabs - Build your own browser extension",
"link": "https://www.reddit.com/r/Deno/comments/1qegzo0/visual_tabs_build_your_own_browser_extension/",
"author": "/u/jlantunez",
"isoDate": "2026-01-16T14:11:57.000Z",
"id": "t3_1qegzo0",
"feedURL": "https://www.reddit.com/r/deno/.rss",
"message": "We built this solution to help you create a custom new tab extension...",
"links": [
"https://github.com/oscarotero/visual-tabs"
]
}
},
"merged": {
"summary": "Merged: /r/deno+typescript?merge=true&count=1",
"value": {
"title": "Merged feed for deno + typescript",
"lastBuildDate": "2026-02-05T15:38:20.181Z",
"link": "https://reddit-rss-api.sametcn99.deno.net/r/deno+typescript",
"feedUrl": "https://reddit-rss-api.sametcn99.deno.net/",
"itemsLength": 1,
"items": [
{
"title": "Idiomatic conversion of js imports",
"link": "https://www.reddit.com/r/Deno/comments/1qwmxz7/idiomatic_conversion_of_js_imports/",
"author": "/u/turbofish_pk",
"isoDate": "2026-02-05T14:37:37.000Z",
"id": "t3_1qwmxz7",
"feedURL": "https://www.reddit.com/r/deno/.rss",
"message": "What is the most idiomatic way to convert require('./util') in js repo to TypeScript for Deno? ..."
}
]
}
},
"filtered": {
"summary": "Filtered: /r/pics?filter=image&count=1",
"value": {
"title": "Reddit Pics",
"lastBuildDate": "2026-02-05T15:38:22+00:00",
"link": "https://www.reddit.com/r/pics/",
"feedUrl": "https://www.reddit.com/r/pics/.rss",
"itemsLength": 1,
"items": [
{
"title": "Shitler [OC]",
"link": "https://www.reddit.com/r/pics/comments/1qwbh7o/shitler_oc/",
"author": "/u/LordChodeymort",
"isoDate": "2026-02-05T04:26:56.000Z",
"id": "t3_1qwbh7o",
"feedURL": "https://www.reddit.com/r/pics/.rss",
"links": [
"https://i.redd.it/edwdlv3kslhg1.jpeg"
],
"images": [
"https://preview.redd.it/edwdlv3kslhg1.jpeg?width=640&crop=smart&auto=webp&s=f4294e21eaad3f059833facf7cb2ef5dc9dd69b0"
]
}
]
}
},
"old_reddit": {
"summary": "Old Reddit: /r/deno?old_reddit=true&count=1",
"value": {
"title": "Deno - A secure TypeScript runtime on V8",
"lastBuildDate": "2026-02-05T15:38:23+00:00",
"link": "https://old.reddit.com/r/deno/",
"feedUrl": "https://old.reddit.com/r/deno/.rss",
"itemsLength": 1,
"items": [
{
"title": "Idiomatic conversion of js imports",
"link": "https://old.reddit.com/r/Deno/comments/1qwmxz7/idiomatic_conversion_of_js_imports/",
"author": "/u/turbofish_pk",
"isoDate": "2026-02-05T14:37:37.000Z",
"id": "t3_1qwmxz7",
"feedURL": "https://old.reddit.com/r/deno/.rss",
"message": "What is the most idiomatic way to convert require('./util')..."
}
]
}
}
}
}
}
},
"400": {
"description": "Bad Request - Invalid parameters or subreddits",
"content": {
"text/plain": {
"schema": {
"type": "string",
"example": "Invalid sort option. Use 'asc', 'desc' or 'mixed' as sort option."
}
}
}
},
"405": {
"description": "Method Not Allowed",
"content": {
"text/plain": {
"schema": {
"type": "string",
"example": "Method Not Allowed"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"ResponseData": {
"type": "object",
"properties": {
"title": {
"type": "string",
"description": "Title of the feed"
},
"lastBuildDate": {
"type": "string",
"format": "date-time",
"description": "Last update time of the feed"
},
"link": {
"type": "string",
"description": "Link to the subreddit(s)"
},
"feedUrl": {
"type": "string",
"description": "The source RSS feed URL"
},
"itemsLength": {
"type": "integer",
"description": "Number of items in the response"
},
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ExtractedItem"
}
}
},
"required": [
"title",
"lastBuildDate",
"link",
"feedUrl",
"items"
]
},
"ExtractedItem": {
"type": "object",
"properties": {
"title": {
"type": "string",
"description": "Title of the post"
},
"link": {
"type": "string",
"description": "Link to the Reddit post"
},
"author": {
"type": "string",
"description": "Author of the post"
},
"isoDate": {
"type": "string",
"format": "date-time",
"description": "Publication date"
},
"feedURL": {
"type": "string",
"description": "Source feed URL"
},
"id": {
"type": "string",
"description": "Unique identifier for the post"
},
"message": {
"type": "string",
"description": "Content or description"
},
"links": {
"type": "array",
"items": {
"type": "string"
},
"description": "External links extracted from the post"
},
"images": {
"type": "array",
"items": {
"type": "string"
},
"description": "Image URLs extracted from the post"
},
"videos": {
"type": "array",
"items": {
"type": "string"
},
"description": "Video URLs extracted from the post"
}
},
"required": [
"title",
"link",
"author",
"isoDate",
"feedURL",
"id"
]
}
}
}
}