{
	"openapi": "3.0.0",
	"info": {
		"title": "Reddit RSS API (discontinued)",
		"description": "This project is discontinued and is no longer maintained. Reddit feed endpoints no longer work. This specification is retained for historical reference.\n\nReddit retired RSS feeds, announcing November 13, 2026 as the end-of-support date. See [Reddit's announcement](https://support.reddithelp.com/hc/en-us/articles/55472297340308-Changelog-November-10-2026).\n\nDeno Deploy, which hosts this service, is also scheduled to shut down in April 2027. Existing applications can continue running until then. See [Deno's announcement](https://deno.com/blog/cloudflare) and [shutdown notice](https://docs.deno.com/deploy/).\n\nThe API previously converted subreddit RSS feeds into JSON with filtering, sorting, merging, and random selection. During its last year of operation, it received approximately 30,000 requests per month. Moving to another host does not restore Reddit RSS access.\n\n[Source code and historical documentation](https://github.com/sametcn99/reddit-rss-api)",
		"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": "Former hosted service (discontinued; Reddit feeds no longer work)"
		},
		{
			"url": "http://localhost:8000",
			"description": "Historical local development server (Reddit RSS access is unavailable)"
		}
	],
	"paths": {
		"/r/{subreddits}": {
			"get": {
				"summary": "Discontinued: fetch RSS-derived JSON for subreddits",
				"description": "This endpoint no longer provides working Reddit feeds because Reddit retired RSS support. The parameters and response schemas below document its former behavior only.",
				"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(&#39;./util&#39;) 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(&#39;./util&#39;) 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(&#39;./util&#39;)..."
												}
											]
										}
									}
								}
							}
						}
					},
					"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"
								}
							}
						}
					}
				},
				"deprecated": true
			}
		}
	},
	"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"
				]
			}
		}
	}
}
