geddit

Reddit’s public API without authentication

Install

If you want to use this in your project, there are prebuilt versions available.

Import via the GitHub Pages URL:

https://kaangiray26.github.io/geddit/geddit.min.js

Examples

import { Geddit } from './geddit.js';
const g = new Geddit();

// Get the top 10 posts from r/AskReddit
let posts = await g.getTop('AskReddit', {
    limit: 10
})

console.log(posts);

How it works

Reddit has an undocumented feature that allows you to get data from their servers as RSS/JSON feeds. Geddit wraps around several endpoints to make it easier to get data from Reddit. This means that you can use Geddit to get data from Reddit without authentication, which is only suitable for getting public data.

Why use this?

Methods

Here are the methods that are available in Geddit. All methods return a promise that resolves to the data from Reddit. Methods are categorized by the source of the data.

Submissions

Domain specific submissions

Subreddits

Users

Live threads

Contribution

If you discover a new endpoint that is not in the list above, feel free to open an issue or a pull request.

Disclaimer

This project is an open-source software. The projects is nothing more than a simple example of how to use Reddit’s RSS/JSON feeds to build a library and it is not intended to be used instead of the Reddit API. Instead, use the official Reddit app or any other Reddit client that uses Reddit’s API for full functionality. No data is collected from the users and no profit is made from the library. Developers are not responsible for any damage caused by the library. Use at your own risk.