Skip to content

This project appears to be a Deno-based server application that serves as an API for fetching Reddit posts from rss feed. It provides several endpoints to fetch posts from one or more subreddits.

Notifications You must be signed in to change notification settings

sametcn99/reddit-rss-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

Deno

This project is a Deno-based server application serving as an API for fetching Reddit posts from RSS feeds. It offers multiple endpoints to retrieve posts from one or more subreddits.

Merging Subreddits

The merge option enables you to gather data from multiple RSS feeds and consolidate them into a single response. By default, Reddit's RSS feed can return data from multiple subreddits in one request, but it has limitations on the amount of data. Setting the merge option to true prompts our API to send separate requests for each specified subreddit and then merge the results. This method yields more items compared to Reddit's default multiple subreddit RSS feed.

Getting Started

Combining Query Parameters

When using the API, you can combine different query parameters to tailor your request according to your needs.

Query Parameters

  • option: Set this query parameter to random to fetch a random post from the specified subreddit(s).
  • sort: Set this query parameter to mixed, asc, or desc to sort the posts.
  • filter: Set this query parameter to image, video or video+image to retrieve only filtered posts from the feeds.
  • merge: Set this query parameter to true or false to merge items from multiple subreddits, useful for obtaining more posts from the feeds.
  • count: Set this query parameter for limit items. (count={number})

Response Types

type ExtractedItem = {
  title: string;
  link: string;
  author: string;
  isoDate: Date;
  feedURL: string;
  id: string;
  message?: string;
  links?: string[];
  images?: string[];
  videos?: string[];
};

type ResponseData = {
  feed?: Feed;
  title: string;
  lastBuildDate: Date;
  link: string;
  feedUrl: string;
  itemsLength?: number;
  items: ExtractedItem[];
};

Check out example endpoints on Postman Docs.

Source Code

About

This project appears to be a Deno-based server application that serves as an API for fetching Reddit posts from rss feed. It provides several endpoints to fetch posts from one or more subreddits.

Topics

Resources

Stars

Watchers

Forks